| 1 | <?php |
||
| 11 | class UbiquityMyAdminData { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Returns the table names to display in the left admin menu |
||
| 15 | */ |
||
| 16 | public function getTableNames(){ |
||
| 17 | return DAO::$db->getTablesName(); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Returns the fields to display in the showTable action for $model |
||
| 22 | * @param string $model |
||
| 23 | */ |
||
| 24 | public function getFieldNames($model){ |
||
| 25 | return OrmUtils::getSerializableFields($model); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Returns the fields to update in the edit an new action for $model |
||
| 30 | * @param string $model |
||
| 31 | */ |
||
| 32 | public function getFormFieldNames($model){ |
||
| 33 | return OrmUtils::getSerializableFields($model); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Returns a list of $fkClass objects to select a value for $member |
||
| 38 | * @param string $fkClass |
||
| 39 | * @param object $instance |
||
| 40 | * @param string $member |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function getManyToManyDatas($fkClass,$instance,$member){ |
||
| 44 | return DAO::getAll($fkClass); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return boolean |
||
| 49 | */ |
||
| 50 | public function getUpdateOneToManyInForm() { |
||
| 51 | return false; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return boolean |
||
| 56 | */ |
||
| 57 | public function getUpdateManyToManyInForm() { |
||
| 58 | return true; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return boolean |
||
| 63 | */ |
||
| 64 | public function getUpdateManyToOneInForm() { |
||
| 65 | return true; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |