Пример #1
0
 /**
  * @covers MarketMeSuite\Phranken\Database\Object\DbObject::toArray
  */
 public function testToArray2()
 {
     $this->object->setToArrayAllowNull(true);
     $this->object->fromArray($this->validDbArrayNullValues);
     $expected = $this->object->toArray($this->validDbArrayNullValues);
     $actual = $this->validDbArrayNullValues;
     $this->assertSame($expected, $actual, 'The object should be able to convert from and array to and object and back again with no issues');
 }
 /**
  * @return array
  * @see DbObject::toArray
  */
 public function toArray()
 {
     // do regular parse
     $arr = parent::toArray();
     // get all dynamic properties
     $dynamicProps = $this->getDynamicprops();
     // if no dynamic properties are set then
     // just return the parent result
     if (!is_array($dynamicProps)) {
         return $arr;
     }
     // merge and return full data
     return array_merge($arr, $dynamicProps);
 }