private function addToSetCollections(object $parent, array $collsPaths, array $pathCollsMap, array $diffsMap, array $options) : void
    {
        $addToSetPaths = $this->excludeSubPaths($collsPaths);
        /** @var PersistentCollectionInterface[] $addToSetColls */
        $addToSetColls = array_intersect_key($pathCollsMap, array_flip($addToSetPaths));

        $addToSetPayload = [];
        foreach ($addToSetColls as $propertyPath => $coll) {
            $callback                       = $this->getValuePrepareCallback($coll);
            $value                          = array_values(array_map($callback, $diffsMap[$propertyPath]));
            $addToSetPayload[$propertyPath] = ['$each' => $value];
        }

        if (empty($addToSetPayload)) {
            return;
        }

        $this->executeQuery($parent, ['$addToSet' => $addToSetPayload], $options);
    }
private function addToSetCollections(object $parent, array $collsPaths, array $pathCollsMap, array $diffsMap, array $options) : void
    {
        $addToSetPaths = $this->excludeSubPaths($collsPaths);
        /** @var PersistentCollectionInterface[] $addToSetColls */
        $addToSetColls = array_intersect_key($pathCollsMap, array_flip($addToSetPaths));

        $addToSetPayload = [];
        foreach ($addToSetColls as $propertyPath => $coll) {
            $callback                       = $this->getValuePrepareCallback($coll);
            $value                          = array_values(array_map($callback, $diffsMap[$propertyPath]));
            $addToSetPayload[$propertyPath] = ['$each' => $value];
        }

        if (empty($addToSetPayload)) {
            return;
        }

        $this->executeQuery($parent, ['$addToSet' => $addToSetPayload], $options);
    }
private function addToSetCollections ( object $ parent , array $ collsPaths , array $ pathCollsMap , array $ diffsMap , array $ options ) : void { $ addToSetPaths = $ this -> excludeSubPaths ( $ collsPaths ) ; /** @var PersistentCollectionInterface[] $addToSetColls */ $ addToSetColls = array_intersect_key ( $ pathCollsMap , array_flip ( $ addToSetPaths ) ) ; $ addToSetPayload = [ ] ; foreach ( $ addToSetColls as $ propertyPath => $ coll ) { $ callback = $ this -> getValuePrepareCallback ( $ coll ) ; $ value = array_values ( array_map ( $ callback , $ diffsMap [ $ propertyPath ] ) ) ; $ addToSetPayload [ $ propertyPath ] = [ '$each' => $ value ] ; } if ( empty ( $ addToSetPayload ) ) { return ; } $ this -> executeQuery ( $ parent , [ '$addToSet' => $ addToSetPayload ] , $ options ) ; }
Perform collections update by 'addToSet' strategy.

@param object $parent       Parent object to which passed collections is belong.
@param array  $collsPaths   Paths of collections that is passed.
@param array  $pathCollsMap List of collections indexed by their paths.
@param array  $diffsMap     List of collection diffs indexed by collections paths.
@param array  $options
Perform collections update by addToSet strategy .