/** * Get the associated ChildFormats object * * @param ConnectionInterface $con Optional Connection object. * @return ChildFormats The associated ChildFormats object. * @throws PropelException */ public function getFormats(ConnectionInterface $con = null) { if ($this->aFormats === null && $this->_chapterid !== null) { $this->aFormats = ChildFormatsQuery::create()->findPk($this->_chapterid, $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->aFormats->addRTemplatenamesInchapters($this); */ } return $this->aFormats; }
/** * Gets the number of Formats objects related by a many-to-many relationship * to the current object by way of the R_templatenames_inchapter 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 Formats objects */ public function countFormatss(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collFormatssPartial && !$this->isNew(); if (null === $this->collFormatss || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collFormatss) { return 0; } else { if ($partial && !$criteria) { return count($this->getFormatss()); } $query = ChildFormatsQuery::create(null, $criteria); if ($distinct) { $query->distinct(); } return $query->filterByTemplatenames($this)->count($con); } } else { return count($this->collFormatss); } }
/** * If this collection has already been initialized with * an identical criteria, it returns the collection. * Otherwise if this Books is new, it will return * an empty collection; or if this Books has previously * been saved, it will retrieve related Formatss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you * actually need in Books. * * @param Criteria $criteria optional Criteria object to narrow the query * @param ConnectionInterface $con optional connection object * @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN) * @return ObjectCollection|ChildFormats[] List of ChildFormats objects */ public function getFormatssJoinuserSysRef(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildFormatsQuery::create(null, $criteria); $query->joinWith('userSysRef', $joinBehavior); return $this->getFormatss($query, $con); }
/** * 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 = ChildFormatsQuery::create(); $criteria->add(FormatsTableMap::COL_ID, $this->id); return $criteria; }
/** * Returns a new ChildFormatsQuery object. * * @param string $modelAlias The alias of a model in the query * @param Criteria $criteria Optional Criteria to build the query from * * @return ChildFormatsQuery */ public static function create($modelAlias = null, Criteria $criteria = null) { if ($criteria instanceof ChildFormatsQuery) { return $criteria; } $query = new ChildFormatsQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }