Cake\ORM\Query::all PHP Method

all() public method

{@inheritDoc}
public all ( )
    public function all()
    {
        if ($this->_type !== 'select' && $this->_type !== null) {
            throw new RuntimeException('You cannot call all() on a non-select query. Use execute() instead.');
        }
        return $this->_all();
    }

Usage Example

Example #1
0
 /**
  * Integration test for query caching.
  *
  * @return void
  */
 public function testCacheWriteIntegration()
 {
     $table = TableRegistry::get('Articles');
     $query = new Query($this->connection, $table);
     $query->select(['id', 'title']);
     $cacher = $this->getMock('Cake\\Cache\\CacheEngine');
     $cacher->expects($this->once())->method('write')->with('my_key', $this->isInstanceOf('Cake\\Datasource\\ResultSetInterface'));
     $query->cache('my_key', $cacher)->where(['id' => 1]);
     $query->all();
 }
All Usage Examples Of Cake\ORM\Query::all