src/wcmf/lib/persistence/impl/DefaultTransaction.php
protected function registerLoaded(PersistentObject $object) {
    $oid = $object->getOID();
    $key = $oid->__toString();
    if (self::$isDebugEnabled) {
      self::$logger->debug("New Data:\n".$object->dump());
      self::$logger->debug("Registry before:\n".$this->dump());
    }
    // register the object if it is newly loaded or
    // merge the attributes, if it is already loaded
    $registeredObject = null;
    if (isset($this->loadedObjects[$key])) {
      $registeredObject = $this->loadedObjects[$key];
      // merge existing attributes with new attributes
      if (self::$isDebugEnabled) {
        self::$logger->debug("Merging data of ".$key);
      }
      $registeredObject->mergeValues($object);
    }
    else {
      if (self::$isDebugEnabled) {
        self::$logger->debug("Register loaded object: ".$key);
      }
      $this->loadedObjects[$key] = $object;
      // start to listen to changes if the transaction is active
      if ($this->isActive) {
        if (self::$isDebugEnabled) {
          self::$logger->debug("Start listening to: ".$key);
        }
        $this->observedObjects[$key] = $object;
      }
      $registeredObject = $object;
    }
    if (self::$isDebugEnabled) {
      self::$logger->debug("Registry after:\n".$this->dump());
    }
    return $registeredObject;
  }
protected function registerLoaded(PersistentObject $object) {
    $oid = $object->getOID();
    $key = $oid->__toString();
    if (self::$isDebugEnabled) {
      self::$logger->debug("New Data:\n".$object->dump());
      self::$logger->debug("Registry before:\n".$this->dump());
    }
    // register the object if it is newly loaded or
    // merge the attributes, if it is already loaded
    $registeredObject = null;
    if (isset($this->loadedObjects[$key])) {
      $registeredObject = $this->loadedObjects[$key];
      // merge existing attributes with new attributes
      if (self::$isDebugEnabled) {
        self::$logger->debug("Merging data of ".$key);
      }
      $registeredObject->mergeValues($object);
    }
    else {
      if (self::$isDebugEnabled) {
        self::$logger->debug("Register loaded object: ".$key);
      }
      $this->loadedObjects[$key] = $object;
      // start to listen to changes if the transaction is active
      if ($this->isActive) {
        if (self::$isDebugEnabled) {
          self::$logger->debug("Start listening to: ".$key);
        }
        $this->observedObjects[$key] = $object;
      }
      $registeredObject = $object;
    }
    if (self::$isDebugEnabled) {
      self::$logger->debug("Registry after:\n".$this->dump());
    }
    return $registeredObject;
  }
protected function registerLoaded ( PersistentObject $ object ) { $ oid = $ object -> getOID ( ) ; $ key = $ oid -> __toString ( ) ; if ( self :: $ isDebugEnabled ) { self :: $ logger -> debug ( "New Data:\n" . $ object -> dump ( ) ) ; self :: $ logger -> debug ( "Registry before:\n" . $ this -> dump ( ) ) ; } // register the object if it is newly loaded or // merge the attributes, if it is already loaded $ registeredObject = null ; if ( isset ( $ this -> loadedObjects [ $ key ] ) ) { $ registeredObject = $ this -> loadedObjects [ $ key ] ; // merge existing attributes with new attributes if ( self :: $ isDebugEnabled ) { self :: $ logger -> debug ( "Merging data of " . $ key ) ; } $ registeredObject -> mergeValues ( $ object ) ; } else { if ( self :: $ isDebugEnabled ) { self :: $ logger -> debug ( "Register loaded object: " . $ key ) ; } $ this -> loadedObjects [ $ key ] = $ object ; // start to listen to changes if the transaction is active if ( $ this -> isActive ) { if ( self :: $ isDebugEnabled ) { self :: $ logger -> debug ( "Start listening to: " . $ key ) ; } $ this -> observedObjects [ $ key ] = $ object ; } $ registeredObject = $ object ; } if ( self :: $ isDebugEnabled ) { self :: $ logger -> debug ( "Registry after:\n" . $ this -> dump ( ) ) ; } return $ registeredObject ; }
Register a loaded object. The returned object is the registered instance.
@param $object PersistentObject instance
@return PersistentObject instance
Register a loaded object . The returned object is the registered instance .