Resource

class DreamCommerce\ShopAppstoreLib\Resource

Represents particular resource.

resources

resource description
AboutPage About page
AdditionalField Additional field
ApplicationLock Administrator panel lock
ApplicationConfig Application config
ApplicationVersion Application config
AttributeGroup Attributes group
Attribute Attribute
Auction Auction
AuctionHouse Auction house
AuctionOrder Auction order
Availability Product availability
Category Category
CategoriesTree Category tree
Currency Currency
DashboardActivity Dashboard activity
DashboardStat Sales stats
Delivery Delivery
Gauge Gauge
GeolocationCountry Geolocation country
GeolocationRegion Geolocation region
GeolocationSubregion Geolocation subregion
Language Language
Metafield Metafield
MetafieldValue Metafield Value
ObjectMtime Modification timestamp of object
OptionGroup Option group
Option Variant
OptionValue Variant value
OrderProduct Product of order
Order Order
Parcel Parcel
Payment Payment method
Producer Producer
Product Product
ProductFile Product file
ProductImage Photo of product
ProductStock Product stock
Shipping Shipping method
Status Order status
SubscriberGroup Subscriber group
Subscriber Subscriber
Tax Tax value
Unit Unit of measurement
UserAddress Shipping address
UserGroup User group
User User
Webhook Webhook
Zone Zone

exceptions

exception description
CommunicationException Server communication problem
NotFoundException Object not found
ObjectLockedException Object is locked for editing
PermissionsException Insufficient permissions for object
ResourceException Base class for exceptions
ValidationException Supplied data is invalid

static methods

static DreamCommerce\ShopAppstoreLib\Resource::factory($client, $name)

instantiates new Resource object

Parameters:
  • $client (Client) – handle to the client library instance
  • $name (string) – name of resource
Return type:

Resource

\DreamCommerce\ShopAppstoreLib\Resource::factory($client, "product");

methods

DreamCommerce\ShopAppstoreLib\Resource::delete([$id = null])

Deletes an object by ID.

Parameters:
  • $id (integer) – object ID
Return type:

boolean

DreamCommerce\ShopAppstoreLib\Resource::filters($filters)

Filters records (GET only).

Chaining method - returns a handle to an object itself.

Parameters:
  • $filters (array) – an array of filters
Return type:

Resource

Returns:

chain

DreamCommerce\ShopAppstoreLib\Resource::get([...])

Performs GET request.

Parameters:
  • .. (mixed) – arguments - no argument: returns collection - single argument - an object with specified ID - more arguments - resource dependent
Return type:

ResourceList|ArrayObject|string

DreamCommerce\ShopAppstoreLib\Resource::head([...])

Performs HEAD request. Similar to Resource::get but without data.

Parameters:
  • .. (mixed) – arguments - no argument: returns collection - single argument - an object with specified ID - more arguments - resource dependent
Return type:

ResourceList|ArrayObject|string

DreamCommerce\ShopAppstoreLib\Resource::getName()

Returns a plural name of resource.

Return type:string
DreamCommerce\ShopAppstoreLib\Resource::limit($count)

Restrict amount of fetched records of collection (GET only).

Chaining method - returns a handle to an object itself.

Parameters:
  • $count (integer) – count of records to fetch
Return type:

Resource

Returns:

chain

DreamCommerce\ShopAppstoreLib\Resource::order($expr)

Sorts records by specified criteria (GET only).

Chaining method - returns a handle to an object itself.

Parameters:
  • $expr (string) – sorting expression, eg. field DESC, field ASC or +field, -field
Return type:

Resource

Returns:

chain

DreamCommerce\ShopAppstoreLib\Resource::page($page)

Specifies results page number for fetching (GET only).

Chaining method - returns a handle to an object itself.

Parameters:
  • $page (integer) – number of page
Return type:

Resource

Returns:

chain

DreamCommerce\ShopAppstoreLib\Resource::post([$data = array()])

Performs a POST request.

Chaining method - returns a handle to an object itself.

Parameters:
  • $data (array) – request body
Return type:

ArrayObject|string

DreamCommerce\ShopAppstoreLib\Resource::put([$id = null[, $data = array()]])

Performs PUT request.

Chaining method - returns a handle to an object itself.

Parameters:
  • $id (null|integer) – ID of modified object
  • $data (array) – request body
Return type:

ArrayObject|string

DreamCommerce\ShopAppstoreLib\Resource::reset()

Resets all pagination, limits and filters on current instance.