Skip to content

Commit f9e69df

Browse files
committed
Update ModelParser.php
1 parent 2b2874f commit f9e69df

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/Ubiquity/orm/parser/ModelParser.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* This class is part of Ubiquity
1313
*
1414
* @author jcheron <[email protected]>
15-
* @version 1.0.5
15+
* @version 1.0.6
1616
* @category ubiquity.dev
1717
*
1818
*/
@@ -52,8 +52,10 @@ class ModelParser {
5252

5353
protected function initSwapClasses($className) {
5454
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+
}
5759
}
5860
}
5961

@@ -106,22 +108,22 @@ public function parse($modelClass) {
106108
$this->fieldNames[$propName] = $fieldName;
107109
$this->memberNames[$fieldName] = $propName;
108110
$nullable = Reflexion::isNullable($modelClass, $propName);
109-
111+
110112
$serializable = Reflexion::isSerializable($modelClass, $propName);
111113

112-
if (! $serializable){
114+
if (! $serializable) {
113115
$this->notSerializableMembers[] = $propName;
114116
}
115117
$type = Reflexion::getDbType($modelClass, $propName);
116118
if ($type == null) {
117119
$type = 'mixed';
118120
}
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;
122124
}
123-
124-
if ($nullable){
125+
126+
if ($nullable) {
125127
$this->nullableMembers[] = $propName;
126128
}
127129
$this->fieldTypes[$propName] = $type;

0 commit comments

Comments
 (0)