lib/Doctrine/ORM/LazyCriteriaCollection.php
public function contains($element)
    {
        if ($this->isInitialized()) {
            return $this->collection->contains($element);
        }

        return $this->entityPersister->exists($element, $this->criteria);
    }
public function contains($element)
    {
        if ($this->isInitialized()) {
            return $this->collection->contains($element);
        }

        return $this->entityPersister->exists($element, $this->criteria);
    }
public function contains ( $ element ) { if ( $ this -> isInitialized ( ) ) { return $ this -> collection -> contains ( $ element ) ; } return $ this -> entityPersister -> exists ( $ element , $ this -> criteria ) ; }
Do an optimized search of an element

@param object $element

@return bool
Do an optimized search of an element