commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Commercetools\Base\MapperMap Class Reference
Inheritance diagram for Commercetools\Base\MapperMap:
Commercetools\Base\CMap Commercetools\Base\CMap Commercetools\Base\Collection Commercetools\Base\Collection Commercetools\Api\Models\Common\LocalizedStringBuilder Commercetools\Api\Models\Common\LocalizedStringBuilder Commercetools\Api\Models\Common\LocalizedStringModel Commercetools\Api\Models\Product\CategoryOrderHintsBuilder Commercetools\Api\Models\Product\CategoryOrderHintsBuilder Commercetools\Api\Models\Product\CategoryOrderHintsModel Commercetools\Api\Models\Product\ProductVariantChannelAvailabilityMapBuilder Commercetools\Api\Models\Product\ProductVariantChannelAvailabilityMapBuilder Commercetools\Api\Models\Product\ProductVariantChannelAvailabilityMapModel Commercetools\Api\Models\Product\SearchKeywordsBuilder Commercetools\Api\Models\Product\SearchKeywordsBuilder Commercetools\Api\Models\Product\SearchKeywordsModel Commercetools\Api\Models\Type\FieldContainerBuilder Commercetools\Api\Models\Type\FieldContainerBuilder Commercetools\Api\Models\Type\FieldContainerModel Commercetools\History\Models\Common\LocalizedStringBuilder Commercetools\History\Models\Common\LocalizedStringBuilder Commercetools\History\Models\Common\LocalizedStringModel Commercetools\Import\Models\Common\LocalizedStringBuilder Commercetools\Import\Models\Common\LocalizedStringBuilder Commercetools\Import\Models\Common\LocalizedStringModel Commercetools\Import\Models\Customfields\FieldContainerBuilder Commercetools\Import\Models\Customfields\FieldContainerBuilder Commercetools\Import\Models\Customfields\FieldContainerModel

Public Member Functions

 __construct (array $data=null)
 
 toArray ()
 
 jsonSerialize ()
 
 put (string $key, $value)
 
 at (string $key)
 
 with (string $key, callable $callable=null)
 
 getIterator ()
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 

Static Public Member Functions

static of ($data=null)
 
static fromStdClass (stdClass $data=null)
 
static fromArray (array $data)
 

Protected Member Functions

 index ($data)
 
 get (string $key)
 
 set ($data, string $key)
 
 store (string $key, $value)
 
 mapper ()
 
 addToIndex (string $field, string $key, string $indexKey)
 
 valueByKey (string $field, string $key)
 

Detailed Description

@template TObject <TObject>

Definition at line 18 of file MapperMap.php.

Constructor & Destructor Documentation

◆ __construct()

Commercetools\Base\MapperMap::__construct ( array  $data = null)
final

@psalm-param ?array<string, TObject|stdClass> $data

Parameters
array | null$data

Definition at line 31 of file MapperMap.php.

Member Function Documentation

◆ addToIndex()

Commercetools\Base\MapperMap::addToIndex ( string  $field,
string  $key,
string  $indexKey 
)
finalprotected

@psalm-param TObject|stdClass $value

Definition at line 171 of file MapperMap.php.

◆ at()

Commercetools\Base\MapperMap::at ( string  $key)

@psalm-return ?TObject

Implements Commercetools\Base\CMap.

Definition at line 145 of file MapperMap.php.

◆ current()

Commercetools\Base\MapperMap::current ( )
Returns
?TObject

@psalm-var ?TObject

Implements Commercetools\Base\CMap.

Definition at line 200 of file MapperMap.php.

◆ fromArray()

static Commercetools\Base\MapperMap::fromArray ( array  $data)
staticfinal

@template T @psalm-param array<string, T|stdClass> $data

Returns
static

Implements Commercetools\Base\CMap.

Definition at line 87 of file MapperMap.php.

◆ fromStdClass()

static Commercetools\Base\MapperMap::fromStdClass ( stdClass  $data = null)
staticfinal

@psalm-param ?stdClass $data @psalm-return static

@psalm-var array<string, TObject|stdClass> $t

Implements Commercetools\Base\CMap.

Definition at line 75 of file MapperMap.php.

◆ get()

Commercetools\Base\MapperMap::get ( string  $key)
finalprotected

