コード例 #1
0
 /**
  * Filter the query by a related \Account object
  *
  * @param \Account|ObjectCollection $account 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 ChildProfileQuery The current query, for fluid interface
  */
 public function filterByAccount($account, $comparison = null)
 {
     if ($account instanceof \Account) {
         return $this->addUsingAlias(ProfileTableMap::COL_ID, $account->getId(), $comparison);
     } elseif ($account instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ProfileTableMap::COL_ID, $account->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByAccount() only accepts arguments of type \\Account or Collection');
     }
 }
コード例 #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildAccount $account Object to remove from the list of results
  *
  * @return $this|ChildAccountQuery The current query, for fluid interface
  */
 public function prune($account = null)
 {
     if ($account) {
         $this->addUsingAlias(AccountTableMap::COL_ID, $account->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
コード例 #3
0
 /**
  * Declares an association between this object and a ChildAccount object.
  *
  * @param  ChildAccount $v
  * @return $this|\Profile The current object (for fluent API support)
  * @throws PropelException
  */
 public function setAccount(ChildAccount $v = null)
 {
     if ($v === null) {
         $this->setId(NULL);
     } else {
         $this->setId($v->getId());
     }
     $this->aAccount = $v;
     // Add binding for other direction of this 1:1 relationship.
     if ($v !== null) {
         $v->setProfile($this);
     }
     return $this;
 }