コード例 #1
0
ファイル: abstract.php プロジェクト: nooku/nooku-framework
 /**
  * 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
ファイル: composite.php プロジェクト: nooku/nooku-framework
 /**
  * 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);
 }