Exemple #1
0
 public function _clone(GoodsPassport $product)
 {
     $this->product = new GoodsPassport();
     $this->product->setImg($product->getImg())->setModel($product->getModel())->setColor($product->getColor())->setPattern($product->getPattern())->setColorSn($product->getColorSn())->setBrand($product->getBrand())->setMt($product->getMt())->setStatus($product->getStatus())->setLevel($product->getLevel())->setSource($product->getSource())->setName($product->getName())->setParent($product->getParent())->setCost($product->getCost())->setPrice($product->getPrice())->setOrgSn($product->getOrgSn())->setMemo($product->getMemo())->setCustom($product->getCustom())->setPromotion($product->getPromotion())->setIsBehalf($product->getIsBehalf())->setWebPrice($product->getWebPrice())->setDesimg($product->getDesimg())->setBrief($product->getBrief())->setDescription($product->getDescription())->setIsAllowWeb($product->getIsAllowWeb())->setSeoSlogan($product->getSeoSlogan())->setSeoSlogan2($product->getSeoSlogan2())->setIsAllowCreditCard($product->getIsAllowCreditCard())->setYahooId($product->getYahooId())->setIsAlanIn(false)->setIsAllowAuction(false)->setBsoCustomPercentage(NULL);
     foreach ($product->getCategorys() as $category) {
         $this->product->addCategory($category);
     }
     return $this;
 }
Exemple #2
0
 protected function genArr(GoodsPassport $product)
 {
     $arr = array();
     $arr['auth_key'] = 'jasodijQQ3Eoinaaoidll';
     // GoodsPassport (分類???)
     $arr['GoodsPassport']['id'] = $product->getId();
     $arr['GoodsPassport']['status_id'] = $product->getStatus()->getId();
     $arr['GoodsPassport']['source_id'] = $product->getSource() ? $product->getSource()->getId() : 0;
     $arr['GoodsPassport']['img_id'] = $product->getImg() ? $product->getImg()->getId() : 0;
     $arr['GoodsPassport']['level_id'] = $product->getLevel() ? $product->getLevel()->getId() : 0;
     $arr['GoodsPassport']['inherit_id'] = $product->getParent()->getId();
     $arr['GoodsPassport']['sn'] = $product->getSn();
     $arr['GoodsPassport']['name'] = $product->getName();
     $arr['GoodsPassport']['cost'] = $product->getCost();
     $arr['GoodsPassport']['price'] = $product->getPrice();
     $arr['GoodsPassport']['org_sn'] = $product->getOrgSn();
     $arr['GoodsPassport']['memo'] = $product->getMemo();
     $arr['GoodsPassport']['created_at'] = $product->getCreatedAt()->format('Y-m-d H:i:s');
     $arr['GoodsPassport']['mt_id'] = $product->getMt() ? $product->getMt()->getId() : 0;
     $arr['GoodsPassport']['activity_id'] = $product->getActivity() ? $product->getActivity()->getId() : 0;
     $arr['GoodsPassport']['custom_id'] = $product->getCustom() ? $product->getCustom()->getId() : 0;
     $arr['GoodsPassport']['brand_id'] = $product->getBrand() ? $product->getBrand()->getId() : 0;
     //$arr['GoodsPassport']['color_id'] = $product->;
     $arr['GoodsPassport']['pattern_id'] = $product->getPattern() ? $product->getPattern()->getId() : 0;
     $arr['GoodsPassport']['colorSn'] = $product->getColorSn();
     $arr['GoodsPassport']['model'] = $product->getModel();
     $arr['GoodsPassport']['customSn'] = $product->getCustomSn();
     $arr['GoodsPassport']['desimg_id'] = $product->getDesimg() ? $product->getDesimg()->getId() : 0;
     $arr['GoodsPassport']['description_id'] = $product->getDescription() ? $product->getDescription()->getId() : 0;
     $arr['GoodsPassport']['brief_id'] = $product->getBrief() ? $product->getBrief()->getId() : 0;
     $arr['GoodsPassport']['store_id'] = $product->getStore() ? $product->getStore()->getId() : 0;
     $arr['GoodsPassport']['promotion_id'] = $product->getPromotion() ? $product->getPromotion()->getId() : 0;
     $arr['GoodsPassport']['is_allow_web'] = $product->getIsAllowWeb();
     $arr['GoodsPassport']['update_at'] = $product->getUpdateAt() ? $product->getUpdateAt()->format('Y-m-d H:i:s') : null;
     $arr['GoodsPassport']['web_price'] = $product->getWebPrice();
     $arr['GoodsPassport']['categorys'] = array(0);
     foreach ($product->getCategorys() as $category) {
         $arr['GoodsPassport']['categorys'][] = $category->getId();
     }
     $i = 0;
     // Orders
     foreach ($product->getOrders() as $order) {
         $arr['Orders'][$i]['id'] = $order->getId();
         $arr['Orders'][$i]['goods_passport_id'] = $product->getId();
         $arr['Orders'][$i]['pay_type_id'] = $order->getPayType() ? $order->getPayType()->getId() : 0;
         $arr['Orders'][$i]['status_id'] = $order->getStatus()->getId();
         $arr['Orders'][$i]['kind_id'] = $order->getKind()->getId();
         $arr['Orders'][$i]['custom_id'] = $order->getCustom() ? $order->getCustom()->getId() : 0;
         $arr['Orders'][$i]['memo'] = $order->getMemo();
         $arr['Orders'][$i]['required'] = $order->getRequired();
         $arr['Orders'][$i]['paid'] = $order->getPaid();
         $arr['Orders'][$i]['relate_id'] = $order->getParent() ? $order->getParent()->getId() : 0;
         $arr['Orders'][$i]['invoice_id'] = $order->getInvoice() ? $order->getInvoice()->getId() : 0;
         $arr['Orders'][$i]['org_required'] = $order->getOrgRequired();
         $arr['Orders'][$i]['org_paid'] = $order->getOrgPaid();
         // Ope
         $j = 0;
         foreach ($order->getOpes() as $ope) {
             //$arr['Ope'][]['orders_id'] = $order->get;
             $arr['Ope'][$order->getId()][$j]['user_id'] = $ope->getUser() ? $ope->getUser()->getId() : 0;
             $arr['Ope'][$order->getId()][$j]['act'] = $ope->getAct();
             $arr['Ope'][$order->getId()][$j]['datetime'] = $ope->getDatetime()->format('Y-m-d H:i:s');
             $arr['Ope'][$order->getId()][$j]['memo'] = $ope->getMemo();
             $j++;
         }
         $i++;
     }
     return $arr;
 }