Пример #1
0
 /**
  * Filter the query by a related \Alchemy\Component\Cerberus\Model\RolePermission object
  *
  * @param \Alchemy\Component\Cerberus\Model\RolePermission|ObjectCollection $rolePermission  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildRoleQuery The current query, for fluid interface
  */
 public function filterByRolePermission($rolePermission, $comparison = null)
 {
     if ($rolePermission instanceof \Alchemy\Component\Cerberus\Model\RolePermission) {
         return $this->addUsingAlias(RoleTableMap::COL_ID, $rolePermission->getRoleId(), $comparison);
     } elseif ($rolePermission instanceof ObjectCollection) {
         return $this->useRolePermissionQuery()->filterByPrimaryKeys($rolePermission->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByRolePermission() only accepts arguments of type \\Alchemy\\Component\\Cerberus\\Model\\RolePermission or Collection');
     }
 }