@@ 928-936 (lines=9) @@ | ||
925 | } |
|
926 | } // field exists and is array |
|
927 | else { |
|
928 | if ($this->getId()) { |
|
929 | $setValue = $this->operator->get('$set', $fieldName); |
|
930 | if ($setValue) { |
|
931 | $setValue[] = $value; |
|
932 | $this->operator->set($fieldName, $setValue); |
|
933 | } else { |
|
934 | $this->operator->push($fieldName, $value); |
|
935 | } |
|
936 | } |
|
937 | $value = array_merge($oldValue, array($value)); |
|
938 | } |
|
939 | ||
@@ 1013-1020 (lines=8) @@ | ||
1010 | return $this; |
|
1011 | } |
|
1012 | $updatedSet = array_merge($set, array($value)); |
|
1013 | if ($this->getId()) { |
|
1014 | $setValue = $this->operator->get('$set', $fieldName); |
|
1015 | if ($setValue) { |
|
1016 | $this->operator->set($fieldName, $updatedSet); |
|
1017 | } else { |
|
1018 | $this->operator->addToSet($fieldName, $value); |
|
1019 | } |
|
1020 | } |
|
1021 | } |
|
1022 | ||
1023 | parent::set($fieldName, $updatedSet); |