| @@ 31-41 (lines=11) @@ | ||
| 28 | * |
|
| 29 | * @return string[] |
|
| 30 | */ |
|
| 31 | public function all($status='ACTIVE') |
|
| 32 | { |
|
| 33 | $ids = [$this->id]; |
|
| 34 | foreach ($this->data as $identifier) { |
|
| 35 | if (is_null($status) || $identifier->status == $status) { |
|
| 36 | $ids[] = $identifier->value; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | return $ids; |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * Get all active user identifiers of a given type, like 'BARCODE' or 'UNIV_ID'. |
|
| @@ 50-59 (lines=10) @@ | ||
| 47 | * |
|
| 48 | * @return null|string |
|
| 49 | */ |
|
| 50 | public function allOfType($value, $status = 'ACTIVE') |
|
| 51 | { |
|
| 52 | $ids = []; |
|
| 53 | foreach ($this->data as $identifier) { |
|
| 54 | if ($identifier->id_type->value == $value && (is_null($status) || $identifier->status == $status)) { |
|
| 55 | $ids[] = $identifier->value; |
|
| 56 | } |
|
| 57 | } |
|
| 58 | return $ids; |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * Get the first active user identifier of a given type, like 'BARCODE' or 'UNIV_ID'. |
|