/** * 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->aLeasingEventBookings instanceof Persistent) { $this->aLeasingEventBookings->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) $this->aLeasingEventBookings = null; }
/** * 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 LeasingEventBookings $obj A LeasingEventBookings 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 LeasingEventBookingsPeer::$instances[$key] = $obj; } }
/** * Filter the query by a related LeasingEventBookings object * * @param LeasingEventBookings|PropelObjectCollection $leasingEventBookings the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return LeasingEventPlaceQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByLeasingEventBookings($leasingEventBookings, $comparison = null) { if ($leasingEventBookings instanceof LeasingEventBookings) { return $this->addUsingAlias(LeasingEventPlacePeer::ID, $leasingEventBookings->getEventPlaceId(), $comparison); } elseif ($leasingEventBookings instanceof PropelObjectCollection) { return $this->useLeasingEventBookingsQuery()->filterByPrimaryKeys($leasingEventBookings->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByLeasingEventBookings() only accepts arguments of type LeasingEventBookings or PropelCollection'); } }
/** * Filter the query by a related LeasingEventBookings object * * @param LeasingEventBookings|PropelObjectCollection $leasingEventBookings The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return LeasingEventPaymentDetailsQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByLeasingEventBookings($leasingEventBookings, $comparison = null) { if ($leasingEventBookings instanceof LeasingEventBookings) { return $this->addUsingAlias(LeasingEventPaymentDetailsPeer::EVENT_BOOKINGS_ID, $leasingEventBookings->getId(), $comparison); } elseif ($leasingEventBookings instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(LeasingEventPaymentDetailsPeer::EVENT_BOOKINGS_ID, $leasingEventBookings->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByLeasingEventBookings() only accepts arguments of type LeasingEventBookings or PropelCollection'); } }
public function saveEventBookingAction() { $request = $this->getRequest(); $directory = $request->server->get('DOCUMENT_ROOT') . '/secured/uploads/events/'; $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'); $age = $request->request->get('age'); $email = $request->request->get('email'); $mobile = $request->request->get('mobile'); $tmpbdate = $request->request->get('bdate'); $bdate = new \DateTime($tmpbdate); $tmpEventDate = $request->request->get('eventDate'); $eventDate = new \DateTime($tmpEventDate); $eventTimeFrom = $request->request->get('eventTimeFrom'); $eventTimeTo = $request->request->get('eventTimeTo'); $eventPostId = $request->request->get('postId'); $eventSpecific = $request->request->get('eventSpecific'); $firstHeard = $request->request->get('firstHeard'); $date = new \DateTime('now'); $eventPlace = LeasingEventPlacePeer::getEventPlaceByPostId($eventPostId); $eventLead = new LeasingEventLeads(); $eventLead->setFname($fname); $eventLead->setLname($lname); $eventLead->setBirthdate($bdate->format('Y-m-d')); $eventLead->setAge($age); $eventLead->setGender($gender); $eventLead->setMobile($mobile); $eventLead->setEmail($email); $eventLead->setEventLeadType(1); $eventLead->save(); $eventBooking = new LeasingEventBookings(); $eventBooking->setEventPlaceId($eventPlace->getId()); $eventBooking->setEventPlaceSpecific($eventSpecific); $eventBooking->setEventLeadsId($eventLead->getId()); $eventBooking->setEventDate($eventDate->format('Y-m-d')); $eventBooking->setEventStartTime($eventTimeFrom); $eventBooking->setEventEndTime($eventTimeTo); $eventBooking->setDateAdded($date->format(C::DATETIMEFORMAT)); $eventBooking->setFirstHeard($firstHeard); $eventBooking->setStatus(C::PENDING); $eventBooking->setPrevStatus(C::PENDING); $eventBooking->save(); $code = 'EV' . U::generateCode(5, $eventBooking->getId()); $eventBooking->setApplicationNumber($code); $eventBooking->save(); $tl1 = new LeasingTimelineActivity(); $tl1->setLeadTypeId(C::EVENT); $tl1->setLeadId($eventBooking->getId()); $tl1->setUser('Lead'); $tl1->setActivity('Requested for Event Space Rental'); $tl1->setTimestamp($date->format(C::DATETIMEFORMAT)); $tl1->setStatus('Pending'); $tl1->setStatusId(C::PENDING); $tl1->save(); foreach ($files as $file) { $tmp = $file->getPathName(); $fileName = $eventBooking->getId() . '_' . $eventLead->getLname() . '_' . $eventBooking->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($eventBooking->getId()); $ld->setDocumentId($doc->getId()); $ld->setLeadTypeId(C::EVENT); $ld->save(); } else { echo -2; exit; } } $this->get('session')->set('thank-you', 1); $client = new GlobeClient(); $msg = "Thank you, " . $eventLead->getFname() . " " . $eventLead->getLname() . "! Your application reference number (ARN) is " . $eventBooking->getApplicationNumber() . ". We will update you ASAP once we've reviewed your application. You can check your status in this page, http://bit.ly/as12f. Log in with your last name and ARN. This msg is FREE."; $sms = $client->sms($this->globeShortCode); $response = $sms->sendMessage($eventLead->getMobile(), $msg, $this->appId, $this->appSecret); if ($response && !isset($response['error'])) { $badge = new LeasingLeadBadges(); $badge->setBadgeId(11); $badge->setLeadTypeId(C::EVENT); $badge->setLeadId($eventBooking->getId()); $badge->setStatus(1); $badge->save(); $tl2 = new LeasingTimelineActivity(); $tl2->setLeadTypeId(C::EVENT); $tl2->setLeadId($eventBooking->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($eventLead->getEmail()); if ($ve = 'valid') { $badge = new LeasingLeadBadges(); $badge->setBadgeId(12); $badge->setLeadTypeId(C::EVENT); $badge->setLeadId($eventBooking->getId()); $badge->setStatus(1); $badge->save(); $tl3 = new LeasingTimelineActivity(); $tl3->setLeadTypeId(C::EVENT); $tl3->setLeadId($eventBooking->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; }
/** * @param LeasingEventBookings $leasingEventBookings The leasingEventBookings object to add. */ protected function doAddLeasingEventBookings($leasingEventBookings) { $this->collLeasingEventBookingss[] = $leasingEventBookings; $leasingEventBookings->setLeasingEventLeads($this); }
/** * 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; }
/** * Exclude object from result * * @param LeasingEventBookings $leasingEventBookings Object to remove from the list of results * * @return LeasingEventBookingsQuery The current query, for fluid interface */ public function prune($leasingEventBookings = null) { if ($leasingEventBookings) { $this->addUsingAlias(LeasingEventBookingsPeer::ID, $leasingEventBookings->getId(), Criteria::NOT_EQUAL); } return $this; }