| @@ 819-827 (lines=9) @@ | ||
| 816 | ||
| 817 | // build the insert array |
|
| 818 | $insertValues = []; |
|
| 819 | foreach ($this->_unsaved as $k => $value) { |
|
| 820 | // remove any non-existent properties |
|
| 821 | $property = static::getProperty($k); |
|
| 822 | if ($property === null) { |
|
| 823 | continue; |
|
| 824 | } |
|
| 825 | ||
| 826 | $insertValues[$k] = $value; |
|
| 827 | } |
|
| 828 | ||
| 829 | if (!self::getDriver()->createModel($this, $insertValues)) { |
|
| 830 | return false; |
|
| @@ 903-911 (lines=9) @@ | ||
| 900 | ||
| 901 | // build the update array |
|
| 902 | $updateValues = []; |
|
| 903 | foreach ($this->_unsaved as $k => $value) { |
|
| 904 | // remove any non-existent properties |
|
| 905 | $property = static::getProperty($k); |
|
| 906 | if ($property === null) { |
|
| 907 | continue; |
|
| 908 | } |
|
| 909 | ||
| 910 | $updateValues[$k] = $value; |
|
| 911 | } |
|
| 912 | ||
| 913 | if (!self::getDriver()->updateModel($this, $updateValues)) { |
|
| 914 | return false; |
|