Ejemplo n.º 1
0
 /**
  * Create file with given SQL update.
  */
 public function actionCreate()
 {
     $this->checkIsAjax();
     $sql = $this->getParameter("sql");
     $showAll = \Nette\Utils\Json::decode($this->getParameter("showAll"));
     $isFull = \Nette\Utils\Json::decode($this->getParameter("isFull"));
     if ($this->updator->createUpdate($isFull, $sql)) {
         $this->updatorRender->findUpdates(true);
         $this->payload->state = true;
         $this->payload->message = "File successfully created";
         $this->payload->table = $this->updatorRender->renderTable($showAll);
         $this->payload->updatesCount = $this->updatorRender->renderUpdatesCount($showAll);
     } else {
         $this->payload->state = false;
         $this->payload->message = "Failed!";
     }
     $this->sendPayload();
 }