<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - name [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Category\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Category\Listing|\Pimcore\Model\DataObject\Category|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Category extends Concrete
{
protected $o_classId = "Category";
protected $o_className = "Category";
protected $name;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Category
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get name - Name
* @return string|null
*/
public function getName(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("name");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->name;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set name - Name
* @param string|null $name
* @return \Pimcore\Model\DataObject\Category
*/
public function setName(?string $name)
{
$this->name = $name;
return $this;
}
}