@@ -25,16 +25,17 @@ public function __construct($controller) {
2525 /**
2626 * Returns the table names to display in the left admin menu
2727 */
28- public function getTableNames () {
28+ public function getTableNames (): array {
2929 return DAO ::$ db ->getTablesName ();
3030 }
3131
3232 /**
3333 * Returns the fields to display in the showModel action for $model (DataTable)
3434 *
3535 * @param string $model
36+ * @return array
3637 */
37- public function getFieldNames ($ model ) {
38+ public function getFieldNames (string $ model ): array {
3839 return OrmUtils::getSerializableMembers ( $ model );
3940 }
4041
@@ -43,26 +44,29 @@ public function getFieldNames($model) {
4344 *
4445 * @param string $model
4546 * @param object $instance
47+ * @return array
4648 */
47- public function getFormFieldNames ($ model , $ instance ) {
49+ public function getFormFieldNames (string $ model , $ instance ): array {
4850 return OrmUtils::getFormAllFields ( $ model );
4951 }
5052
5153 /**
5254 * Returns the fields to use in search queries
5355 *
5456 * @param string $model
57+ * @return array
5558 */
56- public function getSearchFieldNames ($ model ) {
59+ public function getSearchFieldNames (string $ model ): array {
5760 return OrmUtils::getSerializableFields ( $ model );
5861 }
5962
6063 /**
6164 * Returns the fields for displaying an instance of $model (DataElement)
6265 *
6366 * @param string $model
67+ * @return array
6468 */
65- public function getElementFieldNames ($ model ) {
69+ public function getElementFieldNames (string $ model ): array {
6670 return OrmUtils::getMembers ( $ model );
6771 }
6872
@@ -74,7 +78,7 @@ public function getElementFieldNames($model) {
7478 * @param string $member The member associated with a manyToMany relation
7579 * @return array
7680 */
77- public function getManyToManyDatas ($ fkClass , $ instance , $ member ) {
81+ public function getManyToManyDatas ($ fkClass , $ instance , $ member ): array {
7882 return DAO ::getAll ( $ fkClass , "" , false );
7983 }
8084
@@ -86,7 +90,7 @@ public function getManyToManyDatas($fkClass, $instance, $member) {
8690 * @param string $member The member associated with a manyToOne relation
8791 * @return array
8892 */
89- public function getManyToOneDatas ($ fkClass , $ instance , $ member ) {
93+ public function getManyToOneDatas ($ fkClass , $ instance , $ member ): array {
9094 return DAO ::getAll ( $ fkClass , "" , false );
9195 }
9296
@@ -98,31 +102,31 @@ public function getManyToOneDatas($fkClass, $instance, $member) {
98102 * @param string $member The member associated with a oneToMany relation
99103 * @return array
100104 */
101- public function getOneToManyDatas ($ fkClass , $ instance , $ member ) {
105+ public function getOneToManyDatas ($ fkClass , $ instance , $ member ): array {
102106 return DAO ::getAll ( $ fkClass , "" , false );
103107 }
104108
105109 /**
106110 *
107111 * @return boolean
108112 */
109- public function getUpdateOneToManyInForm () {
113+ public function getUpdateOneToManyInForm (): bool {
110114 return false ;
111115 }
112116
113117 /**
114118 *
115119 * @return boolean
116120 */
117- public function getUpdateManyToManyInForm () {
121+ public function getUpdateManyToManyInForm (): bool {
118122 return true ;
119123 }
120124
121125 /**
122126 *
123127 * @return boolean
124128 */
125- public function getUpdateManyToOneInForm () {
129+ public function getUpdateManyToOneInForm (): bool {
126130 return true ;
127131 }
128132
@@ -131,7 +135,7 @@ public function getUpdateManyToOneInForm() {
131135 *
132136 * @return boolean
133137 */
134- public function refreshPartialInstance () {
138+ public function refreshPartialInstance (): bool {
135139 return true ;
136140 }
137141
@@ -142,7 +146,7 @@ public function refreshPartialInstance() {
142146 * @param string $model
143147 * @return string
144148 */
145- public function _getInstancesFilter ($ model ) {
149+ public function _getInstancesFilter (string $ model ): string {
146150 return "1=1 " ;
147151 }
148152}
0 commit comments