/** * Helper method for setting the type * * @param AddressType|string $type * * @return $this */ public function addType($type) { if ($type instanceof AddressType) { $this->type = $type->getAddressType(); } else { $this->type = $type; } return $this; }