Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit a685541

Browse files
author
Marco Roßdeutscher
committed
Merge branch 'release/v0.3.2'
2 parents bb35ccc + ed3a028 commit a685541

File tree

4 files changed

+173
-9
lines changed

4 files changed

+173
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
closeio-api-wrapper
22
===================
33

4-
PHP Wrapper to use the Close.io API
4+
PHP Wrapper to use the Close.io API
55

66
[![License](https://img.shields.io/packagist/l/loopline-systems/closeio-api-wrapper.svg)](http://opensource.org/licenses/MIT)
77
[![Build Status](http://img.shields.io/travis/loopline-systems/closeio-api-wrapper.svg)](https://travis-ci.org/loopline-systems/closeio-api-wrapper)
@@ -20,7 +20,7 @@ Require via [Composer](https://github.com/composer/composer)<br />
2020
```bash
2121
{
2222
"require": {
23-
"loopline-systems/closeio-api-wrapper": "0.1.0"
23+
"loopline-systems/closeio-api-wrapper": "0.3.2"
2424
}
2525
}
2626
```

src/LooplineSystems/CloseIoApiWrapper/Model/Opportunity.php

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,26 @@ class Opportunity implements \JsonSerializable
137137
*/
138138
private $value;
139139

140+
/**
141+
* @var string
142+
*/
143+
private $value_currency;
144+
145+
/**
146+
* @var string
147+
*/
148+
private $contact_name;
149+
150+
/**
151+
* @var string
152+
*/
153+
private $value_formatted;
154+
155+
/**
156+
* @var array
157+
*/
158+
private $integration_links = [];
159+
140160
/**
141161
* @param array $data
142162
*/
@@ -569,4 +589,80 @@ public function setValue($value)
569589

570590
return $this;
571591
}
592+
593+
/**
594+
* @return string
595+
*/
596+
public function getValueCurrency()
597+
{
598+
return $this->value_currency;
599+
}
600+
601+
/**
602+
* @param string $value_currency
603+
* @return $this
604+
*/
605+
public function setValueCurrency($value_currency)
606+
{
607+
$this->value_currency = $value_currency;
608+
609+
return $this;
610+
}
611+
612+
/**
613+
* @return string
614+
*/
615+
public function getContactName()
616+
{
617+
return $this->contact_name;
618+
}
619+
620+
/**
621+
* @param string $contact_name
622+
* @return $this
623+
*/
624+
public function setContactName($contact_name)
625+
{
626+
$this->contact_name = $contact_name;
627+
628+
return $this;
629+
}
630+
631+
/**
632+
* @return string
633+
*/
634+
public function getValueFormatted()
635+
{
636+
return $this->value_formatted;
637+
}
638+
639+
/**
640+
* @param string $value_formatted
641+
* @return $this
642+
*/
643+
public function setValueFormatted($value_formatted)
644+
{
645+
$this->value_formatted = $value_formatted;
646+
647+
return $this;
648+
}
649+
650+
/**
651+
* @return array
652+
*/
653+
public function getIntegrationLinks()
654+
{
655+
return $this->integration_links;
656+
}
657+
658+
/**
659+
* @param array $integration_links
660+
* @return $this
661+
*/
662+
public function setIntegrationLinks($integration_links)
663+
{
664+
$this->integration_links = $integration_links;
665+
666+
return $this;
667+
}
572668
}

src/LooplineSystems/CloseIoApiWrapper/Model/Task.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,22 @@ class Task implements \JsonSerializable
9191
* @var string
9292
*/
9393
private $lead_id;
94+
9495
/**
9596
* @var string
9697
*/
9798
private $date_created;
9899

100+
/**
101+
* @var string
102+
*/
103+
private $date;
104+
105+
/**
106+
* @var string
107+
*/
108+
private $view;
109+
99110
/**
100111
* @param array $data
101112
*/
@@ -409,4 +420,42 @@ public function setDateCreated($date_created)
409420

410421
return $this;
411422
}
423+
424+
/**
425+
* @return string
426+
*/
427+
public function getDate()
428+
{
429+
return $this->date;
430+
}
431+
432+
/**
433+
* @param string $date
434+
* @return $this
435+
*/
436+
public function setDate($date)
437+
{
438+
$this->date = $date;
439+
440+
return $this;
441+
}
442+
443+
/**
444+
* @return string
445+
*/
446+
public function getView()
447+
{
448+
return $this->view;
449+
}
450+
451+
/**
452+
* @param string $view
453+
* @return $this
454+
*/
455+
public function setView($view)
456+
{
457+
$this->view = $view;
458+
459+
return $this;
460+
}
412461
}

tests/LooplineSystems/CloseIoApi/Api/LeadTest.php

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
namespace LooplineSystems\CloseIoApiWrapper\Tests;
1111

12+
use LooplineSystems\CloseIoApiWrapper\Model\Address;
13+
use LooplineSystems\CloseIoApiWrapper\Model\Contact;
1214
use LooplineSystems\CloseIoApiWrapper\Model\Email;
1315
use LooplineSystems\CloseIoApiWrapper\Model\Lead;
1416
use LooplineSystems\CloseIoApiWrapper\Model\Opportunity;
@@ -51,31 +53,44 @@ public function testCreateDynamicLead($data)
5153
$tasks[] = new Task($task);
5254
}
5355

