public function pull(CompositableInterface $entity): DocumentCompositor
    {
        //Passing true to get all entity offsets
        $targets = $this->find($entity, true);

        foreach ($targets as $offset => $target) {
            unset($this->entities[$offset]);
        }

        $this->atomics['$pull'][] = clone $entity;

        return $this;
    }
public function pull(CompositableInterface $entity): DocumentCompositor
    {
        //Passing true to get all entity offsets
        $targets = $this->find($entity, true);

        foreach ($targets as $offset => $target) {
            unset($this->entities[$offset]);
        }

        $this->atomics['$pull'][] = clone $entity;

        return $this;
    }
public function pull ( CompositableInterface $ entity ) : DocumentCompositor { //Passing true to get all entity offsets $ targets = $ this -> find ( $ entity , true ) ; foreach ( $ targets as $ offset => $ target ) { unset ( $ this -> entities [ $ offset ] ) ; } $ this -> atomics [ '$pull' ] [ ] = clone $ entity ; return $ this ; }
Pull mathced entities from composition.

$user->addresses->pull($address);

@param CompositableInterface $entity

@return DocumentCompositor
Pull mathced entities from composition .