Pimcore\Model\Object\ClassDefinition\CustomLayout::create PHP Method

create() public static method

public static create ( array $values = [] ) : CustomLayout
$values array
return CustomLayout
    public static function create($values = [])
    {
        $class = new self();
        $class->setValues($values);
        return $class;
    }

Usage Example

Ejemplo n.º 1
0
 public function addCustomLayoutAction()
 {
     $customLayout = Object\ClassDefinition\CustomLayout::create(['name' => $this->getParam("name"), 'userOwner' => $this->user->getId(), "classId" => $this->getParam("classId")]);
     $customLayout->save();
     $this->_helper->json(["success" => true, "id" => $customLayout->getId(), "name" => $customLayout->getName(), "data" => $customLayout]);
 }