public function onPostHandleRequestWithCollection(Collection $oldCollection, Collection $newCollection) {
        $deleted = 0;
        foreach ($oldCollection as $current) {
            if (true === $newCollection->contains($current)) {
                continue;
            }
            $this->getObjectManager()->remove($current);
            ++$deleted;
        }
        return $deleted;
    }
public function onPostHandleRequestWithCollection(Collection $oldCollection, Collection $newCollection) {
        $deleted = 0;
        foreach ($oldCollection as $current) {
            if (true === $newCollection->contains($current)) {
                continue;
            }
            $this->getObjectManager()->remove($current);
            ++$deleted;
        }
        return $deleted;
    }
public function onPostHandleRequestWithCollection ( Collection $ oldCollection , Collection $ newCollection ) { $ deleted = 0 ; foreach ( $ oldCollection as $ current ) { if ( true === $ newCollection -> contains ( $ current ) ) { continue ; } $ this -> getObjectManager ( ) -> remove ( $ current ) ; ++ $ deleted ; } return $ deleted ; }
On post handle request with collection.

@param Collection $oldCollection The old collection.
@param Collection $newCollection The new collection.
@return int Returns the deleted count.
On post handle request with collection .