src/Entity/Contract.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContractRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table(name'contract')]
  6. #[ORM\Entity(repositoryClassContractRepository::class)]
  7. class Contract {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private ?int $id null;
  12.     #[ORM\Column(name'name'type'string'length255)]
  13.     private string $name;
  14.     #[ORM\Column(name'description'type'text'nullabletrue)]
  15.     private ?string $description;
  16.     public function getId(): ?int {
  17.         return $this->id;
  18.     }
  19.     public function setName(string $name): self {
  20.         $this->name $name;
  21.         return $this;
  22.     }
  23.     public function getName(): string {
  24.         return $this->name;
  25.     }
  26.     public function setDescription(?string $description): self {
  27.         $this->description $description;
  28.         return $this;
  29.     }
  30.     public function getDescription(): ?string {
  31.         return $this->description;
  32.     }
  33.     public function __toString(): string {
  34.         if ($this->description) {
  35.             // return sprintf('%s',
  36.             //     ucfirst($this->name)
  37.             // );
  38.             return $this->name;
  39.         }
  40.         return sprintf('%s'ucfirst($this->name));
  41.     }
  42. }