Pimcore\Model\Object\Classificationstore\KeyConfig::setType PHP Метод

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

public setType ( mixed $type )
$type mixed
    public function setType($type)
    {
        $this->type = $type;
    }

Usage Example

 public function addPropertyAction()
 {
     $name = $this->getParam("name");
     $alreadyExist = false;
     if (!$alreadyExist) {
         $definition = array("fieldtype" => "input", "name" => $name, "title" => $name, "datatype" => "data");
         $config = new Classificationstore\KeyConfig();
         $config->setName($name);
         $config->setTitle($name);
         $config->setType("input");
         $config->setEnabled(1);
         $config->setDefinition(json_encode($definition));
         $config->save();
     }
     $this->_helper->json(array("success" => !$alreadyExist, "id" => $config->getName()));
 }