Пример #1
0
 public function save(CustomerModel $customer)
 {
     try {
         $sql = "INSERT INTO {$this->dbTable} (" . self::$SSNColumn . "," . self::$FirstNameColumn . "," . self::$LastNameColumn . "," . self::$emailColumn . ") VALUE (?,?,?,?)";
         $params = array($customer->getSSN(), $customer->getFirstName(), $customer->getLastName(), $customer->getEmail());
         $query = $this->database->prepare($sql);
         $query->execute($params);
     } catch (\PDOException $e) {
         return false;
     }
 }
Пример #2
0
 private function sendCustomerEmail(CustomerModel $customer, OrderModel $order)
 {
     $orderId = $order->getId();
     $to = $customer->getEmail();
     $subject = 'Your order!';
     $message = 'Receipt';
     $headers = 'From: itzys webshop';
     if (mail($to, $subject, $message, $headers)) {
         return true;
     } else {
         return false;
     }
 }