public static function addNewItem($module, $name)
 {
     $class = new afWidgetCategory();
     $class->setModule($module);
     $class->setName($name);
     $class->save();
     return $class->getId();
 }
 /**
  * Declares an association between this object and a afWidgetCategory object.
  *
  * @param      afWidgetCategory $v
  * @return     afWidgetSelector The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setafWidgetCategory(afWidgetCategory $v = null)
 {
     if ($v === null) {
         $this->setCategoryId(NULL);
     } else {
         $this->setCategoryId($v->getId());
     }
     $this->aafWidgetCategory = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the afWidgetCategory object, it will not be re-added.
     if ($v !== null) {
         $v->addafWidgetSelector($this);
     }
     return $this;
 }
 /**
  * Exclude object from result
  *
  * @param     afWidgetCategory $afWidgetCategory Object to remove from the list of results
  *
  * @return    afWidgetCategoryQuery The current query, for fluid interface
  */
 public function prune($afWidgetCategory = null)
 {
     if ($afWidgetCategory) {
         $this->addUsingAlias(afWidgetCategoryPeer::ID, $afWidgetCategory->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Filter the query by a related afWidgetCategory object
  *
  * @param     afWidgetCategory|PropelCollection $afWidgetCategory The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    afWidgetSelectorQuery The current query, for fluid interface
  */
 public function filterByafWidgetCategory($afWidgetCategory, $comparison = null)
 {
     if ($afWidgetCategory instanceof afWidgetCategory) {
         return $this->addUsingAlias(afWidgetSelectorPeer::CATEGORY_ID, $afWidgetCategory->getId(), $comparison);
     } elseif ($afWidgetCategory instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(afWidgetSelectorPeer::CATEGORY_ID, $afWidgetCategory->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByafWidgetCategory() only accepts arguments of type afWidgetCategory or PropelCollection');
     }
 }