Example #1
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aCategories) {
         $this->aCategories->removeSubcategories($this);
     }
     $this->subcategory_id = null;
     $this->category_id = null;
     $this->subcategory_name = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
 /**
  * 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;
 }
Example #3
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aCategories) {
         $this->aCategories->removeItems($this);
     }
     if (null !== $this->aSubcategories) {
         $this->aSubcategories->removeItems($this);
     }
     if (null !== $this->aUser) {
         $this->aUser->removeItems($this);
     }
     $this->item_id = null;
     $this->category_id = null;
     $this->user_id = null;
     $this->item_name = null;
     $this->price = null;
     $this->description = null;
     $this->date_added = null;
     $this->date_sold = null;
     $this->subcategory_id = null;
     $this->image_url = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Example #4
0
 /**
  * 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');
     }
 }