/** * Declares an association between this object and a ChildFeature object. * * @param ChildFeature $v * @return \CriteriaSearch\Model\CriteriaSearchCategoryFeature The current object (for fluent API support) * @throws PropelException */ public function setFeature(ChildFeature $v = null) { if ($v === null) { $this->setFeatureId(NULL); } else { $this->setFeatureId($v->getId()); } $this->aFeature = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildFeature object, it will not be re-added. if ($v !== null) { $v->addCriteriaSearchCategoryFeature($this); } return $this; }
/** * Filter the query by a related \CriteriaSearch\Model\Thelia\Model\Feature object * * @param \CriteriaSearch\Model\Thelia\Model\Feature|ObjectCollection $feature The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildCriteriaSearchCategoryFeatureQuery The current query, for fluid interface */ public function filterByFeature($feature, $comparison = null) { if ($feature instanceof \CriteriaSearch\Model\Thelia\Model\Feature) { return $this->addUsingAlias(CriteriaSearchCategoryFeatureTableMap::FEATURE_ID, $feature->getId(), $comparison); } elseif ($feature instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CriteriaSearchCategoryFeatureTableMap::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByFeature() only accepts arguments of type \\CriteriaSearch\\Model\\Thelia\\Model\\Feature or Collection'); } }