Esempio n. 1
0
 /**
  * Filter the query by a related \Thelia\Model\Profile object
  *
  * @param \Thelia\Model\Profile|ObjectCollection $profile The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildProfileModuleQuery The current query, for fluid interface
  */
 public function filterByProfile($profile, $comparison = null)
 {
     if ($profile instanceof \Thelia\Model\Profile) {
         return $this->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profile->getId(), $comparison);
     } elseif ($profile instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profile->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByProfile() only accepts arguments of type \\Thelia\\Model\\Profile or Collection');
     }
 }