src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php
protected function createObjectFromData(array $data) {
    // determine if we are loading or creating
    $createFromLoadedData = (sizeof($data) > 0) ? true : false;

    // initialize data and oid
    $oid = null;
    $initialData = $data;
    if ($createFromLoadedData) {
      $oid = $this->constructOID($initialData);
      // cleanup data
      foreach($initialData as $name => $value) {
        if ($this->hasAttribute($name) || strpos($name, self::INTERNAL_VALUE_PREFIX) === 0) {
          $value = $this->convertValueFromStorage($name, $value);
          $initialData[$name] = $value;
        }
        else {
          unset($initialData[$name]);
        }
      }
    }

    // construct object
    $object = $this->createObject($oid, $initialData);
    return $object;
  }
protected function createObjectFromData(array $data) {
    // determine if we are loading or creating
    $createFromLoadedData = (sizeof($data) > 0) ? true : false;

    // initialize data and oid
    $oid = null;
    $initialData = $data;
    if ($createFromLoadedData) {
      $oid = $this->constructOID($initialData);
      // cleanup data
      foreach($initialData as $name => $value) {
        if ($this->hasAttribute($name) || strpos($name, self::INTERNAL_VALUE_PREFIX) === 0) {
          $value = $this->convertValueFromStorage($name, $value);
          $initialData[$name] = $value;
        }
        else {
          unset($initialData[$name]);
        }
      }
    }

    // construct object
    $object = $this->createObject($oid, $initialData);
    return $object;
  }
protected function createObjectFromData ( array $ data ) { // determine if we are loading or creating $ createFromLoadedData = ( sizeof ( $ data ) > 0 ) ? true : false ; // initialize data and oid $ oid = null ; $ initialData = $ data ; if ( $ createFromLoadedData ) { $ oid = $ this -> constructOID ( $ initialData ) ; // cleanup data foreach ( $ initialData as $ name => $ value ) { if ( $ this -> hasAttribute ( $ name ) || strpos ( $ name , self :: INTERNAL_VALUE_PREFIX ) === 0 ) { $ value = $ this -> convertValueFromStorage ( $ name , $ value ) ; $ initialData [ $ name ] = $ value ; } else { unset ( $ initialData [ $ name ] ) ; } } } // construct object $ object = $ this -> createObject ( $ oid , $ initialData ) ; return $ object ; }
Create an object of the mapper's type with the given attributes from the given data
@param $data An associative array with the attribute names as keys and the attribute values as values
@return PersistentObject
Create an object of the mapper s type with the given attributes from the given data