Ejemplo n.º 1
0
 public function __get($name)
 {
     $method = 'get' . ucfirst($name);
     $mapper = ResultMapper::create();
     $list = $mapper->getAnnotatedProperties(get_class($this));
     if (isset($list[$name])) {
         $this->initializeProperty($name, $mapper->mapData(array(), $list[$name]));
     }
     if (method_exists($this, $method)) {
         return $this->{$method}();
     } else {
         return $this->{$name};
     }
 }
Ejemplo n.º 2
0
 /**
  * ADriver constructor.
  * @param IConnection $connection
  * @param IStorage $storage
  * @param IResultMapper $resultMapper
  */
 public function __construct(IConnection $connection, IStorage $storage = null, IResultMapper $resultMapper = null)
 {
     $this->connection = $connection;
     $this->setCacheStorage($storage ?? new ArrayStorage());
     $this->resultMapper = $resultMapper == null ? ResultMapper::create() : $resultMapper;
 }