public function getItems() { $types = EVE\InvTypesQuery::create()->filterByPublished(1)->find(); $contentTypes = array(); foreach ($types as $type) { $contentTypes[] = (object) array('id' => $type->getTypeID(), 'name' => $type->getTypeName(), 'volume' => $type->getVolume(), 'capacity' => $type->getCapacity()); } return $contentTypes; }
/** * 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 = ChildInvTypesQuery::create(); $criteria->add(InvTypesTableMap::COL_TYPEID, $this->typeid); return $criteria; }
/** * Performs an INSERT on the database, given a InvTypes or Criteria object. * * @param mixed $criteria Criteria or InvTypes 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(InvTypesTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for clarity } else { $criteria = $criteria->buildCriteria(); // build Criteria from InvTypes object } if ($criteria->containsKey(InvTypesTableMap::COL_TYPEID) && $criteria->keyContainsValue(InvTypesTableMap::COL_TYPEID)) { throw new PropelException('Cannot insert a value for auto-increment primary key (' . InvTypesTableMap::COL_TYPEID . ')'); } // Set the correct dbName $query = InvTypesQuery::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); }); }
/** * Get the associated ChildInvTypes object * * @param ConnectionInterface $con Optional Connection object. * @return ChildInvTypes The associated ChildInvTypes object. * @throws PropelException */ public function getInvTypes(ConnectionInterface $con = null) { if ($this->aInvTypes === null && $this->typeid !== null) { $this->aInvTypes = ChildInvTypesQuery::create()->findPk($this->typeid, $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->aInvTypes->addDgmTypeEffectss($this); */ } return $this->aInvTypes; }
/** * Gets the number of InvTypes 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 InvTypes objects */ public function countInvTypess(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collInvTypessPartial && !$this->isNew(); if (null === $this->collInvTypess || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collInvTypess) { return 0; } else { if ($partial && !$criteria) { return count($this->getInvTypess()); } $query = ChildInvTypesQuery::create(null, $criteria); if ($distinct) { $query->distinct(); } return $query->filterByDgmEffects($this)->count($con); } } else { return count($this->collInvTypess); } }
/** * Get the associated ChildInvTypes object * * @param ConnectionInterface $con Optional Connection object. * @return ChildInvTypes The associated ChildInvTypes object. * @throws PropelException */ public function getInvTypes(ConnectionInterface $con = null) { if ($this->aInvTypes === null && $this->typeid !== null) { $this->aInvTypes = ChildInvTypesQuery::create()->findPk($this->typeid, $con); // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association. $this->aInvTypes->setInvMetaTypes($this); } return $this->aInvTypes; }