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 LocalizedString

Commercetools\Core\Model\Common\LocalizedString implements JsonSerializable, Commercetools\Core\Model\Common\JsonDeserializeInterface uses Commercetools\Core\Model\Common\ContextTrait
Namespace: Commercetools\Core\Model\Common
API documentation: https://docs.commercetools.com/http-api-types.html#localizedstring
Example: LocalizedString::fromArray(['en' => 'Hello World', 'de' => 'Hallo Welt'])->add('fr', 'Bonjour le monde');
Located at Core/Model/Common/LocalizedString.php

Methods summary

public
# __construct( array $values, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$values
$context
public string
# __get( $locale )

Parameters

$locale

Returns

string
public string
# getLocalized( Commercetools\Core\Model\Common\Context $context = null )

Parameters

$context

Returns

string
public string
# get( Commercetools\Core\Model\Common\Context $context = null )

Parameters

$context

Returns

string
public Commercetools\Core\Model\Common\LocalizedString
# add( string $locale, string $value )

Parameters

$locale
$value

Returns

Commercetools\Core\Model\Common\LocalizedString
$this
public
# merge( Commercetools\Core\Model\Common\LocalizedString $localizedString )
public
# __toString( )
public array
# toArray( )

Returns

array

Implementation of

Commercetools\Core\Model\Common\JsonDeserializeInterface::toArray()
public array
# jsonSerialize( )

Returns

array

Implementation of

JsonSerializable::jsonSerialize()
public static Commercetools\Core\Model\Common\LocalizedString
# of( Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$context

Returns

Commercetools\Core\Model\Common\LocalizedString
$this
public static Commercetools\Core\Model\Common\LocalizedString
# fromArray( array $data, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$data
$context

Returns

Commercetools\Core\Model\Common\LocalizedString

Implementation of

Commercetools\Core\Model\Common\JsonDeserializeInterface::fromArray()
public static Commercetools\Core\Model\Common\LocalizedString
# ofLangAndText( string $language, string $text, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$language
$text
$context

Returns

Commercetools\Core\Model\Common\LocalizedString

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

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

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

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

PHP SDK API documentation generated by ApiGen