/** * @param LeasingAppointmentLeads $leasingAppointmentLeads The leasingAppointmentLeads object to add. */ protected function doAddLeasingAppointmentLeads($leasingAppointmentLeads) { $this->collLeasingAppointmentLeadss[] = $leasingAppointmentLeads; $leasingAppointmentLeads->setLeasingNationality($this); }
/** * Filter the query by a related LeasingAppointmentLeads object * * @param LeasingAppointmentLeads|PropelObjectCollection $leasingAppointmentLeads the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return LeasingNationalityQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByLeasingAppointmentLeads($leasingAppointmentLeads, $comparison = null) { if ($leasingAppointmentLeads instanceof LeasingAppointmentLeads) { return $this->addUsingAlias(LeasingNationalityPeer::ID, $leasingAppointmentLeads->getNationalityId(), $comparison); } elseif ($leasingAppointmentLeads instanceof PropelObjectCollection) { return $this->useLeasingAppointmentLeadsQuery()->filterByPrimaryKeys($leasingAppointmentLeads->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByLeasingAppointmentLeads() only accepts arguments of type LeasingAppointmentLeads or PropelCollection'); } }
/** * 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->collLeasingAppointmentAssignments) { foreach ($this->collLeasingAppointmentAssignments as $o) { $o->clearAllReferences($deep); } } if ($this->aLeasingAppointmentLeads instanceof Persistent) { $this->aLeasingAppointmentLeads->clearAllReferences($deep); } if ($this->aLeasingUnit instanceof Persistent) { $this->aLeasingUnit->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) if ($this->collLeasingAppointmentAssignments instanceof PropelCollection) { $this->collLeasingAppointmentAssignments->clearIterator(); } $this->collLeasingAppointmentAssignments = null; $this->aLeasingAppointmentLeads = null; $this->aLeasingUnit = null; }
public function saveAppointmentRequestAction() { $request = $this->getRequest(); $postid = $request->request->get('unitid'); $date = $request->request->get('date'); $time = $request->request->get('time'); $leasePeriod = $request->request->get('leasePeriod'); $targetMoveIn = $request->request->get('targetMoveIn'); $fname = $request->request->get('fname'); $lname = $request->request->get('lname'); $contact = $request->request->get('contact'); $email = $request->request->get('email'); $country = LeasingCountryPeer::getIdByCountryName($request->request->get('country')); $nationality = LeasingNationalityPeer::getIdByNationalityName($request->request->get('nationality')); $notes = $request->request->get('notes'); $clientIp = $request->request->get('clientIp'); $firstHeard = $request->request->get('firstHeard'); //UNIT DETAILS $unit = LeasingUnitPeer::getUnitByPostId($postid); $lead = new LeasingAppointmentLeads(); $lead->setFname($fname); $lead->setLname($lname); $lead->setEmail($email); $lead->setMobile($contact); $lead->setCountryId($country->getId()); $lead->setNationalityId($nationality->getId()); $lead->setClientIp($clientIp); $lead->save(); $now = new \DateTime('now'); $app = new LeasingAppointments(); $app->setAppointmentLeadsId($lead->getId()); $app->setUnitId($unit->getId()); $app->setPreferredDate($date); $app->setPreferredTime($time); $app->setLeasePeriod($leasePeriod); $app->setTargetMoveIn($targetMoveIn); $app->setFirstHeard($firstHeard); $app->setNotes($notes); $app->setDateAdded($now->format(C::DATETIMEFORMAT)); $app->setStatus(C::PENDING); $app->setPrevStatus(C::PENDING); $app->save(); $tl1 = new LeasingTimelineActivity(); $tl1->setLeadTypeId(C::APPOINTMENT); $tl1->setLeadId($lead->getId()); $tl1->setUser('Lead'); $tl1->setActivity('Requested Unit Viewing'); $tl1->setTimestamp($now->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 request to view " . $app->getLeasingUnit()->getName() . " is now being processed. We will update you ASAP once an agent is assigned to assist you. 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::APPOINTMENT); $badge->setLeadId($lead->getId()); $badge->setStatus(1); $badge->save(); $tl2 = new LeasingTimelineActivity(); $tl2->setLeadTypeId(C::APPOINTMENT); $tl2->setLeadId($lead->getId()); $tl2->setUser('System'); $tl2->setActivity('Verified mobile number'); $tl2->setTimestamp($now->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($now->format(C::DATETIMEFORMAT)); $tl3->setStatus('Email Verified'); $tl3->setStatusId(C::EMAIL_VERIFIED); $tl3->save(); } echo 1; exit; return new Response(); }
/** * 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 LeasingAppointmentLeads $obj A LeasingAppointmentLeads 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 LeasingAppointmentLeadsPeer::$instances[$key] = $obj; } }
/** * Filter the query by a related LeasingAppointmentLeads object * * @param LeasingAppointmentLeads|PropelObjectCollection $leasingAppointmentLeads The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return LeasingAppointmentsQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByLeasingAppointmentLeads($leasingAppointmentLeads, $comparison = null) { if ($leasingAppointmentLeads instanceof LeasingAppointmentLeads) { return $this->addUsingAlias(LeasingAppointmentsPeer::APPOINTMENT_LEADS_ID, $leasingAppointmentLeads->getId(), $comparison); } elseif ($leasingAppointmentLeads instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(LeasingAppointmentsPeer::APPOINTMENT_LEADS_ID, $leasingAppointmentLeads->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByLeasingAppointmentLeads() only accepts arguments of type LeasingAppointmentLeads or PropelCollection'); } }
/** * Exclude object from result * * @param LeasingAppointmentLeads $leasingAppointmentLeads Object to remove from the list of results * * @return LeasingAppointmentLeadsQuery The current query, for fluid interface */ public function prune($leasingAppointmentLeads = null) { if ($leasingAppointmentLeads) { $this->addUsingAlias(LeasingAppointmentLeadsPeer::ID, $leasingAppointmentLeads->getId(), Criteria::NOT_EQUAL); } return $this; }