| 1 | <?php |
||
| 9 | class KeyedModel extends EntityModel { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Name of key field field in this table |
||
| 13 | * |
||
| 14 | * @var string $idFieldName |
||
| 15 | */ |
||
| 16 | protected $idFieldName = 'id'; |
||
| 17 | |||
| 18 | public function __construct(\Common\GlobalContainer $gc) { |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Exports object properties to DB row state WITHOUT ID |
||
| 31 | * |
||
| 32 | * Useful for INSERT operations |
||
| 33 | * |
||
| 34 | * @param \Entity\KeyedContainer $cEntity |
||
| 35 | */ |
||
| 36 | protected function exportRowNoId($cEntity) { |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param int|string $dbId |
||
| 46 | * |
||
| 47 | * @return EntityContainer|false |
||
| 48 | */ |
||
| 49 | public function loadById($dbId) { |
||
| 59 | |||
| 60 | |||
| 61 | /** |
||
| 62 | * @param string $value |
||
| 63 | */ |
||
| 64 | public function setIdFieldName($value) { |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Gets entity's DB ID field name (which is unique within entity set) |
||
| 70 | * |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | public function getIdFieldName() { |
||
| 76 | |||
| 77 | } |
||
| 78 |