@psalm-return TObject|stdClass|null

Definition at line 102 of file MapperMap.php.

◆ getIterator()

Commercetools\Base\MapperMap::getIterator ( )

Implements Commercetools\Base\CMap.

Definition at line 184 of file MapperMap.php.

◆ index()

Commercetools\Base\MapperMap::index (   $data)
protected
Parameters
mixed$data

Definition at line 95 of file MapperMap.php.

◆ jsonSerialize()

Commercetools\Base\MapperMap::jsonSerialize ( )

@psalm-return array<string, stdClass|mixed>

Implements Commercetools\Base\CMap.

Definition at line 66 of file MapperMap.php.

◆ key()

Commercetools\Base\MapperMap::key ( )
Returns
string

@psalm-var string

Implements Commercetools\Base\CMap.

Definition at line 217 of file MapperMap.php.

◆ mapper()

Commercetools\Base\MapperMap::mapper ( )
abstractprotected

◆ next()

Commercetools\Base\MapperMap::next ( )
Returns
void

Implements Commercetools\Base\CMap.

Definition at line 209 of file MapperMap.php.

◆ of()

static Commercetools\Base\MapperMap::of (   $data = null)
staticfinal

@template T @psalm-param ?stdClass|array<string, T|stdClass> $data

Returns
static

@psalm-var stdClass $data)

Implements Commercetools\Base\CMap.

Definition at line 45 of file MapperMap.php.

◆ offsetExists()

Commercetools\Base\MapperMap::offsetExists (   $offset)
Parameters
string$offset
Returns
bool

Implements Commercetools\Base\CMap.

Definition at line 243 of file MapperMap.php.

◆ offsetGet()

Commercetools\Base\MapperMap::offsetGet (   $offset)
Parameters
string$offset
Returns
?TObject

Implements Commercetools\Base\CMap.

Definition at line 252 of file MapperMap.php.

◆ offsetSet()

Commercetools\Base\MapperMap::offsetSet (   $offset,
  $value 
)
Parameters
string$offset@psalm-param TObject|stdClass $value
mixed$value
Returns
void

Implements Commercetools\Base\CMap.

Definition at line 263 of file MapperMap.php.

◆ offsetUnset()

Commercetools\Base\MapperMap::offsetUnset (   $offset)
Parameters
string$offset
Returns
void

@psalm-suppress PossiblyNullArrayAccess

Implements Commercetools\Base\CMap.

Definition at line 272 of file MapperMap.php.

◆ put()

Commercetools\Base\MapperMap::put ( string  $key,
  $value 
)

@psalm-param TObject|stdClass $value

Parameters
$value
Returns
$this

Implements Commercetools\Base\CMap.

Definition at line 123 of file MapperMap.php.

◆ rewind()

Commercetools\Base\MapperMap::rewind ( )
Returns
void

Implements Commercetools\Base\CMap.

Definition at line 234 of file MapperMap.php.

◆ set()

Commercetools\Base\MapperMap::set (   $data,
string  $key 
)
finalprotected

@psalm-param TObject|stdClass $data

Definition at line 113 of file MapperMap.php.

◆ store()

Commercetools\Base\MapperMap::store ( string  $key,
  $value 
)
finalprotected

@psalm-param TObject|stdClass $value

Parameters
string$key
$value
Returns
$this

Definition at line 134 of file MapperMap.php.

◆ toArray()

Commercetools\Base\MapperMap::toArray ( )

@psalm-return array<string, stdClass|mixed>

Implements Commercetools\Base\CMap.

Definition at line 57 of file MapperMap.php.

◆ valid()

Commercetools\Base\MapperMap::valid ( )
Returns
bool

Implements Commercetools\Base\CMap.

Definition at line 226 of file MapperMap.php.

◆ valueByKey()

Commercetools\Base\MapperMap::valueByKey ( string  $field,
string  $key 
)
finalprotected

@psalm-return ?TObject

Definition at line 179 of file MapperMap.php.

◆ with()

Commercetools\Base\MapperMap::with ( string  $key,
callable  $callable = null 
)
Returns
?TObject|mixed

Implements Commercetools\Base\CMap.

Definition at line 153 of file MapperMap.php.


The documentation for this class was generated from the following file: