| @@ 918-923 (lines=6) @@ | ||
| 915 | } |
|
| 916 | $value = array($value); |
|
| 917 | } // field already exist and has single value |
|
| 918 | elseif (!is_array($oldValue)) { |
|
| 919 | $value = array_merge((array) $oldValue, array($value)); |
|
| 920 | if ($this->getId()) { |
|
| 921 | $this->operator->set($fieldName, $value); |
|
| 922 | } |
|
| 923 | } // field exists and is array |
|
| 924 | else { |
|
| 925 | if ($this->getId()) { |
|
| 926 | $setValue = $this->operator->get('$set', $fieldName); |
|
| @@ 957-960 (lines=4) @@ | ||
| 954 | if ($this->getId()) { |
|
| 955 | if (!$oldValue) { |
|
| 956 | $this->operator->pushEach($fieldName, $values); |
|
| 957 | } elseif (!is_array($oldValue)) { |
|
| 958 | $values = array_merge((array) $oldValue, $values); |
|
| 959 | $this->operator->set($fieldName, $values); |
|
| 960 | } else { |
|
| 961 | $this->operator->pushEach($fieldName, $values); |
|
| 962 | $values = array_merge($oldValue, $values); |
|
| 963 | } |
|