| @@ 27-72 (lines=46) @@ | ||
| 24 | use Surfnet\Stepup\Configuration\Value\InstitutionOption; |
|
| 25 | use Surfnet\Stepup\Configuration\Value\InstitutionRole; |
|
| 26 | ||
| 27 | final class SelectRaaOptionChangedEvent implements SerializableInterface |
|
| 28 | { |
|
| 29 | /** |
|
| 30 | * @var InstitutionConfigurationId |
|
| 31 | */ |
|
| 32 | public $institutionConfigurationId; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @var Institution |
|
| 36 | */ |
|
| 37 | public $institution; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @var InstitutionOption |
|
| 41 | */ |
|
| 42 | public $selectRaaOption; |
|
| 43 | ||
| 44 | public function __construct( |
|
| 45 | InstitutionConfigurationId $institutionConfigurationId, |
|
| 46 | Institution $institution, |
|
| 47 | InstitutionOption $selectRaaOption |
|
| 48 | ) { |
|
| 49 | $this->institutionConfigurationId = $institutionConfigurationId; |
|
| 50 | $this->institution = $institution; |
|
| 51 | $this->selectRaaOption = $selectRaaOption; |
|
| 52 | } |
|
| 53 | ||
| 54 | public static function deserialize(array $data) |
|
| 55 | { |
|
| 56 | $institution = new Institution($data['institution']); |
|
| 57 | return new self( |
|
| 58 | new InstitutionConfigurationId($data['institution_configuration_id']), |
|
| 59 | $institution, |
|
| 60 | InstitutionOption::fromInstitutionConfig(InstitutionRole::useRaa(), $institution, $data['select_raa_option']) |
|
| 61 | ); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function serialize() |
|
| 65 | { |
|
| 66 | return [ |
|
| 67 | 'institution_configuration_id' => $this->institutionConfigurationId->getInstitutionConfigurationId(), |
|
| 68 | 'institution' => $this->institution->getInstitution(), |
|
| 69 | 'select_raa_option' => $this->selectRaaOption->getInstitutionSet()->getInstitutions(), |
|
| 70 | ]; |
|
| 71 | } |
|
| 72 | } |
|
| 73 | ||
| @@ 27-72 (lines=46) @@ | ||
| 24 | use Surfnet\Stepup\Configuration\Value\InstitutionOption; |
|
| 25 | use Surfnet\Stepup\Configuration\Value\InstitutionRole; |
|
| 26 | ||
| 27 | final class UseRaaOptionChangedEvent implements SerializableInterface |
|
| 28 | { |
|
| 29 | /** |
|
| 30 | * @var InstitutionConfigurationId |
|
| 31 | */ |
|
| 32 | public $institutionConfigurationId; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @var Institution |
|
| 36 | */ |
|
| 37 | public $institution; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @var InstitutionOption |
|
| 41 | */ |
|
| 42 | public $useRaaOption; |
|
| 43 | ||
| 44 | public function __construct( |
|
| 45 | InstitutionConfigurationId $institutionConfigurationId, |
|
| 46 | Institution $institution, |
|
| 47 | InstitutionOption $useRaaOption |
|
| 48 | ) { |
|
| 49 | $this->institutionConfigurationId = $institutionConfigurationId; |
|
| 50 | $this->institution = $institution; |
|
| 51 | $this->useRaaOption = $useRaaOption; |
|
| 52 | } |
|
| 53 | ||
| 54 | public static function deserialize(array $data) |
|
| 55 | { |
|
| 56 | $institution = new Institution($data['institution']); |
|
| 57 | return new self( |
|
| 58 | new InstitutionConfigurationId($data['institution_configuration_id']), |
|
| 59 | $institution, |
|
| 60 | InstitutionOption::fromInstitutionConfig(InstitutionRole::useRaa(), $institution, $data['use_raa_option']) |
|
| 61 | ); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function serialize() |
|
| 65 | { |
|
| 66 | return [ |
|
| 67 | 'institution_configuration_id' => $this->institutionConfigurationId->getInstitutionConfigurationId(), |
|
| 68 | 'institution' => $this->institution->getInstitution(), |
|
| 69 | 'use_raa_option' => $this->useRaaOption->getInstitutionSet()->getInstitutions(), |
|
| 70 | ]; |
|
| 71 | } |
|
| 72 | } |
|
| 73 | ||
| @@ 28-73 (lines=46) @@ | ||
| 25 | use Surfnet\Stepup\Configuration\Value\InstitutionRole; |
|
| 26 | use Surfnet\Stepup\Configuration\Value\InstitutionSet; |
|
| 27 | ||
| 28 | final class UseRaOptionChangedEvent implements SerializableInterface |
|
| 29 | { |
|
| 30 | /** |
|
| 31 | * @var InstitutionConfigurationId |
|
| 32 | */ |
|
| 33 | public $institutionConfigurationId; |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @var Institution |
|
| 37 | */ |
|
| 38 | public $institution; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @var InstitutionOption |
|
| 42 | */ |
|
| 43 | public $useRaOption; |
|
| 44 | ||
| 45 | public function __construct( |
|
| 46 | InstitutionConfigurationId $institutionConfigurationId, |
|
| 47 | Institution $institution, |
|
| 48 | InstitutionOption $useRaOption |
|
| 49 | ) { |
|
| 50 | $this->institutionConfigurationId = $institutionConfigurationId; |
|
| 51 | $this->institution = $institution; |
|
| 52 | $this->useRaOption = $useRaOption; |
|
| 53 | } |
|
| 54 | ||
| 55 | public static function deserialize(array $data) |
|
| 56 | { |
|
| 57 | $institution = new Institution($data['institution']); |
|
| 58 | return new self( |
|
| 59 | new InstitutionConfigurationId($data['institution_configuration_id']), |
|
| 60 | $institution, |
|
| 61 | InstitutionOption::fromInstitutionConfig(InstitutionRole::useRa(), $institution, $data['use_ra_option']) |
|
| 62 | ); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function serialize() |
|
| 66 | { |
|
| 67 | return [ |
|
| 68 | 'institution_configuration_id' => $this->institutionConfigurationId->getInstitutionConfigurationId(), |
|
| 69 | 'institution' => $this->institution->getInstitution(), |
|
| 70 | 'use_ra_option' => $this->useRaOption->getInstitutionSet()->getInstitutions(), |
|
| 71 | ]; |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||