您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

114 行
2.5KB

  1. <?php
  2. namespace App\Entity\Site;
  3. use App\Repository\Site\BlockRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  6. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  7. use Lc\SovBundle\Doctrine\EntityInterface;
  8. use Lc\SovBundle\Doctrine\Extension\StatusInterface;
  9. use Lc\SovBundle\Doctrine\Extension\StatusTrait;
  10. use Lc\SovBundle\Model\File\FileInterface;
  11. /**
  12. * @ORM\Entity(repositoryClass=BlockRepository::class)
  13. */
  14. class Block implements EntityInterface, StatusInterface, TranslatableInterface
  15. {
  16. use StatusTrait;
  17. use TranslatableTrait;
  18. /**
  19. * @ORM\Id
  20. * @ORM\GeneratedValue
  21. * @ORM\Column(type="integer")
  22. */
  23. private $id;
  24. /**
  25. * @ORM\Column(type="string", length=255)
  26. */
  27. private $devAlias;
  28. /**
  29. * @ORM\Column(type="string", length=255)
  30. */
  31. private $page;
  32. /**
  33. * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
  34. */
  35. private $image;
  36. // public function __call($method, $arguments)
  37. // {
  38. // dump('_call');
  39. // dump($method);
  40. // $method = ('get' === substr($method, 0, 3) || 'set' === substr($method, 0, 3)) ? $method : 'get' . ucfirst(
  41. // $method
  42. // );
  43. // return $this->proxyCurrentLocaleTranslation($method, $arguments);
  44. // }
  45. public function __get($name)
  46. {
  47. $method = 'get' . ucfirst($name);
  48. $arguments = [];
  49. return $this->proxyCurrentLocaleTranslation($method, $arguments);
  50. }
  51. public function __set($name, $value)
  52. {
  53. $method = 'set' . ucfirst($name);
  54. $arguments = [$value];
  55. return $this->proxyCurrentLocaleTranslation($method, $arguments);
  56. }
  57. public function __toString()
  58. {
  59. return $this->page;
  60. }
  61. public function getId(): ?int
  62. {
  63. return $this->id;
  64. }
  65. public function getDevAlias(): ?string
  66. {
  67. return $this->devAlias;
  68. }
  69. public function setDevAlias(string $devAlias): self
  70. {
  71. $this->devAlias = $devAlias;
  72. return $this;
  73. }
  74. public function getPage(): ?string
  75. {
  76. return $this->page;
  77. }
  78. public function setPage(string $page): self
  79. {
  80. $this->page = $page;
  81. return $this;
  82. }
  83. public function getImage(): ?FileInterface
  84. {
  85. return $this->image;
  86. }
  87. public function setImage(?FileInterface $image): self
  88. {
  89. $this->image = $image;
  90. return $this;
  91. }
  92. }