Beispiel #1
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this GiftType is new, it will return
  * an empty collection; or if this GiftType has previously
  * been saved, it will retrieve related Donations from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in GiftType.
  */
 public function getDonationsJoinFund($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(GiftTypePeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collDonations === null) {
         if ($this->isNew()) {
             $this->collDonations = array();
         } else {
             $criteria->add(DonationPeer::GIFT_TYPE, $this->id);
             $this->collDonations = DonationPeer::doSelectJoinFund($criteria, $con, $join_behavior);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(DonationPeer::GIFT_TYPE, $this->id);
         if (!isset($this->lastDonationCriteria) || !$this->lastDonationCriteria->equals($criteria)) {
             $this->collDonations = DonationPeer::doSelectJoinFund($criteria, $con, $join_behavior);
         }
     }
     $this->lastDonationCriteria = $criteria;
     return $this->collDonations;
 }
Beispiel #2
0
 /**
  * TODO: Check related records.
  * CODE: donation_delete
  */
 public function executeDelete(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     if ($request->isMethod('post')) {
         $dona = DonationPeer::retrieveByPK($request->getParameter('id'));
         $this->forward404Unless($dona);
         $this->getUser()->setFlash('success', 'Donation information has been successfully deleted!');
         $dona->delete();
     }
     return $this->redirect('@donation');
 }
Beispiel #3
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = DonationPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setDonorId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setGiftDate($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setGiftAmount($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setDeductibleAmount($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setGiftType($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setCheckNumber($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setCampainId($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setFundId($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setGiftNote($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setPrintedNote($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setReceiptGeneratedDate($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setFollowUp($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setPremiumOrderDate($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setTributeFirstName($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setTributeLastName($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setTributeAddress1($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setTributeAddress2($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setTributeCity($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setTributeState($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setTributeZipcode($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setTributeEmail($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setTributeCategory($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setTributeMessage($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setTributeDeliverBy($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setTributeGiftId($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setPersonId($arr[$keys[26]]);
     }
     if (array_key_exists($keys[27], $arr)) {
         $this->setProcesseddate($arr[$keys[27]]);
     }
     if (array_key_exists($keys[28], $arr)) {
         $this->setNovapointeId($arr[$keys[28]]);
     }
     if (array_key_exists($keys[29], $arr)) {
         $this->setCcardApprovalNumber($arr[$keys[29]]);
     }
     if (array_key_exists($keys[30], $arr)) {
         $this->setNovapointeFulfillmentId($arr[$keys[30]]);
     }
     if (array_key_exists($keys[31], $arr)) {
         $this->setNovapointeTrackingNumber($arr[$keys[31]]);
     }
     if (array_key_exists($keys[32], $arr)) {
         $this->setNovapointeShipDate($arr[$keys[32]]);
     }
     if (array_key_exists($keys[33], $arr)) {
         $this->setTributeLetterSentDate($arr[$keys[33]]);
     }
     if (array_key_exists($keys[34], $arr)) {
         $this->setSendTributeCard($arr[$keys[34]]);
     }
     if (array_key_exists($keys[35], $arr)) {
         $this->setTributeImageId($arr[$keys[35]]);
     }
     if (array_key_exists($keys[36], $arr)) {
         $this->setEcardReadDate($arr[$keys[36]]);
     }
     if (array_key_exists($keys[37], $arr)) {
         $this->setEcardemailsentdate($arr[$keys[37]]);
     }
     if (array_key_exists($keys[38], $arr)) {
         $this->setEcardEmailSentResult($arr[$keys[38]]);
     }
 }
Beispiel #4
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(DonationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(DonationPeer::DATABASE_NAME);
         $criteria->add(DonationPeer::ID, $pks, Criteria::IN);
         $objs = DonationPeer::doSelect($criteria, $con);
     }
     return $objs;
 }