Composable Commerce PHP SDKPHP SDK
  • Namespace
  • Class
  • Tree

Namespaces

  • Commercetools
    • Commons
      • Helper
    • Core
      • Builder
        • Request
        • Update
      • Cache
      • Client
        • Adapter
        • OAuth
      • Error
      • Helper
        • Annotate
        • State
          • Renderer
        • Subscriber
          • Log
      • Model
        • ApiClient
        • Cart
        • CartDiscount
        • Category
        • Channel
        • Common
        • Customer
        • CustomerGroup
        • CustomField
        • CustomObject
        • DiscountCode
        • Extension
        • Inventory
        • Message
        • Order
        • OrderEdit
        • Payment
        • Product
          • Search
        • ProductDiscount
        • ProductSelection
        • ProductType
        • Project
        • Review
        • ShippingMethod
        • ShoppingList
        • State
        • Store
        • Subscription
        • TaxCategory
        • Type
        • Zone
      • Request
        • ApiClients
        • CartDiscounts
          • Command
        • Carts
          • Command
        • Categories
          • Command
        • Channels
          • Command
        • CustomerGroups
          • Command
        • Customers
          • Command
        • CustomField
          • Command
        • CustomObjects
        • DiscountCodes
          • Command
        • Extensions
          • Command
        • GraphQL
        • InStores
        • Inventory
          • Command
        • Me
          • Command
        • Messages
        • OrderEdits
          • Command
          • StagedOrder
            • Command
        • Orders
          • Command
        • Payments
          • Command
        • ProductDiscounts
          • Command
        • Products
          • Command
        • ProductSelections
          • Command
        • ProductTypes
          • Command
        • Project
          • Command
        • Query
        • Reviews
          • Command
        • ShippingMethods
          • Command
        • ShoppingLists
          • Command
        • States
          • Command
        • Stores
          • Command
        • Subscriptions
          • Command
        • TaxCategories
          • Command
        • Types
          • Command
        • Zones
          • Command
      • Response

Classes

  • AbstractJsonDeserializeObject
  • Address
  • AddressCollection
  • Asset
  • AssetCollection
  • AssetDimension
  • AssetDraft
  • AssetDraftCollection
  • AssetSource
  • AssetSourceCollection
  • Attribute
  • AttributeCollection
  • CentPrecisionMoney
  • ClientLogging
  • Collection
  • ContainerAndKey
  • Context
  • CreatedBy
  • DateDecorator
  • DateTimeDecorator
  • DiscountedPrice
  • DiscountValue
  • Enum
  • EnumCollection
  • GeoLocation
  • GeoPoint
  • HighPrecisionMoney
  • Image
  • ImageCollection
  • ImageDimension
  • JsonObject
  • KeyReference
  • KeyResourceIdentifier
  • LastModifiedBy
  • LocalizedEnum
  • LocalizedEnumCollection
  • LocalizedString
  • Money
  • MoneyCollection
  • Price
  • PriceCollection
  • PriceDraft
  • PriceDraftCollection
  • PriceTier
  • PriceTierCollection
  • Reference
  • ReferenceCollection
  • Resource
  • ResourceIdentifier
  • ScopedPrice
  • Set
  • TaxedItemPrice
  • TaxedPrice
  • TaxPortion
  • TaxPortionCollection
  • TimeDecorator

Interfaces

  • ContextAwareInterface
  • JsonDeserializeInterface
  • ObjectTreeInterface
  • ReferenceObjectInterface
  • TypeableInterface

Traits

  • ContextTrait
  • LocaleTrait
  • ObjectTreeTrait

Class Collection

Commercetools\Core\Model\Common\AbstractJsonDeserializeObject implements Commercetools\Core\Model\Common\JsonDeserializeInterface, Commercetools\Core\Model\Common\ObjectTreeInterface uses Commercetools\Core\Model\Common\ObjectTreeTrait
Extended by Commercetools\Core\Model\Common\Collection implements Iterator, JsonSerializable, Countable, ArrayAccess uses Commercetools\Core\Model\Common\ContextTrait

