public static function getParents() { $parents = array(); foreach (PayerTypePeer::doSelect(new Criteria()) as $d) { if (count($d->getPayerTypesRelatedByParent()) > 0) { $parents[] = $d->getId(); } } return $parents; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(PayerTypePeer::ID, $pks, Criteria::IN); $objs = PayerTypePeer::doSelect($criteria, $con); } return $objs; }
public function getPayerTypesRelatedByParent($criteria = null, $con = null) { include_once 'lib/model/om/BasePayerTypePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collPayerTypesRelatedByParent === null) { if ($this->isNew()) { $this->collPayerTypesRelatedByParent = array(); } else { $criteria->add(PayerTypePeer::PARENT, $this->getId()); PayerTypePeer::addSelectColumns($criteria); $this->collPayerTypesRelatedByParent = PayerTypePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(PayerTypePeer::PARENT, $this->getId()); PayerTypePeer::addSelectColumns($criteria); if (!isset($this->lastPayerTypeRelatedByParentCriteria) || !$this->lastPayerTypeRelatedByParentCriteria->equals($criteria)) { $this->collPayerTypesRelatedByParent = PayerTypePeer::doSelect($criteria, $con); } } } $this->lastPayerTypeRelatedByParentCriteria = $criteria; return $this->collPayerTypesRelatedByParent; }