private function pushAllCollections(object $parent, array $collsPaths, array $pathCollsMap, array $diffsMap, array $options) : void
    {
        $pushAllPaths = $this->excludeSubPaths($collsPaths);
        /** @var PersistentCollectionInterface[] $pushAllColls */
        $pushAllColls   = array_intersect_key($pathCollsMap, array_flip($pushAllPaths));
        $pushAllPayload = [];
        foreach ($pushAllColls as $propertyPath => $coll) {
            $callback                      = $this->getValuePrepareCallback($coll);
            $value                         = array_values(array_map($callback, $diffsMap[$propertyPath]));
            $pushAllPayload[$propertyPath] = ['$each' => $value];
        }

        if (! empty($pushAllPayload)) {
            $this->executeQuery($parent, ['$push' => $pushAllPayload], $options);
        }

        $pushAllColls = array_diff_key($pathCollsMap, array_flip($pushAllPaths));
        foreach ($pushAllColls as $propertyPath => $coll) {
            $callback = $this->getValuePrepareCallback($coll);
            $value    = array_values(array_map($callback, $diffsMap[$propertyPath]));
            $query    = ['$push' => [$propertyPath => ['$each' => $value]]];
            $this->executeQuery($parent, $query, $options);
        }
    }
private function pushAllCollections(object $parent, array $collsPaths, array $pathCollsMap, array $diffsMap, array $options) : void
    {
        $pushAllPaths = $this->excludeSubPaths($collsPaths);
        /** @var PersistentCollectionInterface[] $pushAllColls */
        $pushAllColls   = array_intersect_key($pathCollsMap, array_flip($pushAllPaths));
        $pushAllPayload = [];
        foreach ($pushAllColls as $propertyPath => $coll) {
            $callback                      = $this->getValuePrepareCallback($coll);
            $value                         = array_values(array_map($callback, $diffsMap[$propertyPath]));
            $pushAllPayload[$propertyPath] = ['$each' => $value];
        }

        if (! empty($pushAllPayload)) {
            $this->executeQuery($parent, ['$push' => $pushAllPayload], $options);
        }

        $pushAllColls = array_diff_key($pathCollsMap, array_flip($pushAllPaths));
        foreach ($pushAllColls as $propertyPath => $coll) {
            $callback = $this->getValuePrepareCallback($coll);
            $value    = array_values(array_map($callback, $diffsMap[$propertyPath]));
            $query    = ['$push' => [$propertyPath => ['$each' => $value]]];
            $this->executeQuery($parent, $query, $options);
        }
    }
private function pushAllCollections ( object $ parent , array $ collsPaths , array $ pathCollsMap , array $ diffsMap , array $ options ) : void { $ pushAllPaths = $ this -> excludeSubPaths ( $ collsPaths ) ; /** @var PersistentCollectionInterface[] $pushAllColls */ $ pushAllColls = array_intersect_key ( $ pathCollsMap , array_flip ( $ pushAllPaths ) ) ; $ pushAllPayload = [ ] ; foreach ( $ pushAllColls as $ propertyPath => $ coll ) { $ callback = $ this -> getValuePrepareCallback ( $ coll ) ; $ value = array_values ( array_map ( $ callback , $ diffsMap [ $ propertyPath ] ) ) ; $ pushAllPayload [ $ propertyPath ] = [ '$each' => $ value ] ; } if ( ! empty ( $ pushAllPayload ) ) { $ this -> executeQuery ( $ parent , [ '$push' => $ pushAllPayload ] , $ options ) ; } $ pushAllColls = array_diff_key ( $ pathCollsMap , array_flip ( $ pushAllPaths ) ) ; foreach ( $ pushAllColls as $ propertyPath => $ coll ) { $ callback = $ this -> getValuePrepareCallback ( $ coll ) ; $ value = array_values ( array_map ( $ callback , $ diffsMap [ $ propertyPath ] ) ) ; $ query = [ '$push' => [ $ propertyPath => [ '$each' => $ value ] ] ] ; $ this -> executeQuery ( $ parent , $ query , $ options ) ; } }
Perform collections update for 'pushAll' 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 for pushAll strategy .