/**
  * Gets the number of DgmEffects objects related by a many-to-many relationship
  * to the current object by way of the dgmtypeeffects cross-reference table.
  *
  * @param      Criteria $criteria Optional query object to filter the query
  * @param      boolean $distinct Set to true to force count distinct
  * @param      ConnectionInterface $con Optional connection object
  *
  * @return int the number of related DgmEffects objects
  */
 public function countDgmEffectss(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
 {
     $partial = $this->collDgmEffectssPartial && !$this->isNew();
     if (null === $this->collDgmEffectss || null !== $criteria || $partial) {
         if ($this->isNew() && null === $this->collDgmEffectss) {
             return 0;
         } else {
             if ($partial && !$criteria) {
                 return count($this->getDgmEffectss());
             }
             $query = ChildDgmEffectsQuery::create(null, $criteria);
             if ($distinct) {
                 $query->distinct();
             }
             return $query->filterByInvTypes($this)->count($con);
         }
     } else {
         return count($this->collDgmEffectss);
     }
 }
 /**
  * Get the associated ChildDgmEffects object
  *
  * @param  ConnectionInterface $con Optional Connection object.
  * @return ChildDgmEffects The associated ChildDgmEffects object.
  * @throws PropelException
  */
 public function getDgmEffects(ConnectionInterface $con = null)
 {
     if ($this->aDgmEffects === null && $this->effectid !== null) {
         $this->aDgmEffects = ChildDgmEffectsQuery::create()->findPk($this->effectid, $con);
         /* The following can be used additionally to
               guarantee the related object contains a reference
               to this object.  This level of coupling may, however, be
               undesirable since it could result in an only partially populated collection
               in the referenced object.
               $this->aDgmEffects->addDgmTypeEffectss($this);
            */
     }
     return $this->aDgmEffects;
 }
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @throws LogicException if no primary key is defined
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = ChildDgmEffectsQuery::create();
     $criteria->add(DgmEffectsTableMap::COL_EFFECTID, $this->effectid);
     return $criteria;
 }
 /**
  * Returns a new ChildDgmEffectsQuery object.
  *
  * @param     string $modelAlias The alias of a model in the query
  * @param     Criteria $criteria Optional Criteria to build the query from
  *
  * @return ChildDgmEffectsQuery
  */
 public static function create($modelAlias = null, Criteria $criteria = null)
 {
     if ($criteria instanceof ChildDgmEffectsQuery) {
         return $criteria;
     }
     $query = new ChildDgmEffectsQuery();
     if (null !== $modelAlias) {
         $query->setModelAlias($modelAlias);
     }
     if ($criteria instanceof Criteria) {
         $query->mergeWith($criteria);
     }
     return $query;
 }
 public function getSlotTypes()
 {
     $slotTypes = EVE\DgmEffectsQuery::create()->filterByEffectName($this->slotEffectNames)->filterByPublished(1)->find();
     $slotTypeContent = array();
     foreach ($slotTypes as $slotType) {
         $slotTypeContent[] = array('id' => $slotType->getEffectID(), 'name' => $slotType->getDisplayName());
     }
     return $slotTypeContent;
 }
 /**
  * Performs an INSERT on the database, given a DgmEffects or Criteria object.
  *
  * @param mixed               $criteria Criteria or DgmEffects object containing data that is used to create the INSERT statement.
  * @param ConnectionInterface $con the ConnectionInterface connection to use
  * @return mixed           The new primary key.
  * @throws PropelException Any exceptions caught during processing will be
  *                         rethrown wrapped into a PropelException.
  */
 public static function doInsert($criteria, ConnectionInterface $con = null)
 {
     if (null === $con) {
         $con = Propel::getServiceContainer()->getWriteConnection(DgmEffectsTableMap::DATABASE_NAME);
     }
     if ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
         // rename for clarity
     } else {
         $criteria = $criteria->buildCriteria();
         // build Criteria from DgmEffects object
     }
     if ($criteria->containsKey(DgmEffectsTableMap::COL_EFFECTID) && $criteria->keyContainsValue(DgmEffectsTableMap::COL_EFFECTID)) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . DgmEffectsTableMap::COL_EFFECTID . ')');
     }
     // Set the correct dbName
     $query = DgmEffectsQuery::create()->mergeWith($criteria);
     // use transaction because $criteria could contain info
     // for more than one table (I guess, conceivably)
     return $con->transaction(function () use($con, $query) {
         return $query->doInsert($con);
     });
 }