src/Entity/Service.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by simpson <simpsonwork@gmail.com>
  4.  * Date: 2019-03-19
  5.  * Time: 17:50
  6.  */
  7. namespace App\Entity;
  8. use AngelGamez\TranslatableBundle\Entity\TranslatableValue;
  9. //use ApiPlatform\Core\Annotation\ApiResource;
  10. use App\Repository\ServiceRepository;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. use Doctrine\ORM\Mapping as ORM;
  13. #[ORM\Table(name'services')]
  14. #[ORM\Entity(repositoryClassServiceRepository::class)]
  15. #[ORM\Cache(usage'NONSTRICT_READ_WRITE'region'profiles')]
  16. class Service
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\Column(name'id'type'smallint')]
  20.     #[ORM\GeneratedValue(strategy'AUTO')]
  21.     #[Groups('profile')]
  22.     protected int $id;
  23.     #[ORM\Column(name'`group`'type'smallint')]
  24.     protected int $group;
  25.     #[ORM\Column(name'name'type'translatable')]
  26.     #[Groups('profile')]
  27.     protected TranslatableValue $name;
  28.     #[ORM\Column(name'uri_identity'type'string'length128)]
  29.     #[Groups('profile')]
  30.     protected string $uriIdentity;
  31.     #[ORM\Column(name'sort'type'smallint')]
  32.     protected int $sort;
  33.     public function __construct(TranslatableValue $namestring $uriIdentityint $groupint $sort)
  34.     {
  35.         $this->group $group;
  36.         $this->name $name;
  37.         $this->uriIdentity $uriIdentity;
  38.         $this->sort $sort;
  39.     }
  40.     public function getId(): int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getGroup(): int
  45.     {
  46.         return $this->group;
  47.     }
  48.     public function getName(): TranslatableValue
  49.     {
  50.         return $this->name;
  51.     }
  52.     public function getUriIdentity(): string
  53.     {
  54.         return $this->uriIdentity;
  55.     }
  56.     public function sync(TranslatableValue $nameint $groupint $sort): void
  57.     {
  58.         $this->name $name;
  59.         $this->group $group;
  60.         $this->sort $sort;
  61.     }
  62. }