public static function getParents() { $parents = array(); foreach (VPayerTypePeer::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(VPayerTypePeer::ID, $pks, Criteria::IN); $objs = VPayerTypePeer::doSelect($criteria, $con); } return $objs; }
public function getVPayerTypes($criteria = null, $con = null) { include_once 'lib/model/om/BaseVPayerTypePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVPayerTypes === null) { if ($this->isNew()) { $this->collVPayerTypes = array(); } else { $criteria->add(VPayerTypePeer::PARENT, $this->getId()); VPayerTypePeer::addSelectColumns($criteria); $this->collVPayerTypes = VPayerTypePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(VPayerTypePeer::PARENT, $this->getId()); VPayerTypePeer::addSelectColumns($criteria); if (!isset($this->lastVPayerTypeCriteria) || !$this->lastVPayerTypeCriteria->equals($criteria)) { $this->collVPayerTypes = VPayerTypePeer::doSelect($criteria, $con); } } } $this->lastVPayerTypeCriteria = $criteria; return $this->collVPayerTypes; }