コード例 #1
0
ファイル: PayerTypePeer.php プロジェクト: taryono/school
 public static function getParents()
 {
     $parents = array();
     foreach (PayerTypePeer::doSelect(new Criteria()) as $d) {
         if (count($d->getPayerTypesRelatedByParent()) > 0) {
             $parents[] = $d->getId();
         }
     }
     return $parents;
 }
コード例 #2
0
ファイル: BasePayerTypePeer.php プロジェクト: taryono/school
 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;
 }
コード例 #3
0
ファイル: BasePayerType.php プロジェクト: taryono/school
 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;
 }