コード例 #1
0
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->aLeasingParkingLeads instanceof Persistent) {
             $this->aLeasingParkingLeads->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     $this->aLeasingParkingLeads = null;
 }
コード例 #2
0
 public function saveParkingLeadAction()
 {
     $request = $this->getRequest();
     $directory = $request->server->get('DOCUMENT_ROOT') . '/secured/uploads/parking/';
     $files = $request->files->get('documents');
     $salutation = $request->request->get('salutation');
     $fname = $request->request->get('fname');
     $lname = $request->request->get('lname');
     $gender = $request->request->get('gender');
     $tmpbdate = $request->request->get('bdate');
     $bdate = new \DateTime($tmpbdate);
     $age = $request->request->get('age');
     $email = $request->request->get('email');
     $mobile = $request->request->get('mobile');
     $property = $request->request->get('property');
     $unit = $request->request->get('unit');
     $slots = $request->request->get('slots');
     $firstHeard = $request->request->get('firstHeard');
     $terms = $request->request->get('terms');
     $paymentType = $request->request->get('paymentType');
     $date = new \DateTime('now');
     $lead = new LeasingParkingLeads();
     $lead->setSalutation($salutation);
     $lead->setFname($fname);
     $lead->setLname($lname);
     $lead->setGender($gender);
     $lead->setAge($age);
     $lead->setBirthday($bdate->format('Y-m-d'));
     $lead->setEmail($email);
     $lead->setMobile($mobile);
     $lead->setProperty($property);
     $lead->setUnit($unit);
     $lead->setSlots($slots);
     $lead->setFirstHeard($firstHeard);
     $lead->setPaymentTerms($terms);
     $lead->setPaymentType($paymentType);
     $lead->setDateAdded($date->format(C::DATETIMEFORMAT));
     $lead->setStatus(C::PENDING);
     $lead->save();
     $code = 'PA' . U::generateCode(5, $lead->getId());
     $lead->setApplicationNumber($code);
     $lead->save();
     foreach ($files as $file) {
         $tmp = $file->getPathName();
         $fileName = $lead->getId() . '_' . $lead->getLname() . '_' . $lead->getApplicationNumber() . '_' . $file->getClientOriginalName();
         $target = $directory . $fileName;
         if (move_uploaded_file($tmp, $target)) {
             $doc = new LeasingDocument();
             $doc->setDocument($fileName);
             $doc->save();
             $ld = new LeasingLeadDocument();
             $ld->setLeadId($lead->getId());
             $ld->setDocumentId($doc->getId());
             $ld->setLeadTypeId(C::PARKING);
             $ld->save();
         } else {
             echo -2;
             exit;
         }
     }
     $tl1 = new LeasingTimelineActivity();
     $tl1->setLeadTypeId(C::PARKING);
     $tl1->setLeadId($lead->getId());
     $tl1->setUser('Lead');
     $tl1->setActivity('Applied for Parking Space');
     $tl1->setTimestamp($date->format(C::DATETIMEFORMAT));
     $tl1->setStatus('Pending');
     $tl1->setStatusId(C::PENDING);
     $tl1->save();
     $this->get('session')->set('thank-you', 1);
     $client = new GlobeClient();
     $msg = "Thank you, " . $lead->getFname() . " " . $lead->getLname() . "! Your application reference number (ARN) is " . $lead->getApplicationNumber() . ". We will update you once we've reviewed your application. You can check your status in this page, http://bit.ly/as12f. Log in with your Application Reference Number. This msg is FREE.";
     $sms = $client->sms($this->globeShortCode);
     $response = $sms->sendMessage($lead->getMobile(), $msg, $this->appId, $this->appSecret);
     if ($response && !isset($response['error'])) {
         $badge = new LeasingLeadBadges();
         $badge->setBadgeId(11);
         $badge->setLeadTypeId(C::PARKING);
         $badge->setLeadId($lead->getId());
         $badge->setStatus(1);
         $badge->save();
         $tl2 = new LeasingTimelineActivity();
         $tl2->setLeadTypeId(C::PARKING);
         $tl2->setLeadId($lead->getId());
         $tl2->setUser('System');
         $tl2->setActivity('Verified mobile number');
         $tl2->setTimestamp($date->format(C::DATETIMEFORMAT));
         $tl2->setStatus('Mobile Verified');
         $tl2->setStatusId(C::MOBILE_VERIFIED);
         $tl2->save();
     }
     $ve = VerifyEmail::verifyThisEmail($lead->getEmail());
     if ($ve = 'valid') {
         $badge = new LeasingLeadBadges();
         $badge->setBadgeId(12);
         $badge->setLeadTypeId(C::PARKING);
         $badge->setLeadId($lead->getId());
         $badge->setStatus(1);
         $badge->save();
         $tl3 = new LeasingTimelineActivity();
         $tl3->setLeadTypeId(C::PARKING);
         $tl3->setLeadId($lead->getId());
         $tl3->setUser('System');
         $tl3->setActivity('Verified email address');
         $tl3->setTimestamp($date->format(C::DATETIMEFORMAT));
         $tl3->setStatus('Email Verified');
         $tl3->setStatusId(C::EMAIL_VERIFIED);
         $tl3->save();
     }
     echo 1;
     exit;
 }
コード例 #3
0
 /**
  * Filter the query by a related LeasingParkingLeads object
  *
  * @param   LeasingParkingLeads|PropelObjectCollection $leasingParkingLeads The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 LeasingParkingPaymentDetailsQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByLeasingParkingLeads($leasingParkingLeads, $comparison = null)
 {
     if ($leasingParkingLeads instanceof LeasingParkingLeads) {
         return $this->addUsingAlias(LeasingParkingPaymentDetailsPeer::PARKING_LEAD_ID, $leasingParkingLeads->getId(), $comparison);
     } elseif ($leasingParkingLeads instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(LeasingParkingPaymentDetailsPeer::PARKING_LEAD_ID, $leasingParkingLeads->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByLeasingParkingLeads() only accepts arguments of type LeasingParkingLeads or PropelCollection');
     }
 }
コード例 #4
0
 /**
  * Exclude object from result
  *
  * @param   LeasingParkingLeads $leasingParkingLeads Object to remove from the list of results
  *
  * @return LeasingParkingLeadsQuery The current query, for fluid interface
  */
 public function prune($leasingParkingLeads = null)
 {
     if ($leasingParkingLeads) {
         $this->addUsingAlias(LeasingParkingLeadsPeer::ID, $leasingParkingLeads->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
コード例 #5
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param LeasingParkingLeads $obj A LeasingParkingLeads object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         LeasingParkingLeadsPeer::$instances[$key] = $obj;
     }
 }
コード例 #6
0
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->collLeasingPaymentValidities) {
             foreach ($this->collLeasingPaymentValidities as $o) {
                 $o->clearAllReferences($deep);
             }
         }
         if ($this->aLeasingParkingLeads instanceof Persistent) {
             $this->aLeasingParkingLeads->clearAllReferences($deep);
         }
         if ($this->aLeasingEventBookings instanceof Persistent) {
             $this->aLeasingEventBookings->clearAllReferences($deep);
         }
         if ($this->aLeasingBookings instanceof Persistent) {
             $this->aLeasingBookings->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     if ($this->collLeasingPaymentValidities instanceof PropelCollection) {
         $this->collLeasingPaymentValidities->clearIterator();
     }
     $this->collLeasingPaymentValidities = null;
     $this->aLeasingParkingLeads = null;
     $this->aLeasingEventBookings = null;
     $this->aLeasingBookings = null;
 }