src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/InstitutionListingCollection.php 1 location
|
@@ 23-44 (lines=22) @@
|
| 20 |
|
|
| 21 |
|
use Surfnet\StepupMiddlewareClientBundle\Dto\CollectionDto; |
| 22 |
|
|
| 23 |
|
class InstitutionListingCollection extends CollectionDto |
| 24 |
|
{ |
| 25 |
|
public static function fromData(array $data) |
| 26 |
|
{ |
| 27 |
|
$elements = []; |
| 28 |
|
foreach ($data as $item) { |
| 29 |
|
$elements[] = static::createElementFromData($item); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
return new static( |
| 33 |
|
$elements, |
| 34 |
|
count($elements), |
| 35 |
|
1, |
| 36 |
|
count($elements) |
| 37 |
|
); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
protected static function createElementFromData(array $item) |
| 41 |
|
{ |
| 42 |
|
return InstitutionListing::fromData($item); |
| 43 |
|
} |
| 44 |
|
} |
| 45 |
|
|
src/Surfnet/StepupMiddlewareClientBundle/Identity/Dto/RaCandidateInstitutionCollection.php 1 location
|
@@ 23-44 (lines=22) @@
|
| 20 |
|
|
| 21 |
|
use Surfnet\StepupMiddlewareClientBundle\Dto\CollectionDto; |
| 22 |
|
|
| 23 |
|
class RaCandidateInstitutionCollection extends CollectionDto |
| 24 |
|
{ |
| 25 |
|
public static function fromData(array $data) |
| 26 |
|
{ |
| 27 |
|
$elements = []; |
| 28 |
|
foreach ($data as $item) { |
| 29 |
|
$elements[] = static::createElementFromData($item); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
return new static( |
| 33 |
|
$elements, |
| 34 |
|
count($elements), |
| 35 |
|
1, |
| 36 |
|
count($elements) |
| 37 |
|
); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
protected static function createElementFromData(array $item) |
| 41 |
|
{ |
| 42 |
|
return RaCandidateInstitution::fromData($item); |
| 43 |
|
} |
| 44 |
|
} |
| 45 |
|
|