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); }
/** * 生成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); }
public function __construct(Select $select) { $this->res = $select->execute(); $this->row_count = $this->res->rowCount(); $this->select = $select; }