| @@ 28-50 (lines=23) @@ | ||
| 25 | /** |
|
| 26 | * @ORM\Entity(repositoryClass="Surfnet\StepupMiddleware\ApiBundle\Identity\Repository\InstitutionListingRepository") |
|
| 27 | */ |
|
| 28 | class InstitutionListing implements JsonSerializable |
|
| 29 | { |
|
| 30 | /** |
|
| 31 | * @ORM\Id |
|
| 32 | * @ORM\Column(type="institution") |
|
| 33 | * |
|
| 34 | * @var \Surfnet\Stepup\Identity\Value\Institution |
|
| 35 | */ |
|
| 36 | public $institution; |
|
| 37 | ||
| 38 | public static function createFrom(Institution $institution) |
|
| 39 | { |
|
| 40 | $instance = new self(); |
|
| 41 | $instance->institution = $institution; |
|
| 42 | ||
| 43 | return $instance; |
|
| 44 | } |
|
| 45 | ||
| 46 | public function jsonSerialize() |
|
| 47 | { |
|
| 48 | return ['name' => $this->institution]; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 28-50 (lines=23) @@ | ||
| 25 | /** |
|
| 26 | * @ORM\Entity(repositoryClass="Surfnet\StepupMiddleware\ApiBundle\Identity\Repository\WhitelistEntryRepository") |
|
| 27 | */ |
|
| 28 | class WhitelistEntry implements JsonSerializable |
|
| 29 | { |
|
| 30 | /** |
|
| 31 | * @ORM\Id |
|
| 32 | * @ORM\Column(type="institution") |
|
| 33 | * |
|
| 34 | * @var Institution |
|
| 35 | */ |
|
| 36 | public $institution; |
|
| 37 | ||
| 38 | public static function createFrom(Institution $institution) |
|
| 39 | { |
|
| 40 | $instance = new self(); |
|
| 41 | $instance->institution = $institution; |
|
| 42 | ||
| 43 | return $instance; |
|
| 44 | } |
|
| 45 | ||
| 46 | public function jsonSerialize() |
|
| 47 | { |
|
| 48 | return $this->institution; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||