Doctrine\Common\Collections\ArrayCollection::clear PHP Method

clear() public method

{@inheritDoc}
public clear ( )
    public function clear()
    {
        $this->elements = array();
    }

Usage Example

 public function clearCollections()
 {
     $this->hookedObjectCollections->forAll(function ($key, HookedObjectCollectionEntity $hookedObjectCollectionEntity) {
         $hookedObjectCollectionEntity->getCollection()->getHookedObjectCollections()->removeElement($hookedObjectCollectionEntity);
         $hookedObjectCollectionEntity->setCollection(null)->setHookedObject(null);
     });
     $this->hookedObjectCollections->clear();
 }
All Usage Examples Of Doctrine\Common\Collections\ArrayCollection::clear