Esempio n. 1
0
 public function __construct(Select $select)
 {
     $this->res = $select->execute();
     $this->row_count = $this->res->rowCount();
     $this->select = $select;
 }
Esempio n. 2
0
 public function compile()
 {
     list($sql, $bind) = parent::compile();
     if ($this->for_update !== null) {
         $sql .= ' FOR UPDATE';
         if ($this->for_update) {
             $sql .= ' NOTWAIT';
         }
     } elseif ($this->for_share !== null) {
         $sql .= ' FOR SHARE';
         if ($this->for_share) {
             $sql .= ' NOTWAIT';
         }
     }
     return array($sql, $bind);
 }
Esempio n. 3
0
 /**
  * 生成Onion\Storage\DB\Select实例
  *
  * @param string $table_name
  * @access public
  * @return Onion\Storage\DB\Select
  */
 public function select($table_name)
 {
     $select = new Select($this);
     return $select->from($table_name);
 }