Commit e31477ea by Damien Moulard

Fix bug creation prestataires avec contact depuis admin

parent e8a2e43d
...@@ -196,6 +196,9 @@ class Comptoir ...@@ -196,6 +196,9 @@ class Comptoir
*/ */
public function addContact(ContactComptoir $contact): self public function addContact(ContactComptoir $contact): self
{ {
if (is_null($this->contacts)) {
$this->contacts = new ArrayCollection();
}
if (!$this->contacts->contains($contact)) { if (!$this->contacts->contains($contact)) {
$this->contacts[] = $contact; $this->contacts[] = $contact;
$contact->setComptoir($this); $contact->setComptoir($this);
......
...@@ -473,6 +473,9 @@ class Prestataire ...@@ -473,6 +473,9 @@ class Prestataire
*/ */
public function addContact(ContactPrestataire $contact): self public function addContact(ContactPrestataire $contact): self
{ {
if (is_null($this->contacts)) {
$this->contacts = new ArrayCollection();
}
if (!$this->contacts->contains($contact)) { if (!$this->contacts->contains($contact)) {
$this->contacts[] = $contact; $this->contacts[] = $contact;
$contact->setPrestataire($this); $contact->setPrestataire($this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment