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