src/wcmf/lib/presentation/format/impl/AbstractFormat.php
protected function getNode(ObjectId $oid) {
    $oidStr = $oid->__toString();
    if (!isset($this->deserializedNodes[$oidStr])) {
      $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
      $type = $oid->getType();
      if ($persistenceFacade->isKnownType($type)) {
        // don't create all values by default (-> don't use PersistenceFacade::create() directly, just for determining the class)
        $class = get_class($persistenceFacade->create($type, BuildDepth::SINGLE));
        $node = new $class;
      }
      else {
        $node = new Node($type);
      }
      $node->setOID($oid);
      $this->deserializedNodes[$oidStr] = $node;
    }
    return $this->deserializedNodes[$oidStr];
  }
protected function getNode(ObjectId $oid) {
    $oidStr = $oid->__toString();
    if (!isset($this->deserializedNodes[$oidStr])) {
      $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
      $type = $oid->getType();
      if ($persistenceFacade->isKnownType($type)) {
        // don't create all values by default (-> don't use PersistenceFacade::create() directly, just for determining the class)
        $class = get_class($persistenceFacade->create($type, BuildDepth::SINGLE));
        $node = new $class;
      }
      else {
        $node = new Node($type);
      }
      $node->setOID($oid);
      $this->deserializedNodes[$oidStr] = $node;
    }
    return $this->deserializedNodes[$oidStr];
  }
protected function getNode ( ObjectId $ oid ) { $ oidStr = $ oid -> __toString ( ) ; if ( ! isset ( $ this -> deserializedNodes [ $ oidStr ] ) ) { $ persistenceFacade = ObjectFactory :: getInstance ( 'persistenceFacade' ) ; $ type = $ oid -> getType ( ) ; if ( $ persistenceFacade -> isKnownType ( $ type ) ) { // don't create all values by default (-> don't use PersistenceFacade::create() directly, just for determining the class) $ class = get_class ( $ persistenceFacade -> create ( $ type , BuildDepth :: SINGLE ) ) ; $ node = new $ class ; } else { $ node = new Node ( $ type ) ; } $ node -> setOID ( $ oid ) ; $ this -> deserializedNodes [ $ oidStr ] = $ node ; } return $ this -> deserializedNodes [ $ oidStr ] ; }
Get a node with the given oid to deserialize values from form fields into it.
The method ensures that there is only one instance per oid.
@param $oid The oid
@return Node
Get a node with the given oid to deserialize values from form fields into it . The method ensures that there is only one instance per oid .