public function build_sql(AbstractRelation $query) { $complete_sql = $query->complete_sql(); $this->query = $query; if ($complete_sql) { list($sql, $params) = $complete_sql; array_unshift($params, $sql); $this->_params = $params; $this->will_paginate = $query->will_paginate(); } else { $this->will_paginate = $query->will_paginate(); $this->_build_sql(); } }
public function __construct(ZfSql\Sql $sql, $tableName) { parent::__construct(); $this->sql = $sql; $this->tableName = $tableName; $this->from($this->tableName); }
protected function loadRecords($select) { return parent::loadRecords($this->selectDeletedRecords($select)); }
/** * @return ActiveRecord\Collection */ public static function createModelsFromQuery(AbstractRelation $query) { if ($query->will_paginate()) { $params = ['page' => $query->get_page(), 'perPage' => $query->get_per_page(), 'offset' => $query->get_offset(), 'totalRows' => $query->get_row_count()]; } else { $params = []; } return self::_create_collection($query->get_results()->fetchAll(PDO::FETCH_ASSOC), $params); }