Ejemplo n.º 1
0
 /**
  * @param Organization              $organization
  * @param UpdateOrganizationRequest $request
  */
 private function handleRequest($organization, $request)
 {
     $organization->setName($request->name())->setDescription($request->description());
     $mainAddress = $organization->addressById($request->addressId());
     if ($mainAddress) {
         $mainAddress->setLine1($request->line1())->setZipPostCode($request->zipPostCode())->setNumber($request->number())->setFloor($request->floor())->setDoor($request->door());
     } else {
         $organization->addAddress($this->buildAddress($request));
     }
 }
Ejemplo n.º 2
0
 /**
  * @param Organization $organization
  *
  * @return OrganizationFileResource
  */
 private function buildOrganizationResource(Organization $organization)
 {
     return new OrganizationFileResource($organization->id(), $organization->name(), $organization->description(), $this->buildOrganizationFileAddressResource($organization->addresses()));
 }
Ejemplo n.º 3
0
 public function __construct(Identity $identity, $name, $description, $address = null)
 {
     parent::__construct($identity, $name, $description, $address);
 }
 /**
  * @param Organization $organization
  *
  * @return OrganizationForListResource
  */
 private function buildOrganizationResource(Organization $organization)
 {
     return new OrganizationForListResource($organization->id(), $organization->name(), $organization->creationDate());
 }