/** * Filter the query by a related \App\Propel\Role object * * @param \App\Propel\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 ChildRoleI18nQuery The current query, for fluid interface */ public function filterByRole($role, $comparison = null) { if ($role instanceof \App\Propel\Role) { return $this->addUsingAlias(RoleI18nTableMap::COL_ROLE_ID, $role->getRoleId(), $comparison); } elseif ($role instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(RoleI18nTableMap::COL_ROLE_ID, $role->toKeyValue('PrimaryKey', 'RoleId'), $comparison); } else { throw new PropelException('filterByRole() only accepts arguments of type \\App\\Propel\\Role or Collection'); } }
/** * Declares an association between this object and a ChildRole object. * * @param ChildRole $v * @return $this|\App\Propel\User The current object (for fluent API support) * @throws PropelException */ public function setRole(ChildRole $v = null) { if ($v === null) { $this->setRoleId(NULL); } else { $this->setRoleId($v->getRoleId()); } $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->addUser($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_ROLE_ID, $role->getRoleId(), Criteria::NOT_EQUAL); } return $this; }