Admin_ObjectController::publishVersionAction PHP Метод

publishVersionAction() публичный Метод

    public function publishVersionAction()
    {
        $version = Model\Version::getById($this->getParam("id"));
        $object = $version->loadData();
        $currentObject = Object::getById($object->getId());
        if ($currentObject->isAllowed("publish")) {
            $object->setPublished(true);
            $object->setUserModification($this->getUser()->getId());
            try {
                $object->save();
                $treeData = [];
                $treeData["qtipCfg"] = $object->getElementAdminStyle()->getElementQtipConfig();
                $this->_helper->json(["success" => true, "general" => ["o_modificationDate" => $object->getModificationDate()], "treeData" => $treeData]);
            } catch (\Exception $e) {
                $this->_helper->json(["success" => false, "message" => $e->getMessage()]);
            }
        }
        $this->_helper->json(["success" => false, "message" => "missing_permission"]);
    }