Ejemplo n.º 1
0
 protected function LendBasket()
 {
     foreach ($this->objBasket->GetBasket() as $item) {
         $objItem = Myassets::QuerySingle(QQ::Equal(QQN::Myassets()->Id, $item->Id));
         $objPerson = Peopledetails::QuerySingle(QQ::Equal(QQN::Peopledetails()->Id, $this->strBorrower));
         $objShareDetails = new Sharedetails();
         $objShareDetails->Asin = $objItem->Asin;
         $objShareDetails->Email = $objPerson->Email;
         /*Logic to get the return date*/
         $today = new QDateTime(QDateTime::Now);
         $daySpan = new QDateTimeSpan();
         $daySpan->AddDays(30);
         $returnDate = $today->Add($daySpan);
         $objShareDetails->TakenDate = QDateTime::Now(false);
         $objShareDetails->ReturnDate = $returnDate;
         $objShareDetails->Title = $objItem->Title;
         $objShareDetails->FullName = $objPerson->FullName;
         $objShareDetails->Save();
     }
 }