xantxo coquillard 3 years ago
parent f7e226eb44
commit ab95de45a8

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

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

Loading…
Cancel
Save