/** * 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'); } }
/** * Clears the current object, sets all attributes to their default values and removes * outgoing references as well as back-references (from other objects to this one. Results probably in a database * change of those foreign objects when you call `save` there). */ public function clear() { if (null !== $this->auser) { $this->auser->removeAssignedRoleGlobalRelatedByUserId($this); } if (null !== $this->aassignedBy) { $this->aassignedBy->removeAssignedRoleGlobalRelatedByAssignedBy($this); } if (null !== $this->arole) { $this->arole->removeAssignedRoleGlobal($this); } $this->id = null; $this->user_id = null; $this->role_id = null; $this->assigned_by = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }
/** * 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; }