commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Common
BaseAddressCollection.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Common
;
10
11
use
Commercetools\Base\MapperSequence
;
12
use
Commercetools\Exception\InvalidArgumentException
;
13
use stdClass;
14
25
class
BaseAddressCollection
extends
MapperSequence
26
{
34
public
function
add
($value)
35
{
36
if
(!$value instanceof
BaseAddress
) {
37
throw
new
InvalidArgumentException
();
38
}
39
$this->
store
($value);
40
41
return
$this;
42
}
43
47
protected
function
mapper
()
48
{
49
return
function
(?
int
$index): ?
BaseAddress
{
50
$data = $this->
get
($index);
51
if
($data instanceof stdClass) {
53
$data =
BaseAddressModel::of
($data);
54
$this->
set
($data, $index);
55
}
56
57
return
$data;
58
};
59
}
60
}
Commercetools\Api\Models\Common\BaseAddressCollection
Definition:
BaseAddressCollection.php:26
Commercetools\Api\Models\Common\BaseAddressCollection\add
add($value)
Definition:
BaseAddressCollection.php:34
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\MapperSequence
Definition:
MapperSequence.php:19
Commercetools\Base\MapperSequence\store
store($value)
Definition:
MapperSequence.php:106
Commercetools\Base\MapperSequence\mapper
mapper()
Commercetools\Exception\InvalidArgumentException
Definition:
InvalidArgumentException.php:15
Commercetools\Api\Models\Common\BaseAddress
Definition:
BaseAddress.php:15
Commercetools\Api\Models\Common
Definition:
Address.php:9
Generated by
1.9.1