create offerings and its migration

This commit is contained in:
Jannis Portmann 2021-04-24 17:36:38 +02:00
parent f3ad0e4638
commit 307954d46f
4 changed files with 223 additions and 0 deletions

93
src/Entity/Offering.php Normal file
View file

@ -0,0 +1,93 @@
<?php
namespace App\Entity;
use App\Repository\OfferingRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=OfferingRepository::class)
*/
class Offering
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="offerings")
* @ORM\JoinColumn(nullable=false)
*/
private $byUser;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $photoFilename;
public function getId(): ?int
{
return $this->id;
}
public function getByUser(): ?User
{
return $this->byUser;
}
public function setByUser(?User $byUser): self
{
$this->byUser = $byUser;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getPhotoFilename(): ?string
{
return $this->photoFilename;
}
public function setPhotoFilename(?string $photoFilename): self
{
$this->photoFilename = $photoFilename;
return $this;
}
}