예제 #1
0
 public static function getParents()
 {
     $parents = array();
     foreach (PaymentModelPeer::doSelect(new Criteria()) as $d) {
         if (count($d->getPaymentModelsRelatedByParent()) > 0) {
             $parents[] = $d->getId();
         }
     }
     return $parents;
 }
예제 #2
0
 public function getPaymentModelsRelatedByParent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BasePaymentModelPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPaymentModelsRelatedByParent === null) {
         if ($this->isNew()) {
             $this->collPaymentModelsRelatedByParent = array();
         } else {
             $criteria->add(PaymentModelPeer::PARENT, $this->getId());
             PaymentModelPeer::addSelectColumns($criteria);
             $this->collPaymentModelsRelatedByParent = PaymentModelPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(PaymentModelPeer::PARENT, $this->getId());
             PaymentModelPeer::addSelectColumns($criteria);
             if (!isset($this->lastPaymentModelRelatedByParentCriteria) || !$this->lastPaymentModelRelatedByParentCriteria->equals($criteria)) {
                 $this->collPaymentModelsRelatedByParent = PaymentModelPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastPaymentModelRelatedByParentCriteria = $criteria;
     return $this->collPaymentModelsRelatedByParent;
 }
예제 #3
0
 public function executePayment()
 {
     $this->getEnquirer();
     $this->getLayoutParam();
     $this->step = 'payment';
     /* Get Payment Method */
     $c = new Criteria();
     $c->addAscendingOrderByColumn(PaymentModelPeer::PARENT);
     $c->addAscendingOrderByColumn(PaymentModelPeer::NAME);
     $paymentMethod = PaymentModelPeer::doSelect($c);
     $this->paymentMethod = array();
     foreach ($paymentMethod as $p) {
         $this->paymentMethod[$p->getParent()][] = $p;
     }
 }
예제 #4
0
 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(PaymentModelPeer::ID, $pks, Criteria::IN);
         $objs = PaymentModelPeer::doSelect($criteria, $con);
     }
     return $objs;
 }