Пример #1
0
 /**
  * (non-PHPdoc)
  * @see tao/classes/Morph/property/Morph_Property_Generic#__getRawValue()
  */
 public function __getRawValue()
 {
     if (!is_null($this->Value) && is_null($this->Reference)) {
         if ($this->Value->state() != Morph_Object::STATE_CLEAN) {
             //save value
             $this->Storage->save($this->Value);
         }
         $this->Reference = Morph_Utils::objectReference($this->Value);
     }
     return $this->Reference;
 }
Пример #2
0
 /**
  * (non-PHPdoc)
  * @see tao/classes/Morph/property/Morph_Property_Generic#__getRawValue()
  */
 public function __getRawValue()
 {
     if(!is_null($this->value)) {
         if($this->value->state() != \morph\Enum::STATE_CLEAN) {
             //save value
             \morph\Storage::instance()->save($this->value);
         }
         $this->reference = \morph\Utils::objectReference($this->value);
     }
     return $this->reference;
 }
Пример #3
0
 /**
  * Saves the provided object if necessary
  *
  * @param $object
  * @return Morph_Object
  */
 public function save(Morph_Object $object)
 {
     $response = $object;
     $object->__setStorage($this);
     //ensure that the storage object is set
     if ($object->state() == Morph_Object::STATE_DIRTY) {
         $response = $this->update($object);
     } elseif ($object->state() == Morph_Object::STATE_NEW) {
         $response = $this->insert($object);
     }
     return $response;
 }