@@ 914-919 (lines=6) @@ | ||
911 | } |
|
912 | $value = array($value); |
|
913 | } // field already exist and has single value |
|
914 | elseif (!is_array($oldValue)) { |
|
915 | $value = array_merge((array) $oldValue, array($value)); |
|
916 | if ($this->getId()) { |
|
917 | $this->operator->set($fieldName, $value); |
|
918 | } |
|
919 | } // field exists and is array |
|
920 | else { |
|
921 | if ($this->getId()) { |
|
922 | $setValue = $this->operator->get('$set', $fieldName); |
|
@@ 953-956 (lines=4) @@ | ||
950 | if ($this->getId()) { |
|
951 | if (!$oldValue) { |
|
952 | $this->operator->pushEach($fieldName, $values); |
|
953 | } elseif (!is_array($oldValue)) { |
|
954 | $values = array_merge((array) $oldValue, $values); |
|
955 | $this->operator->set($fieldName, $values); |
|
956 | } else { |
|
957 | $this->operator->pushEach($fieldName, $values); |
|
958 | $values = array_merge($oldValue, $values); |
|
959 | } |