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