Пример #1
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);
 }
Пример #2
0
 /**
  * 生成Lysine\Storage\DB\Select实例
  *
  * @param string $table_name
  * @access public
  * @return Lysine\Storage\DB\Select
  */
 public function select($table_name)
 {
     $select = new Select($this);
     return $select->from($table_name);
 }
Пример #3
0
 public function __construct(Select $select)
 {
     $this->res = $select->execute();
     $this->row_count = $this->res->rowCount();
     $this->select = $select;
 }