Пример #1
0
 public function archiveBasket(Request $request, Basket $basket)
 {
     $archive_status = (bool) $request->query->get('archive');
     $basket->setArchived($archive_status);
     $this->getEntityManager()->merge($basket);
     $this->getEntityManager()->flush();
     if ($archive_status) {
         $message = $this->app->trans('Basket has been archived');
     } else {
         $message = $this->app->trans('Basket has been unarchived');
     }
     $data = ['success' => true, 'archive' => $archive_status, 'message' => $message];
     if ($request->getRequestFormat() === 'json') {
         return $this->app->json($data);
     }
     return $this->app->redirectPath('prod_workzone_show');
 }
 /**
  * {@inheritDoc}
  */
 public function setArchived($archived)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setArchived', array($archived));
     return parent::setArchived($archived);
 }