xantxo coquillard 3 years ago
parent f7e226eb44
commit ab95de45a8

@ -2,6 +2,9 @@
namespace App\Component\Customer\Domain; namespace App\Component\Customer\Domain;
use App\Component\File\Domain\File;
use Doctrine\Common\Collections\Collection;
#[ORM\Entity, ORM\Table(name:"customers")] #[ORM\Entity, ORM\Table(name:"customers")]
class Customer class Customer
{ {
@ -42,6 +45,9 @@ class Customer
#[ORM\Column(type:Types::String, length:100)] #[ORM\Column(type:Types::String, length:100)]
private string $city; private string $city;
#[ORM\OneToMany(mappedBy:"customer", targetEntity: File::class)]
private Collection $files;
#[ORM\Column] #[ORM\Column]
public \DateTime $created; public \DateTime $created;

@ -2,6 +2,8 @@
namespace App\Component\File\Domain; namespace App\Component\File\Domain;
use App\Component\Customer\Domain\Customer;
#[ORM\Entity, ORM\Table(name:"files")] #[ORM\Entity, ORM\Table(name:"files")]
class File class File
{ {
@ -9,6 +11,9 @@ class File
#[ORM\Column(type:Types::INTEGER)] #[ORM\Column(type:Types::INTEGER)]
private int $id; private int $id;
#[ORM\ManyToOne(targetEntity: Customer::class, inversedBy:"files")]
private Customer $customer;
#[ORM\Column] #[ORM\Column]
public \DateTime $created; public \DateTime $created;

Loading…
Cancel
Save