|
|
@@ -135,6 +135,7 @@ class AdminController extends EasyAdminController |
|
|
|
public function updateEntity($entity) |
|
|
|
{ |
|
|
|
$this->setUpdated($entity); |
|
|
|
$this->setAddressCreatedBy($entity) ; |
|
|
|
parent::updateEntity($entity); |
|
|
|
} |
|
|
|
|
|
|
@@ -170,30 +171,33 @@ class AdminController extends EasyAdminController |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (method_exists($entity, 'setCreatedBy')) { |
|
|
|
$entity->setCreatedBy($this->security->getUser()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (method_exists($entity, 'getAddress') && $entity->getAddress()) { |
|
|
|
$entity->getAddress()->setCreatedBy($this->security->getUser()); |
|
|
|
$entity->getAddress()->setCreatedAt(new \DateTime()); |
|
|
|
} |
|
|
|
|
|
|
|
if (method_exists($entity, 'getAddresses') |
|
|
|
&& $entity->getAddresses() && count($entity->getAddresses()) > 0) { |
|
|
|
foreach($entity->getAddresses() as $address) { |
|
|
|
$address->setCreatedBy($this->security->getUser()) ; |
|
|
|
$address->setCreatedAt(new \DateTime()) ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$this->setUpdated($entity); |
|
|
|
$this->setAddressCreatedBy($entity) ; |
|
|
|
|
|
|
|
parent::persistEntity($entity); |
|
|
|
} |
|
|
|
|
|
|
|
public function setAddressCreatedBy($entity) |
|
|
|
{ |
|
|
|
if (method_exists($entity, 'getAddress') && $entity->getAddress()) { |
|
|
|
$entity->getAddress()->setCreatedBy($this->security->getUser()); |
|
|
|
$entity->getAddress()->setCreatedAt(new \DateTime()); |
|
|
|
} |
|
|
|
|
|
|
|
if (method_exists($entity, 'getAddresses') |
|
|
|
&& $entity->getAddresses() && count($entity->getAddresses()) > 0) { |
|
|
|
foreach($entity->getAddresses() as $address) { |
|
|
|
$address->setCreatedBy($this->security->getUser()) ; |
|
|
|
$address->setCreatedAt(new \DateTime()) ; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function setUpdated($entity) |
|
|
|
{ |
|
|
|
|