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