/** * Filter the query by a related \SpoilerWiki\Role object * * @param \SpoilerWiki\Role|ObjectCollection $role The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildAssignedRoleGlobalQuery The current query, for fluid interface */ public function filterByrole($role, $comparison = null) { if ($role instanceof \SpoilerWiki\Role) { return $this->addUsingAlias(AssignedRoleGlobalTableMap::COL_USER_ID, $role->getId(), $comparison); } elseif ($role instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(AssignedRoleGlobalTableMap::COL_USER_ID, $role->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByrole() only accepts arguments of type \\SpoilerWiki\\Role or Collection'); } }
/** * Declares an association between this object and a ChildRole object. * * @param ChildRole $v * @return $this|\SpoilerWiki\AssignedRoleGlobal The current object (for fluent API support) * @throws PropelException */ public function setrole(ChildRole $v = null) { if ($v === null) { $this->setUserId(NULL); } else { $this->setUserId($v->getId()); } $this->arole = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildRole object, it will not be re-added. if ($v !== null) { $v->addAssignedRoleGlobal($this); } return $this; }
/** * Exclude object from result * * @param ChildRole $role Object to remove from the list of results * * @return $this|ChildRoleQuery The current query, for fluid interface */ public function prune($role = null) { if ($role) { $this->addUsingAlias(RoleTableMap::COL_ID, $role->getId(), Criteria::NOT_EQUAL); } return $this; }