/** * * @param Select $select Originating select object * @param Table $table Originating table * @param boolean $has_complete_record_definition */ public function __construct(Select $select, Table $table, $has_complete_record_definition = false) { $this->select = $select; $this->table = $table; $this->has_complete_record_definition = $has_complete_record_definition; $this->dataSource = $select->execute(); }
/** * Get a select object (Soluble\Db\Select) * * @param string $table_alias useful when you want to join columns * @return Select */ public function select($table_alias = null) { $prefixed_table = $this->prefixed_table; $select = new \Soluble\Db\Sql\Select(); $select->setDbAdapter($this->tableManager->getDbAdapter()); if ($table_alias === null) { $table_spec = $prefixed_table; } else { $table_spec = array($table_alias => $prefixed_table); } $select->from($table_spec); return $select; }
/** * Return an array version of the results * * @return array */ public function toArray() { return $this->select->execute()->toArray(); }
/** * Return a generic select * * @return Select */ public function select() { $select = new Select(); $select->setDbAdapter($this->adapter); return $select; }