/** * Filter the query by a related \ORM\RolePermission object * * @param \ORM\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 filterByPermission($rolePermission, $comparison = null) { if ($rolePermission instanceof \ORM\RolePermission) { return $this->addUsingAlias(RoleTableMap::COL_ID, $rolePermission->getId(), $comparison); } elseif ($rolePermission instanceof ObjectCollection) { return $this->usePermissionQuery()->filterByPrimaryKeys($rolePermission->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByPermission() only accepts arguments of type \\ORM\\RolePermission or Collection'); } }