コード例 #1
0
 /**
  * Helper method to get function result. Should be used only in case function was called.
  * For procedures always will return null.
  *
  * @return mixed
  */
 public function result()
 {
     if ($this->isNew() || !$this->_repository->schema()->isFunction()) {
         return null;
     }
     return $this->_properties[':result'];
 }
コード例 #2
0
 /**
  * Constructor
  *
  * @param Method $repository Method object instance.
  * @param \Cake\Database\StatementInterface $statement The statement to fetch from
  * @param array $options Additional resultset options that setup result entity.
  * @internal param \Cake\ORM\Query $query Query from where results come
  */
 public function __construct($repository, $statement, $options = [])
 {
     $options += ['entityClass' => 'Cake\\ORM\\Entity', 'hydrate' => true, 'useBuffering' => false, 'schema' => []];
     $this->_statement = $statement;
     $this->_driver = $repository->connection()->driver();
     $this->_hydrate = $options['hydrate'];
     $this->_entityClass = $options['entityClass'];
     $this->_useBuffering = $options['useBuffering'];
     $this->_schema = $options['schema'];
     $this->_types = $this->_getTypes(array_keys($this->_schema));
     if ($this->_useBuffering) {
         $count = $this->count();
         $this->_results = new SplFixedArray($count);
     }
 }