示例#1
0
 /**
  * Checks if the collection contains a specific row
  *
  * @param  DatabaseRowInterface $row
  * @throws \InvalidArgumentException if the object doesn't implement DatabaseRowInterface
  * @return  bool Returns TRUE if the object is in the set, FALSE otherwise
  */
 public function contains($row)
 {
     if (!$row instanceof DatabaseRowInterface) {
         throw new \InvalidArgumentException('Entity needs to implement ModelEntityInterface');
     }
     return $this->__rowset->contains($row);
 }
示例#2
0
 /**
  * Checks if the collection contains a specific entity
  *
  * @param   ModelEntityInterface $entity
  * @throws \InvalidArgumentException if the object doesn't implement ModelEntityInterface
  * @return  bool Returns TRUE if the object is in the set, FALSE otherwise
  */
 public function contains($entity)
 {
     if (!$entity instanceof ModelEntityInterface) {
         throw new \InvalidArgumentException('Entity needs to implement ModelEntityInterface');
     }
     return $this->__entities->contains($entity);
 }