var/classes/DataObject/Category.php line 21

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - name [input]
  8.  */
  9. namespace Pimcore\Model\DataObject;
  10. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  11. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  12. /**
  13. * @method static \Pimcore\Model\DataObject\Category\Listing getList(array $config = [])
  14. * @method static \Pimcore\Model\DataObject\Category\Listing|\Pimcore\Model\DataObject\Category|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
  15. */
  16. class Category extends Concrete
  17. {
  18. protected $o_classId "Category";
  19. protected $o_className "Category";
  20. protected $name;
  21. /**
  22. * @param array $values
  23. * @return \Pimcore\Model\DataObject\Category
  24. */
  25. public static function create($values = array()) {
  26.     $object = new static();
  27.     $object->setValues($values);
  28.     return $object;
  29. }
  30. /**
  31. * Get name - Name
  32. * @return string|null
  33. */
  34. public function getName(): ?string
  35. {
  36.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  37.         $preValue $this->preGetValue("name");
  38.         if ($preValue !== null) {
  39.             return $preValue;
  40.         }
  41.     }
  42.     $data $this->name;
  43.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  44.         return $data->getPlain();
  45.     }
  46.     return $data;
  47. }
  48. /**
  49. * Set name - Name
  50. * @param string|null $name
  51. * @return \Pimcore\Model\DataObject\Category
  52. */
  53. public function setName(?string $name)
  54. {
  55.     $this->name $name;
  56.     return $this;
  57. }
  58. }