56+
$opportunities = [];
57+
foreach ($data['opportunities'] as $opportunity) {
58+
$opportunities[] = new Opportunity($opportunity);
59+
}
60+
61+
$addresses = [];
62+
foreach ($data['addresses'] as $address) {
63+
$addresses[] = new Address($address);
64+
}
65+
66+
$contacts = [];
67+
foreach ($data['contacts'] as $contact) {
68+
$contacts[] = new Contact($contact);
69+
}
70+
71+
5472
$dynamicLead->setId($data['id']);
5573
$dynamicLead->setStatusId($data['status_id']);
5674
$dynamicLead->setStatusLabel($data['status_label']);
5775
$dynamicLead->setDescription($data['description']);
5876
$dynamicLead->setDisplayName($data['display_name']);
59-
$dynamicLead->setAddresses($data['addresses']);
77+
$dynamicLead->setAddresses($addresses);
6078
$dynamicLead->setOrganization($data['organization']);
6179
$dynamicLead->setCreatedBy($data['created_by']);
6280
$dynamicLead->setUrl($data['url']);
6381
$dynamicLead->setTasks($tasks);
6482
$dynamicLead->setName($data['name']);
65-
$dynamicLead->setContacts($data['contacts']);
83+
$dynamicLead->setContacts($contacts);
6684
$dynamicLead->setDateCreated($data['date_created']);
6785
$dynamicLead->setCustom($data['custom']);
6886
$dynamicLead->setUpdatedByName($data['updated_by_name']);
6987
$dynamicLead->setCreatedByName($data['created_by_name']);
70-
$dynamicLead->setOpportunities($data['opportunities']);
88+
$dynamicLead->setOpportunities($opportunities);
7189
$dynamicLead->setHtmlUrl($data['html_url']);
7290
$dynamicLead->setUpdatedBy($data['updated_by']);
7391
$dynamicLead->setDateUpdated($data['date_updated']);
7492
$dynamicLead->setOrganizationId($data['organization_id']);
7593

76-
$dynamicLead = json_decode(json_encode($dynamicLead));
77-
$hydratedLead = json_decode(json_encode($hydratedLead));
78-
7994
$this->assertTrue($hydratedLead == $dynamicLead);
8095
}
8196

@@ -215,7 +230,11 @@ public function fullLeadProvider()
215230
'organization_id' => 'llk3j4lkjkla',
216231
'lead_id' => '32lkjsdalfkj34lkj',
217232
'status_label' => Opportunity::OPPORTUNITY_STATUS_WON,
218-
'value' => '42342'
233+
'value' => '42342',
234+
"value_currency" => "USD",
235+
"contact_name" => 'name',
236+
"value_formatted" => "$500",
237+
"integration_links" => [],
219238
]
220239
],
221240
'html_url' => 'test.com',

0 commit comments

Comments
 (0)