/** * 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 = ChildKeywordSynonymQuery::create(); $criteria->add(KeywordSynonymTableMap::COL_ID, $this->id); return $criteria; }
/** * Returns the number of related KeywordSynonym objects. * * @param Criteria $criteria * @param boolean $distinct * @param ConnectionInterface $con * @return int Count of related KeywordSynonym objects. * @throws PropelException */ public function countKeywordSynonyms(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collKeywordSynonymsPartial && !$this->isNew(); if (null === $this->collKeywordSynonyms || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collKeywordSynonyms) { return 0; } if ($partial && !$criteria) { return count($this->getKeywordSynonyms()); } $query = ChildKeywordSynonymQuery::create(null, $criteria); if ($distinct) { $query->distinct(); } return $query->filterByKeyword($this)->count($con); } return count($this->collKeywordSynonyms); }
/** * Returns a new ChildKeywordSynonymQuery object. * * @param string $modelAlias The alias of a model in the query * @param Criteria $criteria Optional Criteria to build the query from * * @return ChildKeywordSynonymQuery */ public static function create($modelAlias = null, Criteria $criteria = null) { if ($criteria instanceof ChildKeywordSynonymQuery) { return $criteria; } $query = new ChildKeywordSynonymQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }