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