Esempio n. 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;
 }
Esempio n. 2
0
 /**
  * 商品刪除流程
  * 
  * @param  GoodsPassport $product 
  * @param  Session       $session 
  * @param  Client        $client 
  * 
  * @return $this                
  */
 protected function deleteFlow(GoodsPassport $product, Session $session, Client $client)
 {
     $response = $client->delete(array($product));
     if (isset($response->Response->SuccessList->ProductId) && $client->listSearchId($response->Response->SuccessList->ProductId, $product->getYahooId())) {
         return $this->deleteSuccessCallback($session, $product);
     }
     if ($client->isDeleteExist($response)) {
         return $this->deleteSuccessCallback($session, $product);
     }
     $session->getFlashBag()->add('error', $product->getName() . '商城刪除失敗!:' . json_encode($response));
     return false;
 }
Esempio n. 3
0
 public function getYahooFormAction(GoodsPassport $product)
 {
     $router = $this->container->get('router');
     return $product->getYahooId() ? $router->generate('admin_yahoo_update', array('id' => $product->getId())) : $router->generate('admin_yahoo_create', array('id' => $product->getId()));
 }
 protected function addProductId(GoodsPassport $product)
 {
     $this->parameters['ProductId'] = $product->getYahooId();
     return $this;
 }