Example #1
0
 protected function getEditionResponse(Entity $entity = null)
 {
     $response = parent::getEditionResponse($entity);
     // Add the status labels.
     $response->addData('orders', array('statuses' => Order::getStatusLabels()));
     return $response;
 }
Example #2
0
 /**
  * Stores an eventual product image.
  *
  * @return Entity
  */
 protected function storeEntity()
 {
     // Store the product.
     $product = parent::storeEntity();
     // Store the image, if there's one.
     $picturePostedData = $this->getRequest()->getParameter('picture');
     if ($picturePostedData) {
         if ($this->storeImage($product->getId(), @$picturePostedData['tmp_name'])) {
             // Store the updated product.
             $product->store();
         }
     }
     return $product;
 }