Last active
October 3, 2017 17:05
-
-
Save mlimaloureiro/65ddee94229774b9d01df951dcd8a0bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Uniplaces\AccommodationBundle\Domain\AccommodationProvider; | |
use Uniplaces\AccommodationBundle\Domain\AccommodationProvider\Id\AccommodationProviderId; | |
use Uniplaces\AccommodationBundle\Domain\AccommodationProvider\BasicInfo\AccommodationProviderBasicInfo; | |
use Uniplaces\AgencyBundle\Domain\Staff\Id\AgencyStaffId; | |
use Uniplaces\UserBundle\Domain\Account\Id\AccountId; | |
use Uniplaces\UserBundle\Domain\Authored\Person\AgencyStaffAuthored; | |
use Uniplaces\UserBundle\Domain\Authored\StandardizedAuthored; | |
use Uniplaces\UserBundle\Domain\User\Person\Person; | |
/** | |
* AccommodationProvider | |
*/ | |
class AccommodationProvider extends Person | |
{ | |
/** | |
* @var AccountId | |
*/ | |
protected $accountId; | |
/** | |
* @var AccommodationProviderBasicInfo | |
*/ | |
protected $basicInfo; | |
/** | |
* @var StandardizedAuthored | |
*/ | |
protected $created; | |
/** | |
* @param AccommodationProviderId $id | |
* @param AccountId $accountId | |
* @param AccommodationProviderBasicInfo $basicInfo | |
* @param AgencyStaffId $createdBy | |
*/ | |
public function __construct( | |
AccommodationProviderId $id, | |
AccountId $accountId, | |
AccommodationProviderBasicInfo $basicInfo, | |
AgencyStaffId $createdBy | |
) { | |
parent::__construct($id, $accountId); | |
$this->basicInfo = $basicInfo; | |
$this->created = StandardizedAuthored::fromUserId($createdBy); | |
} | |
/** | |
* @return AccommodationProviderId | |
*/ | |
public function id(): AccommodationProviderId | |
{ | |
return AccommodationProviderId::createFromString($this->id); | |
} | |
/** | |
* @return AccountId | |
*/ | |
public function accountId(): AccountId | |
{ | |
return $this->accountId; | |
} | |
/** | |
* @return AccommodationProviderBasicInfo | |
*/ | |
public function basicInfo(): AccommodationProviderBasicInfo | |
{ | |
return $this->basicInfo; | |
} | |
/** | |
* @return AgencyStaffAuthored | |
*/ | |
public function created(): AgencyStaffAuthored | |
{ | |
return AgencyStaffAuthored::fromStandardized($this->created); | |
} | |
/** | |
* @param AccommodationProviderBasicInfo $basicInfo | |
*/ | |
public function replaceBasicInfo(AccommodationProviderBasicInfo $basicInfo) | |
{ | |
$this->basicInfo = $basicInfo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment