Zend2 Wiki
ホーム
新規
編集
差分
バックアップ
添付
最終更新
一覧
検索
ヘルプ
編集 : Zend/Db/TableGateway
Zend
Db
TableGateway
#contents *基本的な利用方法 [#gDkeVxB] #sh(php){{ $userTable = new TableGateway('user', $adapter); $rowset = $userTable->select(array('user_id' => 1)); $userRow = $rowset->current(); var_dump($artistRow); }} *コンストラクタ [#aFHTeyJ] :引数|string $table AdapterInterface $adapter Feature\AbstractFeature|Feature\FeatureSet|Feature\AbstractFeature[] $features ResultSetInterface $resultSetPrototype Sql $sql #sh(php){$tgw = new TableGateway("table", $adapter, null, $resultSetPrototype);} * select [#s0bdKN7] :引数|Where|\Closure|string|array $where [[Zend/Db/Sql>Zend/Db/Sql#8hdU3yM]]クラスを利用される。 #sh(php){$userTable->select(array("name"=>"yamada"));} Closureの利用 #sh(php){{ $name = "yama%"; $userTable->select(function (Select $select) use ($name) { $select->where->like('name', $name); $select->order('name ASC')->limit(2); }); }} * insert [#sm3VrxN] :引数|array $set #sh(php){$userTable->insert(array("name"=>"tanaka", "age"=>"25"));} * update [#BeE85Dl] :引数|array $set string|array|closure $where #sh(php){$userTable->update(array("age"=>"30"), array("name"=>"tanaka"));} * delete [#HAeAmma] :引数|Where|\Closure|string|array $where #sh(php){$userTable->delete(array("name"=>"tanaka"));}
#contents *基本的な利用方法 [#gDkeVxB] #sh(php){{ $userTable = new TableGateway('user', $adapter); $rowset = $userTable->select(array('user_id' => 1)); $userRow = $rowset->current(); var_dump($artistRow); }} *コンストラクタ [#aFHTeyJ] :引数|string $table AdapterInterface $adapter Feature\AbstractFeature|Feature\FeatureSet|Feature\AbstractFeature[] $features ResultSetInterface $resultSetPrototype Sql $sql #sh(php){$tgw = new TableGateway("table", $adapter, null, $resultSetPrototype);} * select [#s0bdKN7] :引数|Where|\Closure|string|array $where [[Zend/Db/Sql>Zend/Db/Sql#8hdU3yM]]クラスを利用される。 #sh(php){$userTable->select(array("name"=>"yamada"));} Closureの利用 #sh(php){{ $name = "yama%"; $userTable->select(function (Select $select) use ($name) { $select->where->like('name', $name); $select->order('name ASC')->limit(2); }); }} * insert [#sm3VrxN] :引数|array $set #sh(php){$userTable->insert(array("name"=>"tanaka", "age"=>"25"));} * update [#BeE85Dl] :引数|array $set string|array|closure $where #sh(php){$userTable->update(array("age"=>"30"), array("name"=>"tanaka"));} * delete [#HAeAmma] :引数|Where|\Closure|string|array $where #sh(php){$userTable->delete(array("name"=>"tanaka"));}
ページの更新
差分
プレビュー
キャンセル
スポンサー
ログイン
登録
TITLE
Data is Null!