From 49812d43c4fe1ef69750a6c4fce139768a4c707b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 23 May 2018 12:46:25 +0200 Subject: [PATCH] add a method to duplicate address --- Entity/Address.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Entity/Address.php b/Entity/Address.php index 792535a17..49951e48f 100644 --- a/Entity/Address.php +++ b/Entity/Address.php @@ -141,6 +141,15 @@ class Address return $this; } + public static function createFromAddress(Address $original) : Address + { + return (new Address()) + ->setPostcode($original->getPostcode()) + ->setStreetAddress1($original->getStreetAddress1()) + ->setStreetAddress2($original->getStreetAddress2()) + ->setValidFrom($original->getValidFrom()) + ; + } }