src/Entity/Geographical/Country.php line 37
<?php/** This file is part of the Pellipop project.** (c) Mobizel** For the full copyright and license information, please view the LICENSE* file that was distributed with this source code.*/declare(strict_types=1);namespace App\Entity\Geographical;use App\Entity\IdentifiableTrait;use App\Repository\Geographical\CountryRepository;use Doctrine\ORM\Mapping as ORM;use Sylius\Component\Resource\Annotation\SyliusCrudRoutes;use Sylius\Component\Resource\Model\ResourceInterface;use Symfony\Component\Intl\Countries as IntlCountries;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CountryRepository::class)]#[ORM\Table(name: 'app_country')]#[SyliusCrudRoutes(alias: 'app.country', path: '/admin/countrys', section: 'backend', redirect: 'update', templates: 'backend/crud', grid: 'app_backend_country', except: ['show'], vars: ['all' => ['subheader' => 'app.ui.manage_your_countrys','templates' => ['form' => 'backend/country/_form.html.twig',],],'index' => ['icon' => 'world',],])]class Country implements ResourceInterface{use IdentifiableTrait;#[ORM\Column(type: 'string', length: 2)]#[Assert\NotBlank]private ?string $code = null;#[ORM\Column(type: 'boolean')]private bool $enabled = true;#[ORM\Column(type: 'integer')]#[Assert\NotBlank, Assert\PositiveOrZero]private int $shippingFees = 0;/*** Get the value of code** @return ?string*/public function getCode(): ?string{return $this->code;}/*** Set the value of code** @return self*/public function setCode($code): self{$this->code = $code;return $this;}/*** Get the value of enabled** @return bool*/public function getEnabled(): bool{return $this->enabled;}/*** Set the value of enabled** @return self*/public function setEnabled($enabled): self{$this->enabled = $enabled;return $this;}/*** Get the value of shippingFees** @return int*/public function getShippingFees(): int{return $this->shippingFees;}/*** Set the value of shippingFees** @return self*/public function setShippingFees($shippingFees): self{$this->shippingFees = $shippingFees;return $this;}/*** Get name** @return ?string*/public function getName(?string $locale = null): ?string{return IntlCountries::getName($this->code, $locale);}/*** Get name** @return string*/public function __toString(): string{return (string) ($this->getName() ?? $this->getCode());}}