setMessage() public method

Set message
public setMessage ( string $message ) : Order
$message string
return Order
Exemplo n.º 1
0
 /**
  * 受注情報、お届け先情報の更新
  *
  * @param $em トランザクション制御されているEntityManager
  * @param $Order 受注情報
  * @param $formData フォームデータ
  */
 public function setOrderUpdate($em, \Eccube\Entity\Order $Order, $formData)
 {
     // 受注情報を更新
     $Order->setOrderDate(new \DateTime());
     $Order->setOrderStatus($this->app['eccube.repository.order_status']->find($this->app['config']['order_new']));
     $Order->setMessage($formData['message']);
     // お届け先情報を更新
     $shippings = $Order->getShippings();
     foreach ($shippings as $shipping) {
         $shipping->setShippingDeliveryName($formData['delivery']->getName());
         if (!empty($formData['deliveryTime'])) {
             $shipping->setShippingDeliveryTime($formData['deliveryTime']->getDeliveryTime());
         }
         if (!empty($formData['deliveryDate'])) {
             $shipping->setShippingDeliveryDate(new \DateTime($formData['deliveryDate']));
         }
         $shipping->setShippingDeliveryFee($shipping->getDeliveryFee()->getFee());
     }
 }
Exemplo n.º 2
0
 /**
  * 受注情報、お届け先情報の更新
  *
  * @param Order $Order 受注情報
  * @param $data フォームデータ
  */
 public function setOrderUpdate(Order $Order, $data)
 {
     // 受注情報を更新
     $Order->setOrderDate(new \DateTime());
     $Order->setOrderStatus($this->app['eccube.repository.order_status']->find($this->app['config']['order_new']));
     $Order->setMessage($data['message']);
     // お届け先情報を更新
     $shippings = $data['shippings'];
     foreach ($shippings as $Shipping) {
         $Delivery = $Shipping->getDelivery();
         $deliveryFee = $this->app['eccube.repository.delivery_fee']->findOneBy(array('Delivery' => $Delivery, 'Pref' => $Shipping->getPref()));
         $deliveryTime = $Shipping->getDeliveryTime();
         if (!empty($deliveryTime)) {
             $Shipping->setShippingDeliveryTime($deliveryTime->getDeliveryTime());
         }
         $Shipping->setDeliveryFee($deliveryFee);
         // 商品ごとの配送料合計
         $productDeliveryFeeTotal = 0;
         if (!is_null($this->BaseInfo->getOptionProductDeliveryFee())) {
             $productDeliveryFeeTotal += $this->getProductDeliveryFee($Shipping);
         }
         $Shipping->setShippingDeliveryFee($deliveryFee->getFee() + $productDeliveryFeeTotal);
         $Shipping->setShippingDeliveryName($Delivery->getName());
     }
     // 配送料無料条件(合計金額)
     $this->setDeliveryFreeAmount($Order);
     // 配送料無料条件(合計数量)
     $this->setDeliveryFreeQuantity($Order);
 }
Exemplo n.º 3
0
 /**
  * フォームデータを更新
  *
  * @param Order $Order
  * @param array $data
  */
 public function setFormData(Order $Order, array $data)
 {
     // お問い合わせ
     $Order->setMessage($data['message']);
     // お届け先情報を更新
     $shippings = $data['shippings'];
     foreach ($shippings as $Shipping) {
         $deliveryTime = $Shipping->getDeliveryTime();
         if (!empty($deliveryTime)) {
             $Shipping->setShippingDeliveryTime($deliveryTime->getDeliveryTime());
         }
     }
 }