Admin_ClassificationstoreController::createGroupAction PHP Метод

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

public createGroupAction ( )
    public function createGroupAction()
    {
        $name = $this->getParam("name");
        $storeId = $this->getParam("storeId");
        $alreadyExist = false;
        $config = Classificationstore\GroupConfig::getByName($name, $storeId);
        if (!$config) {
            $config = new Classificationstore\GroupConfig();
            $config->setStoreId($storeId);
            $config->setName($name);
            $config->save();
        }
        $this->_helper->json(["success" => !$alreadyExist, "id" => $config->getName()]);
    }