Пример #1
0
 /**
  * Exclude object from result
  *
  * @param   ChildPermission $permission Object to remove from the list of results
  *
  * @return $this|ChildPermissionQuery The current query, for fluid interface
  */
 public function prune($permission = null)
 {
     if ($permission) {
         $this->addUsingAlias(PermissionTableMap::COL_ID, $permission->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Пример #2
0
 /**
  * Declares an association between this object and a ChildPermission object.
  *
  * @param  ChildPermission $v
  * @return $this|\Alchemy\Component\Cerberus\Model\Permission The current object (for fluent API support)
  * @throws PropelException
  */
 public function setPermissionRelatedByParentId(ChildPermission $v = null)
 {
     if ($v === null) {
         $this->setParentId(NULL);
     } else {
         $this->setParentId($v->getId());
     }
     $this->aPermissionRelatedByParentId = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildPermission object, it will not be re-added.
     if ($v !== null) {
         $v->addPermissionRelatedById($this);
     }
     return $this;
 }
Пример #3
0
 /**
  * Filter the query by a related \Alchemy\Component\Cerberus\Model\Permission object
  *
  * @param \Alchemy\Component\Cerberus\Model\Permission|ObjectCollection $permission The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildRolePermissionQuery The current query, for fluid interface
  */
 public function filterByPermission($permission, $comparison = null)
 {
     if ($permission instanceof \Alchemy\Component\Cerberus\Model\Permission) {
         return $this->addUsingAlias(RolePermissionTableMap::COL_PERMISSION_ID, $permission->getId(), $comparison);
     } elseif ($permission instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(RolePermissionTableMap::COL_PERMISSION_ID, $permission->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByPermission() only accepts arguments of type \\Alchemy\\Component\\Cerberus\\Model\\Permission or Collection');
     }
 }