Zend/Db/TableGatewayの変更点
- 追加された行はこの色です。
- 削除された行はこの色です。
- 移動:バックアップ
- 最新のバージョン:2014-04-09 14:08:49
- バージョン:(Rev:VU0ls65cc9)2014-04-09 13:59:33
| Old | New | 差分 | |
|---|---|---|---|
| 6 | 6 | $userRow = $rowset->current(); | |
| 7 | 7 | var_dump($artistRow); | |
| 8 | 8 | }} | |
| 9 | - | ||
| 9 | + | ||
| 10 | 10 | *コンストラクタ [#aFHTeyJ] | |
| 11 | 11 | :引数|string $table | |
| 12 | 12 | AdapterInterface $adapter | |
| 13 | 13 | Feature\AbstractFeature|Feature\FeatureSet|Feature\AbstractFeature[] $features | |
| 14 | 14 | ResultSetInterface $resultSetPrototype | |
| 15 | 15 | Sql $sql | |
| 16 | - | ||
| 16 | + | ||
| 17 | 17 | #sh(php){$tgw = new TableGateway("table", $adapter, null, $resultSetPrototype);} | |
| 18 | - | ||
| 19 | - | *select [#s0bdKN7] | |
| 18 | + | ||
| 19 | + | *select [#s0bdKN7] | |
| 20 | 20 | :引数|Where|\Closure|string|array $where | |
| 21 | - | ||
| 21 | + | ||
| 22 | 22 | [[Zend/Db/Sql>Zend/Db/Sql#8hdU3yM]]クラスを利用される。 | |
| 23 | 23 | #sh(php){$userTable->select(array("name"=>"yamada"));} | |
| 24 | 24 | Closureの利用 | |
| 29 | 29 | $select->order('name ASC')->limit(2); | |
| 30 | 30 | }); | |
| 31 | 31 | }} | |
| 32 | + | ||
| 33 | + | * insert [#sm3VrxN] | |
| 34 | + | :引数|array $set | |
| 35 | + | ||
| 36 | + | #sh(php){$userTable->insert(array("name"=>"tanaka", "age"=>"25"));} | |
| 37 | + | ||
| 38 | + | * update [#BeE85Dl] | |
| 39 | + | :引数|array $set | |
| 40 | + | string|array|closure $where | |
| 41 | + | ||
| 42 | + | #sh(php){$userTable->update(array("age"=>"30"), array("name"=>"tanaka"));} | |
| 43 | + | * delete [#HAeAmma] | |
| 44 | + | :引数|Where|\Closure|string|array $where | |
| 45 | + | ||
| 46 | + | #sh(php){$userTable->delete(array("name"=>"tanaka"));} | |
| 47 | + | ||