Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function mapFromDb($param)
 {
     $fqcn = $this->extractFqcn($param);
     $reflector = new InjectionClass($fqcn);
     $obj = $reflector->newInstanceWithoutConstructor();
     foreach ($param as $key => $val) {
         // go deeper
         $mapped = $this->mediator->recursivCreate($val);
         // set the value
         $reflector->injectProperty($obj, $key, $mapped);
     }
     // wakeup the object
     if ($obj instanceof Cleanable) {
         $obj->wakeup();
     }
     return $obj;
 }
Exemplo n.º 2
0
 /**
  * @expectedException ReflectionException
  */
 public function testErrorWhenNoWakeup()
 {
     $refl = new InjectionClass('DateTime');
     $obj = $refl->newInstanceWithoutConstructor();
 }