Skip to content

Commit fd6db01

Browse files
authored
Merge pull request #19 from ingrammicro/getItemByMPN-new-method
Release 14 changes
2 parents 7a423c5 + f4ba7d7 commit fd6db01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+516
-64
lines changed

phpunit.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,8 @@
5454
<file>tests/Unit/AssetTest.php</file>
5555
<file>tests/Unit/ContactInfoTest.php</file>
5656
</testsuite>
57+
<testsuite name="RequestStructure">
58+
<file>tests/Unit/RequestStructureTest.php</file>
59+
</testsuite>
5760
</testsuites>
5861
</phpunit>

src/ActivationTemplateResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;

src/ActivationTileResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;

src/Asset.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;
@@ -16,6 +16,7 @@ class Asset extends Model
1616
{
1717
public $id;
1818
public $external_id;
19+
public $external_uid;
1920

2021
/**
2122
* @var Product
@@ -56,10 +57,12 @@ public function getParameterByID($id)
5657
return ($param) ? $param : null;
5758
}
5859

60+
61+
5962
/**
60-
* Return a Param by ID
63+
* Return a Item by ID
6164
* @param $id
62-
* @return Param
65+
* @return Item
6366
*/
6467
public function getItemByID($id)
6568
{
@@ -69,4 +72,18 @@ public function getItemByID($id)
6972

7073
return ($item) ? $item : null;
7174
}
75+
76+
/**
77+
* Return a Item by MPN
78+
* @param $id
79+
* @return Item
80+
*/
81+
public function getItemByMPN($mpn)
82+
{
83+
$item = current(array_filter($this->items, function (Item $item) use ($mpn) {
84+
return ($item->mpn === $mpn);
85+
}));
86+
87+
return ($item) ? $item : null;
88+
}
7289
}

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;

src/Config/VaultConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect\Config;

src/ConfigException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;

src/ConfigPropertyMissed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;

src/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;
@@ -15,7 +15,7 @@
1515
class Connection extends Model
1616
{
1717
public $id;
18-
public $name;
18+
public $type;
1919

2020
/**
2121
* @var Provider

src/Contact.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
55
*
6-
* @copyright (c) 2018. Ingram Micro. All Rights Reserved.
6+
* @copyright (c) 2019. Ingram Micro. All Rights Reserved.
77
*/
88

99
namespace Connect;

0 commit comments

Comments
 (0)