vendor/sulu/sulu/src/Sulu/Bundle/SnippetBundle/Document/SnippetDocument.php line 129

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Bundle\SnippetBundle\Document;
  11. use Sulu\Component\Content\Document\Behavior\ExtensionBehavior;
  12. use Sulu\Component\Content\Document\Behavior\LocalizedAuditableBehavior;
  13. use Sulu\Component\Content\Document\Behavior\StructureBehavior;
  14. use Sulu\Component\Content\Document\Behavior\StructureTypeFilingBehavior;
  15. use Sulu\Component\Content\Document\Behavior\WorkflowStageBehavior;
  16. use Sulu\Component\Content\Document\Extension\ExtensionContainer;
  17. use Sulu\Component\Content\Document\Structure\Structure;
  18. use Sulu\Component\Content\Document\Structure\StructureInterface;
  19. use Sulu\Component\Content\Document\WorkflowStage;
  20. use Sulu\Component\DocumentManager\Behavior\Mapping\LocalizedTitleBehavior;
  21. use Sulu\Component\DocumentManager\Behavior\Mapping\NodeNameBehavior;
  22. use Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior;
  23. use Sulu\Component\DocumentManager\Behavior\Mapping\UuidBehavior;
  24. use Sulu\Component\DocumentManager\Behavior\Path\AliasFilingBehavior;
  25. use Sulu\Component\DocumentManager\Behavior\Path\AutoNameBehavior;
  26. /**
  27.  * Snippet document.
  28.  */
  29. class SnippetDocument implements
  30.     NodeNameBehavior,
  31.     LocalizedAuditableBehavior,
  32.     AutoNameBehavior,
  33.     AliasFilingBehavior,
  34.     StructureTypeFilingBehavior,
  35.     StructureBehavior,
  36.     WorkflowStageBehavior,
  37.     UuidBehavior,
  38.     PathBehavior,
  39.     LocalizedTitleBehavior,
  40.     ExtensionBehavior
  41. {
  42.     public const RESOURCE_KEY 'snippets';
  43.     public const LIST_KEY 'snippets';
  44.     /**
  45.      * @var \DateTime
  46.      */
  47.     private $created;
  48.     /**
  49.      * @var \DateTime
  50.      */
  51.     private $changed;
  52.     /**
  53.      * @var int|null
  54.      */
  55.     private $creator;
  56.     /**
  57.      * @var int|null
  58.      */
  59.     private $changer;
  60.     /**
  61.      * @var object
  62.      */
  63.     private $parent;
  64.     /**
  65.      * @var string
  66.      */
  67.     private $title;
  68.     /**
  69.      * @var int
  70.      */
  71.     private $workflowStage;
  72.     /**
  73.      * @var \DateTime
  74.      */
  75.     private $published;
  76.     /**
  77.      * @var string
  78.      */
  79.     private $uuid;
  80.     /**
  81.      * @var string
  82.      */
  83.     private $structureType;
  84.     /**
  85.      * @var StructureInterface
  86.      */
  87.     private $structure;
  88.     /**
  89.      * @var string
  90.      */
  91.     private $locale;
  92.     /**
  93.      * @var string
  94.      */
  95.     private $originalLocale;
  96.     /**
  97.      * @var string
  98.      */
  99.     private $path;
  100.     /**
  101.      * @var string
  102.      */
  103.     private $nodeName;
  104.     /**
  105.      * @var array<mixed[]>|ExtensionContainer
  106.      */
  107.     private $extensions;
  108.     public function __construct()
  109.     {
  110.         $this->workflowStage WorkflowStage::TEST;
  111.         $this->structure = new Structure();
  112.         $this->extensions = new ExtensionContainer();
  113.     }
  114.     public function getNodeName()
  115.     {
  116.         return $this->nodeName;
  117.     }
  118.     public function getTitle()
  119.     {
  120.         return $this->title;
  121.     }
  122.     /**
  123.      * Set the title.
  124.      */
  125.     public function setTitle($title)
  126.     {
  127.         $this->title $title;
  128.     }
  129.     public function getCreated()
  130.     {
  131.         return $this->created;
  132.     }
  133.     /**
  134.      * @param \DateTime $created
  135.      *
  136.      * @return void
  137.      */
  138.     public function setCreated($created)
  139.     {
  140.         $this->created $created;
  141.     }
  142.     public function getChanged()
  143.     {
  144.         return $this->changed;
  145.     }
  146.     public function getCreator()
  147.     {
  148.         return $this->creator;
  149.     }
  150.     /**
  151.      * @param int|null $userId
  152.      *
  153.      * @return void
  154.      */
  155.     public function setCreator($userId)
  156.     {
  157.         $this->creator $userId;
  158.     }
  159.     public function getChanger()
  160.     {
  161.         return $this->changer;
  162.     }
  163.     public function getParent()
  164.     {
  165.         return $this->parent;
  166.     }
  167.     public function setParent($parent)
  168.     {
  169.         $this->parent $parent;
  170.     }
  171.     public function getWorkflowStage()
  172.     {
  173.         return $this->workflowStage;
  174.     }
  175.     public function setWorkflowStage($workflowStage)
  176.     {
  177.         $this->workflowStage $workflowStage;
  178.     }
  179.     public function getPublished()
  180.     {
  181.         return $this->published;
  182.     }
  183.     public function getUuid()
  184.     {
  185.         return $this->uuid;
  186.     }
  187.     public function getStructureType()
  188.     {
  189.         return $this->structureType;
  190.     }
  191.     public function getStructure()
  192.     {
  193.         return $this->structure;
  194.     }
  195.     public function setStructureType($structureType)
  196.     {
  197.         $this->structureType $structureType;
  198.     }
  199.     public function getLocale()
  200.     {
  201.         return $this->locale;
  202.     }
  203.     public function setLocale($locale)
  204.     {
  205.         $this->locale $locale;
  206.     }
  207.     public function getOriginalLocale()
  208.     {
  209.         return $this->originalLocale;
  210.     }
  211.     public function setOriginalLocale($originalLocale)
  212.     {
  213.         $this->originalLocale $originalLocale;
  214.     }
  215.     public function getPath()
  216.     {
  217.         return $this->path;
  218.     }
  219.     public function getExtensionsData()
  220.     {
  221.         return $this->extensions;
  222.     }
  223.     public function setExtensionsData($extensions)
  224.     {
  225.         $this->extensions $extensions;
  226.     }
  227.     public function setExtension($name$data)
  228.     {
  229.         $this->extensions[$name] = $data;
  230.     }
  231. }