示例#1
0
 /**
  * Sets the property data for this object
  *
  * @param $data
  * @param $state
  * @return Morph_Object
  */
 public function __setData(array $data, $state = self::STATE_DIRTY)
 {
     if (array_key_exists('_id', $data)) {
         $this->Id = $data['_id'];
         unset($data['_id']);
     }
     if (array_key_exists('_ns', $data)) {
         unset($data['_ns']);
     }
     foreach ($data as $propertyName => $value) {
         $this->propertySet->__setRawPropertyValue($propertyName, $value);
     }
     $this->State = $state;
     return $this;
 }
示例#2
0
 public function testSetRawPropertyValue()
 {
     $expected = 'AValue';
     $propertySet = new Morph_PropertySet();
     $propertySet['P1'] = $this->getMockPropertyFor__RawSet($expected);
     $propertySet->__setRawPropertyValue('P1', $expected);
 }