Direct known subclasses

Commercetools\Core\Error\ErrorContainer, Commercetools\Core\Model\ApiClient\ApiClientCollection, Commercetools\Core\Model\Cart\LineItemDraftCollection, Commercetools\Core\Model\Cart\MyLineItemDraftCollection, Commercetools\Core\Model\CartDiscount\CartDiscountCollection, Commercetools\Core\Model\CartDiscount\CartDiscountReferenceCollection, Commercetools\Core\Model\Category\CategoryCollection, Commercetools\Core\Model\Category\CategoryReferenceCollection, Commercetools\Core\Model\Channel\ChannelCollection, Commercetools\Core\Model\Common\AddressCollection, Commercetools\Core\Model\Common\AssetCollection, Commercetools\Core\Model\Common\AssetDraftCollection, Commercetools\Core\Model\Cart\CartCollection, Commercetools\Core\Model\Common\AssetSourceCollection, Commercetools\Core\Model\Common\AttributeCollection, Commercetools\Core\Model\Common\EnumCollection, Commercetools\Core\Model\Common\ImageCollection, Commercetools\Core\Model\Common\LocalizedEnumCollection, Commercetools\Core\Model\Common\MoneyCollection, Commercetools\Core\Model\Common\PriceCollection, Commercetools\Core\Model\Common\PriceDraftCollection, Commercetools\Core\Model\Common\PriceTierCollection, Commercetools\Core\Model\Common\ReferenceCollection, Commercetools\Core\Model\Cart\CustomLineItemCollection, Commercetools\Core\Model\Common\Set, Commercetools\Core\Model\Common\TaxPortionCollection, Commercetools\Core\Model\Customer\CustomerCollection, Commercetools\Core\Model\CustomerGroup\CustomerGroupCollection, Commercetools\Core\Model\CustomField\CustomFieldObjectCollection, Commercetools\Core\Model\CustomField\CustomFieldObjectDraftCollection, Commercetools\Core\Model\CustomObject\CustomObjectCollection, Commercetools\Core\Model\DiscountCode\DiscountCodeCollection, Commercetools\Core\Model\DiscountCode\DiscountCodeReferenceCollection, Commercetools\Core\Model\Extension\ExtensionCollection, Commercetools\Core\Model\Cart\CustomLineItemDraftCollection, Commercetools\Core\Model\Extension\TriggerCollection, Commercetools\Core\Model\Inventory\InventoryEntryCollection, Commercetools\Core\Model\Message\MessageCollection, Commercetools\Core\Model\Message\ProductPriceDiscountsSetUpdatedPriceCollection, Commercetools\Core\Model\Order\DeliveryCollection, Commercetools\Core\Model\Order\DeliveryItemCollection, Commercetools\Core\Model\Order\ItemStateCollection, Commercetools\Core\Model\Order\LineItemImportDraftCollection, Commercetools\Core\Model\Order\OrderCollection, Commercetools\Core\Model\Order\ParcelCollection, Commercetools\Core\Model\Cart\DiscountCodeInfoCollection, Commercetools\Core\Model\Order\ReturnInfoCollection, Commercetools\Core\Model\Order\ReturnItemCollection, Commercetools\Core\Model\Order\SyncInfoCollection, Commercetools\Core\Model\OrderEdit\OrderEditCollection, Commercetools\Core\Model\Payment\PaymentCollection, Commercetools\Core\Model\Payment\PaymentReferenceCollection, Commercetools\Core\Model\Payment\TransactionCollection, Commercetools\Core\Model\Product\FacetRangeCollection, Commercetools\Core\Model\Product\FacetResultCollection, Commercetools\Core\Model\Product\FacetTermCollection, Commercetools\Core\Model\Cart\DiscountedLineItemPortionCollection, Commercetools\Core\Model\Product\LocalizedSearchKeywords, Commercetools\Core\Model\Product\LocalizedSuggestionCollection, Commercetools\Core\Model\Product\ProductCollection, Commercetools\Core\Model\Product\ProductProjectionCollection, Commercetools\Core\Model\Product\ProductVariantAvailabilityCollection, Commercetools\Core\Model\Product\ProductVariantCollection, Commercetools\Core\Model\Product\ProductVariantDraftCollection, Commercetools\Core\Model\Product\Search\FilterRangeCollection, Commercetools\Core\Model\Product\Search\FilterSubtreeCollection, Commercetools\Core\Model\Product\SearchKeywords, Commercetools\Core\Model\Cart\DiscountedPricePerQuantityCollection, Commercetools\Core\Model\Product\SuggestionCollection, Commercetools\Core\Model\ProductDiscount\ProductDiscountCollection, Commercetools\Core\Model\ProductSelection\ProductSelectionCollection, Commercetools\Core\Model\ProductType\AttributeDefinitionCollection, Commercetools\Core\Model\ProductType\ProductTypeCollection, Commercetools\Core\Model\Review\ReviewCollection, Commercetools\Core\Model\ShippingMethod\ShippingMethodCollection, Commercetools\Core\Model\ShippingMethod\ShippingRateDraftCollection, Commercetools\Core\Model\ShippingMethod\ZoneRateDraftCollection, Commercetools\Core\Model\ShoppingList\LineItemCollection, Commercetools\Core\Model\Cart\ItemShippingTargetCollection, Commercetools\Core\Model\ShoppingList\LineItemDraftCollection, Commercetools\Core\Model\ShoppingList\ShoppingListCollection, Commercetools\Core\Model\ShoppingList\TextLineItemCollection, Commercetools\Core\Model\ShoppingList\TextLineItemDraftCollection, Commercetools\Core\Model\State\StateCollection, Commercetools\Core\Model\State\StateReferenceCollection, Commercetools\Core\Model\Store\StoreCollection, Commercetools\Core\Model\Store\StoreReferenceCollection, Commercetools\Core\Model\Subscription\ChangeSubscriptionCollection, Commercetools\Core\Model\Subscription\MessageSubscriptionCollection, Commercetools\Core\Model\Cart\LineItemCollection, Commercetools\Core\Model\Subscription\SubscriptionCollection, Commercetools\Core\Model\TaxCategory\SubRateCollection, Commercetools\Core\Model\TaxCategory\TaxCategoryCollection, Commercetools\Core\Model\TaxCategory\TaxRateCollection, Commercetools\Core\Model\Type\FieldDefinitionCollection, Commercetools\Core\Model\Type\TypeCollection, Commercetools\Core\Model\Zone\LocationCollection, Commercetools\Core\Model\Zone\ZoneCollection, Commercetools\Core\Request\OrderEdits\StagedOrder\Command\StagedOrderUpdateActionCollection

