|
12 | 12 | * This class is part of Ubiquity
|
13 | 13 | *
|
14 | 14 | * @author jcheron <[email protected]>
|
15 |
| - * @version 1.0.5 |
| 15 | + * @version 1.0.6 |
16 | 16 | * @category ubiquity.dev
|
17 | 17 | *
|
18 | 18 | */
|
@@ -52,8 +52,10 @@ class ModelParser {
|
52 | 52 |
|
53 | 53 | protected function initSwapClasses($className) {
|
54 | 54 | if (\class_exists('\\Ubiquity\\security\\acl\\AclManager', true)) {
|
55 |
| - $swapClasses = \Ubiquity\security\acl\AclManager::getModelClassesSwap(); |
56 |
| - $this->swapClasses += $swapClasses[$className] ?? []; |
| 55 | + if (\Ubiquity\security\acl\AclManager::isStarted()) { |
| 56 | + $swapClasses = \Ubiquity\security\acl\AclManager::getModelClassesSwap(); |
| 57 | + $this->swapClasses += $swapClasses[$className] ?? []; |
| 58 | + } |
57 | 59 | }
|
58 | 60 | }
|
59 | 61 |
|
@@ -106,22 +108,22 @@ public function parse($modelClass) {
|
106 | 108 | $this->fieldNames[$propName] = $fieldName;
|
107 | 109 | $this->memberNames[$fieldName] = $propName;
|
108 | 110 | $nullable = Reflexion::isNullable($modelClass, $propName);
|
109 |
| - |
| 111 | + |
110 | 112 | $serializable = Reflexion::isSerializable($modelClass, $propName);
|
111 | 113 |
|
112 |
| - if (! $serializable){ |
| 114 | + if (! $serializable) { |
113 | 115 | $this->notSerializableMembers[] = $propName;
|
114 | 116 | }
|
115 | 117 | $type = Reflexion::getDbType($modelClass, $propName);
|
116 | 118 | if ($type == null) {
|
117 | 119 | $type = 'mixed';
|
118 | 120 | }
|
119 |
| - |
120 |
| - if(\array_search($fieldName, $primaryKeys)!==false && DbTypes::isInt($type)){ |
121 |
| - $nullable=true; |
| 121 | + |
| 122 | + if (\array_search($fieldName, $primaryKeys) !== false && DbTypes::isInt($type)) { |
| 123 | + $nullable = true; |
122 | 124 | }
|
123 |
| - |
124 |
| - if ($nullable){ |
| 125 | + |
| 126 | + if ($nullable) { |
125 | 127 | $this->nullableMembers[] = $propName;
|
126 | 128 | }
|
127 | 129 | $this->fieldTypes[$propName] = $type;
|
|
0 commit comments