このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
apricot:app:db-model [2020/05/13 23:21] y2sunlight [モデルクラス] |
apricot:app:db-model [2020/05/23 14:58] (現在) y2sunlight [モデルクラス] |
||
|---|---|---|---|
| 行 17: | 行 17: | ||
| * [[apricot: | * [[apricot: | ||
| * [[apricot: | * [[apricot: | ||
| - | * [[apricot: | + | * [[apricot: |
| \\ | \\ | ||
| 行 295: | 行 295: | ||
| ^メソッド名^機能^ | ^メソッド名^機能^ | ||
| - | |for_table()\\ :ORM|ORMオブジェクトの取得\\ テーブル名(snake_case)はクラス名(UpperCamelCase)から自動判定します。| | + | |tableName()\\ :string|テーブル名の取得\\ テーブル名(snake_case)はクラス名(UpperCamelCase)から自動判定します。| |
| + | |for_table()\\ : | ||
| |findAll()\\ : | |findAll()\\ : | ||
| |findOne\\ (int $id): | |findOne\\ (int $id): | ||
| 行 326: | 行 327: | ||
| private $success = false; | private $success = false; | ||
| + | /** | ||
| + | * テーブル名の取得 | ||
| + | * @return string | ||
| + | */ | ||
| + | public function tableName(): | ||
| + | { | ||
| + | return snake_case(get_short_class_name($this)); | ||
| + | } | ||
| + | | ||
| /** | /** | ||
| * テーブルの取得 | * テーブルの取得 | ||