Indirect known subclasses

Commercetools\Core\Model\ShippingMethod\ShippingRateCollection, Commercetools\Core\Model\ShippingMethod\ShippingRatePriceTierCollection, Commercetools\Core\Model\ShippingMethod\ZoneRateCollection

Namespace: Commercetools\Core\Model\Common
Located at Core/Model/Common/Collection.php

Methods summary

final public
# __construct( array $data = [], Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$data
$context

Overrides

Commercetools\Core\Model\Common\AbstractJsonDeserializeObject::__construct
public string
# getType( )

Returns

string
public Commercetools\Core\Model\Common\Collection
# getById( $id )

Parameters

$id

Returns

Commercetools\Core\Model\Common\Collection
public mixed|null
# getBy( $indexName, $key )

Parameters

$indexName
$key

Returns

mixed|null
public
# add( $object )
public array
# toArray( )

Returns

array

Overrides

Commercetools\Core\Model\Common\AbstractJsonDeserializeObject::toArray
public mixed
# getAt( $offset )

Parameters

$offset

Returns

mixed
public Commercetools\Core\Model\Common\Collection
# setAt( $offset, $object )

Parameters

$offset
$object

Returns

Commercetools\Core\Model\Common\Collection
$this
public integer
# count( )

(PHP 5 >= 5.1.0)
Count elements of an object

