Example #1
0
 /**
  * Filter the query by a related \Subcategories object
  *
  * @param \Subcategories|ObjectCollection $subcategories 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 filterBySubcategories($subcategories, $comparison = null)
 {
     if ($subcategories instanceof \Subcategories) {
         return $this->addUsingAlias(ItemsTableMap::COL_SUBCATEGORY_ID, $subcategories->getSubcategoryId(), $comparison);
     } elseif ($subcategories instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ItemsTableMap::COL_SUBCATEGORY_ID, $subcategories->toKeyValue('PrimaryKey', 'SubcategoryId'), $comparison);
     } else {
         throw new PropelException('filterBySubcategories() only accepts arguments of type \\Subcategories or Collection');
     }
 }
Example #2
0
 /**
  * Declares an association between this object and a ChildSubcategories object.
  *
  * @param  ChildSubcategories $v
  * @return $this|\Items The current object (for fluent API support)
  * @throws PropelException
  */
 public function setSubcategories(ChildSubcategories $v = null)
 {
     if ($v === null) {
         $this->setSubcategoryId(NULL);
     } else {
         $this->setSubcategoryId($v->getSubcategoryId());
     }
     $this->aSubcategories = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildSubcategories object, it will not be re-added.
     if ($v !== null) {
         $v->addItems($this);
     }
     return $this;
 }
 /**
  * Exclude object from result
  *
  * @param   ChildSubcategories $subcategories Object to remove from the list of results
  *
  * @return $this|ChildSubcategoriesQuery The current query, for fluid interface
  */
 public function prune($subcategories = null)
 {
     if ($subcategories) {
         $this->addUsingAlias(SubcategoriesTableMap::COL_SUBCATEGORY_ID, $subcategories->getSubcategoryId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }