Пример #1
0
 /**
  * @param $tables
  *
  * @return \CDbCommand
  */
 public function from($tables)
 {
     $tables = $this->getConnection()->addTablePrefix($tables);
     return parent::from($tables);
 }
Пример #2
0
 /**
  * @param $tables
  * @return \CDbCommand
  */
 public function from($tables)
 {
     $tables = DbHelper::addTablePrefix($tables);
     return parent::from($tables);
 }
Пример #3
0
 private static function fetchPosts(CDbCommand $cmd)
 {
     $cmd->from(TABLE_POST)->select(array('id', 'title', 'thumbnail', 'summary', 'content', 'create_time'))->order(array('create_time desc', 'id desc'))->limit(self::POST_COUNT);
     $rows = $cmd->queryAll();
     return $rows;
 }
Пример #4
0
 /**
  * Executes the SQL statement and returns all rows.
  * @param CDbCommand $cmd
  * @param array $params
  * @param boolean $fetchAssociative
  * @return array the record found. An empty array if none is found.
  */
 public function queryAll(CDbCommand $cmd, $params = array(), $fetchAssociative = true)
 {
     $this->beforeFind();
     $cmd->from($this->table() . ' t');
     return $cmd->queryAll($fetchAssociative, $params);
 }