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