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