@@ 940-945 (lines=6) @@ | ||
937 | } |
|
938 | $value = array($value); |
|
939 | } // field already exist and has single value |
|
940 | elseif (!is_array($oldValue)) { |
|
941 | $value = array_merge((array) $oldValue, array($value)); |
|
942 | if ($this->getId()) { |
|
943 | $this->operator->set($fieldName, $value); |
|
944 | } |
|
945 | } // field exists and is array |
|
946 | else { |
|
947 | if ($this->getId()) { |
|
948 | // check if array because previous $set operation on single value was executed |
|
@@ 980-983 (lines=4) @@ | ||
977 | if ($this->getId()) { |
|
978 | if (!$oldValue) { |
|
979 | $this->operator->pushEach($fieldName, $values); |
|
980 | } elseif (!is_array($oldValue)) { |
|
981 | $values = array_merge((array) $oldValue, $values); |
|
982 | $this->operator->set($fieldName, $values); |
|
983 | } else { |
|
984 | $this->operator->pushEach($fieldName, $values); |
|
985 | $values = array_merge($oldValue, $values); |
|
986 | } |