Ubiquity  2.0.3
php rapid development framework
CRUDDatas.php
Go to the documentation of this file.
1 <?php
5 
11 class CRUDDatas {
12 
16  public function getTableNames(){
17  return DAO::$db->getTablesName();
18  }
19 
24  public function getFieldNames($model){
25  return OrmUtils::getSerializableFields($model);
26  }
27 
32  public function getFormFieldNames($model){
33  return OrmUtils::getSerializableFields($model);
34  }
35 
40  public function getSearchFieldNames($model){
41  return OrmUtils::getSerializableFields($model);
42  }
43 
48  public function getElementFieldNames($model){
49  return OrmUtils::getMembers($model);
50  }
51 
59  public function getManyToManyDatas($fkClass,$instance,$member){
60  return DAO::getAll($fkClass);
61  }
62 
66  public function getUpdateOneToManyInForm() {
67  return false;
68  }
69 
73  public function getUpdateManyToManyInForm() {
74  return true;
75  }
76 
80  public function getUpdateManyToOneInForm() {
81  return true;
82  }
83 
88  public function refreshPartialInstance(){
89  return true;
90  }
91 }
static getMembers($className)
Definition: OrmUtils.php:79
getSearchFieldNames($model)
Returns the fields to use in search queries.
Definition: CRUDDatas.php:40
The base class for displaying datas in CRUD controllers.
Definition: CRUDDatas.php:11
getTableNames()
Returns the table names to display in the left admin menu.
Definition: CRUDDatas.php:16
getManyToManyDatas($fkClass, $instance, $member)
Returns a list of $fkClass objects to select a value for $member.
Definition: CRUDDatas.php:59
static $db
Definition: DAO.php:22
static getAll($className, $condition='', $loadManyToOne=true, $loadOneToMany=false, $useCache=NULL)
Returns an array of $className objects from the database.
Definition: DAO.php:193
refreshPartialInstance()
Defines whether the refresh is partial or complete after an instance update.
Definition: CRUDDatas.php:88
getFieldNames($model)
Returns the fields to display in the showModel action for $model (DataTable)
Definition: CRUDDatas.php:24
getElementFieldNames($model)
Returns the fields for displaying an instance of $model (DataElement)
Definition: CRUDDatas.php:48
static getSerializableFields($class)
Definition: OrmUtils.php:217
getFormFieldNames($model)
Returns the fields to update in the edit an new action for $model.
Definition: CRUDDatas.php:32