Allow usage of bool types on the ORM.
This commit is contained in:
parent
8d47e10d7a
commit
08d92a2b81
@ -236,20 +236,20 @@ class Model {
|
||||
$properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC);
|
||||
$result = [];
|
||||
|
||||
foreach($properties as $property) {
|
||||
$att = $property->name;
|
||||
$result[$att] = isset($this->$att)
|
||||
? $this->$att : null;
|
||||
}
|
||||
foreach($properties as $property)
|
||||
$result[$property->name] = isset($this->{$property->name})
|
||||
? $this->{$property->name} : null;
|
||||
|
||||
foreach (static::$ignoreSave as $del) {
|
||||
foreach (static::$ignoreSave as $del)
|
||||
unset($result[$del]);
|
||||
}
|
||||
|
||||
foreach (static::$forceSave as $value) {
|
||||
foreach (static::$forceSave as $value)
|
||||
$result[$value] = isset($this->$value)
|
||||
? $this->$value: null;
|
||||
}
|
||||
|
||||
foreach ($result as $i => $property)
|
||||
if (gettype($property) == 'boolean')
|
||||
$result[$i] = $property ? '1' : '0';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user