/** * Exclude object from result * * @param ChildCategories $categories Object to remove from the list of results * * @return $this|ChildCategoriesQuery The current query, for fluid interface */ public function prune($categories = null) { if ($categories) { $this->addUsingAlias(CategoriesTableMap::COL_CATEGORY_ID, $categories->getCategoryId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildCategories object. * * @param ChildCategories $v * @return $this|\Subcategories The current object (for fluent API support) * @throws PropelException */ public function setCategories(ChildCategories $v = null) { if ($v === null) { $this->setCategoryId(NULL); } else { $this->setCategoryId($v->getCategoryId()); } $this->aCategories = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildCategories object, it will not be re-added. if ($v !== null) { $v->addSubcategories($this); } return $this; }
/** * Filter the query by a related \Categories object * * @param \Categories|ObjectCollection $categories The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildItemsQuery The current query, for fluid interface */ public function filterByCategories($categories, $comparison = null) { if ($categories instanceof \Categories) { return $this->addUsingAlias(ItemsTableMap::COL_CATEGORY_ID, $categories->getCategoryId(), $comparison); } elseif ($categories instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ItemsTableMap::COL_CATEGORY_ID, $categories->toKeyValue('PrimaryKey', 'CategoryId'), $comparison); } else { throw new PropelException('filterByCategories() only accepts arguments of type \\Categories or Collection'); } }