Exemplo n.º 1
0
 /**
  * Filter the query by a related \keeko\core\model\Session object
  *
  * @param \keeko\core\model\Session|ObjectCollection $session the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildUserQuery The current query, for fluid interface
  */
 public function filterBySession($session, $comparison = null)
 {
     if ($session instanceof \keeko\core\model\Session) {
         return $this->addUsingAlias(UserTableMap::COL_ID, $session->getUserId(), $comparison);
     } elseif ($session instanceof ObjectCollection) {
         return $this->useSessionQuery()->filterByPrimaryKeys($session->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySession() only accepts arguments of type \\keeko\\core\\model\\Session or Collection');
     }
 }
Exemplo n.º 2
0
 /**
  * Internal mechanism to set the User id
  * 
  * @param Session $model
  * @param mixed $relatedId
  */
 protected function doSetUserId(Session $model, $relatedId)
 {
     if ($model->getUserId() !== $relatedId) {
         $model->setUserId($relatedId);
         return true;
     }
     return false;
 }