Created
November 16, 2018 09:27
-
-
Save Karnak19/7752387be5c8c27e9d4815f07d4bec47 to your computer and use it in GitHub Desktop.
Quest 06 Symfony
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| /** | |
| * @ORM\Entity(repositoryClass="App\Repository\ArticleRepository") | |
| */ | |
| class Article | |
| { | |
| /** | |
| * @ORM\Id() | |
| * @ORM\GeneratedValue() | |
| * @ORM\Column(type="integer") | |
| */ | |
| private $id; | |
| /** | |
| * @ORM\Column(type="string", length=255) | |
| */ | |
| private $title; | |
| /** | |
| * @ORM\Column(type="text") | |
| */ | |
| private $content; | |
| /** | |
| * @ORM\ManyToOne(targetEntity="App\Entity\Category") | |
| * @ORM\JoinColumn(nullable=false) | |
| */ | |
| private $category; | |
| public function getId(): ?int | |
| { | |
| return $this->id; | |
| } | |
| public function getTitle(): ?string | |
| { | |
| return $this->title; | |
| } | |
| public function setTitle(string $title): self | |
| { | |
| $this->title = $title; | |
| return $this; | |
| } | |
| public function getContent(): ?string | |
| { | |
| return $this->content; | |
| } | |
| public function setContent(string $content): self | |
| { | |
| $this->content = $content; | |
| return $this; | |
| } | |
| public function getCategory(): ?Category | |
| { | |
| return $this->category; | |
| } | |
| public function setCategory(?Category $category): self | |
| { | |
| $this->category = $category; | |
| return $this; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment