| @@ 34-43 (lines=10) @@ | ||
| 31 | * |
|
| 32 | * @return Contact|null |
|
| 33 | */ |
|
| 34 | public function findContact($email) |
|
| 35 | { |
|
| 36 | $contacts = $this->transformCollection( |
|
| 37 | $this->get('contacts', ['query' => ['email' => $email]]), |
|
| 38 | Contact::class, |
|
| 39 | 'contacts' |
|
| 40 | ); |
|
| 41 | ||
| 42 | return array_shift($contacts); |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * Find contact by ID. |
|
| @@ 52-61 (lines=10) @@ | ||
| 49 | * |
|
| 50 | * @return Contact|null |
|
| 51 | */ |
|
| 52 | public function findContactById($id) |
|
| 53 | { |
|
| 54 | $contacts = $this->transformCollection( |
|
| 55 | $this->get('contacts', ['query' => ['id' => $id]]), |
|
| 56 | Contact::class, |
|
| 57 | 'contacts' |
|
| 58 | ); |
|
| 59 | ||
| 60 | return array_shift($contacts); |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * Create new contact. |
|