예제 #1
0
 /**
  *
  * @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();
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
 /**
  * Return an array version of the results
  *
  * @return array
  */
 public function toArray()
 {
     return $this->select->execute()->toArray();
 }
예제 #4
0
 /**
  * Return a generic select
  *
  * @return Select
  */
 public function select()
 {
     $select = new Select();
     $select->setDbAdapter($this->adapter);
     return $select;
 }