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

27 行
463B

  1. <?php
  2. namespace Lc\SovBundle\Doctrine\Extension;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. trait SluggableTrait
  6. {
  7. #[Gedmo\Slug(fields: ['title'], unique: true)]
  8. #[ORM\Column(type: 'string', length: 255)]
  9. protected $slug;
  10. public function getSlug(): ?string
  11. {
  12. return $this->slug;
  13. }
  14. public function setSlug(?string $slug): self
  15. {
  16. $this->slug = $slug;
  17. return $this;
  18. }
  19. }