| @@ 57-65 (lines=9) @@ | ||
| 54 | * |
|
| 55 | * @return Contact|null |
|
| 56 | */ |
|
| 57 | public function createContact($email, $firstName, $lastName, $orgid = null, $phone = null) |
|
| 58 | { |
|
| 59 | $contacts = $this->transformCollection( |
|
| 60 | $this->post('contacts', ['json' => ['contact' => compact('email', 'firstName', 'lastName', 'orgid', 'phone')]]), |
|
| 61 | Contact::class |
|
| 62 | ); |
|
| 63 | ||
| 64 | return array_shift($contacts); |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * Find or create a contact. |
|
| @@ 78-87 (lines=10) @@ | ||
| 75 | * |
|
| 76 | * @return Contact |
|
| 77 | */ |
|
| 78 | public function findOrCreateContact($email, $firstName, $lastName, $orgid = null, $phone = null) |
|
| 79 | { |
|
| 80 | $contacts = $this->transformCollection( |
|
| 81 | $this->post('contact/sync', ['json' => ['contact' => compact('email', 'firstName', 'lastName', 'orgid', 'phone')]]), |
|
| 82 | Contact::class |
|
| 83 | ); |
|
| 84 | ||
| 85 | return array_shift($contacts); |
|
| 86 | ||
| 87 | } |
|
| 88 | ||
| 89 | ||
| 90 | /** |
|