@@ 903-908 (lines=6) @@ | ||
900 | } |
|
901 | $value = array($value); |
|
902 | } // field already exist and has single value |
|
903 | elseif (!is_array($oldValue)) { |
|
904 | $value = array_merge((array) $oldValue, array($value)); |
|
905 | if ($this->getId()) { |
|
906 | $this->operator->set($fieldName, $value); |
|
907 | } |
|
908 | } // field exists and is array |
|
909 | else { |
|
910 | if ($this->getId()) { |
|
911 | // check if array because previous $set operation on single value was executed |
|
@@ 943-946 (lines=4) @@ | ||
940 | if ($this->getId()) { |
|
941 | if (!$oldValue) { |
|
942 | $this->operator->pushEach($fieldName, $values); |
|
943 | } elseif (!is_array($oldValue)) { |
|
944 | $values = array_merge((array) $oldValue, $values); |
|
945 | $this->operator->set($fieldName, $values); |
|
946 | } else { |
|
947 | $this->operator->pushEach($fieldName, $values); |
|
948 | $values = array_merge($oldValue, $values); |
|
949 | } |