(PHP 5 >= 5.1.0)
Count elements of an object

Returns

integer

The custom count as an integer.

<

p> The return value is cast to an integer.

Link

http://php.net/manual/en/countable.count.php

Implementation of

Countable::count()
public mixed
# current( )

(PHP 5 >= 5.0.0)
Return the current element

(PHP 5 >= 5.0.0)
Return the current element

Returns

mixed
Can return any type.

Link

http://php.net/manual/en/iterator.current.php

Implementation of

Iterator::current()
public
# next( )

(PHP 5 >= 5.0.0)
Move forward to next element

(PHP 5 >= 5.0.0)
Move forward to next element

Returns


Any returned value is ignored.

Link

http://php.net/manual/en/iterator.next.php

Implementation of

Iterator::next()
public mixed
# key( )

(PHP 5 >= 5.0.0)
Return the key of the current element

(PHP 5 >= 5.0.0)
Return the key of the current element

Returns

mixed
scalar on success, or null on failure.

Link

http://php.net/manual/en/iterator.key.php

Implementation of

Iterator::key()
public boolean
# valid( )

(PHP 5 >= 5.0.0)
Checks if current position is valid

(PHP 5 >= 5.0.0)
Checks if current position is valid

Returns

boolean

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

Link

http://php.net/manual/en/iterator.valid.php

Implementation of

Iterator::valid()
public
# rewind( )

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element

Returns


Any returned value is ignored.

Link

http://php.net/manual/en/iterator.rewind.php

Implementation of

Iterator::rewind()
public boolean
# offsetExists( mixed $offset )

(PHP 5 >= 5.0.0)
Whether a offset exists

(PHP 5 >= 5.0.0)
Whether a offset exists

Parameters

$offset

An offset to check for.

Returns

boolean

true on success or false on failure.

<

p> The return value will be casted to boolean if non-boolean was returned.

Link

http://php.net/manual/en/arrayaccess.offsetexists.php

Implementation of

ArrayAccess::offsetExists()
public mixed
# offsetGet( mixed $offset )

(PHP 5 >= 5.0.0)
Offset to retrieve

(PHP 5 >= 5.0.0)
Offset to retrieve

Parameters

$offset

The offset to retrieve.

Returns

mixed
Can return all value types.

Link

http://php.net/manual/en/arrayaccess.offsetget.php

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( mixed $offset, mixed $value )

(PHP 5 >= 5.0.0)
Offset to set

(PHP 5 >= 5.0.0)
Offset to set

Parameters

$offset

The offset to assign the value to.

$value

The value to set.

Link

http://php.net/manual/en/arrayaccess.offsetset.php

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( mixed $offset )

(PHP 5 >= 5.0.0)
Offset to unset

(PHP 5 >= 5.0.0)
Offset to unset

Parameters

$offset

The offset to unset.

Link

http://php.net/manual/en/arrayaccess.offsetunset.php

Implementation of

ArrayAccess::offsetUnset()

Methods inherited from Commercetools\Core\Model\Common\AbstractJsonDeserializeObject

__sleep(), fromArray(), jsonSerialize(), of()

Methods inherited from Commercetools\Core\Model\Common\ObjectTreeInterface

parentSet(), rootGet(), rootSet()

Methods inherited from Commercetools\Core\Model\Common\ContextAwareInterface

getContext(), getContextCallback(), setContext(), setContextIfNull()

Methods used from Commercetools\Core\Model\Common\ContextTrait

getContext(), getContextCallback(), setContext(), setContextIfNull()

Methods used from Commercetools\Core\Model\Common\ObjectTreeTrait

parentSet(), rootGet(), rootSet()

Constants summary

string ID
# 'id'
string COLLECTION_TYPE
# Collection::TYPE_LIST
string TYPE_LIST
# 'List'
string TYPE_MAP
# 'Map'

Constants inherited from Commercetools\Core\Model\Common\AbstractJsonDeserializeObject

JSON_DESERIALIZE_INTERFACE, TYPEABLE_INTERFACE

PHP SDK API documentation generated by ApiGen