AbstractCollection
+ Inheritance diagram for AbstractCollection:

Description

Abstract for collections.

See also
CustomCollection
SmartCollection

Public Properties

const MAP
 
const SCOPE_GLOBAL = 'global'
 
const SCOPE_WEB = 'web'
 
const SORT_ALPHA_ASC = 'alpha-asc'
 
const SORT_ALPHA_DESC = 'alpha-desc'
 
const SORT_BEST_SELLING = 'best-selling'
 
const SORT_CREATED = 'created'
 
const SORT_CREATED_DESC = 'created-desc'
 
const SORT_MANUAL = 'manual'
 
const SORT_PRICE_ASC = 'price-asc'
 
const SORT_PRICE_DESC = 'price-desc'
 
- Public Properties inherited from AbstractEntity
const DIR = ''
 All subclasses must redeclare this to match their REST directory (without container). More...
 
const TYPE = ''
 All subclasses must redeclare this to match their types. More...
 
- Public Properties inherited from Data
const MAP = []
 
const PATCH = []
 

Public Methods

magic string getBodyHtml ()
 
magic string getHandle ()
 
magic null Image getImage ()
 
Product[] getProducts ()
 
magic null string getPublishedAt ()
 
magic string getPublishedScope ()
 web|global, read-only for custom collections. More...
 
magic string getSortOrder ()
 See the sort constants. More...
 
magic string getTemplateSuffix ()
 
magic string getTitle ()
 
magic string getUpdatedAt ()
 
AbstractCollect newCollect (Product $product)
 
magic $this setBodyHtml (string $html)
 
magic $this setHandle (string $handle)
 
magic $this setImage (?Image $image)
 
magic $this setSortOrder (string $order)
 See the sort constants. More...
 
magic $this setTemplateSuffix (string $suffix)
 
magic $this setTitle (string $title)
 
- Public Methods inherited from AbstractEntity
string __toString ()
 
null string getId ()
 
string[] getPoolKeys ()
 
bool hasId ()
 
$this reload ()
 Fully reloads the entity from Shopify. More...
 
- Public Methods inherited from Data
mixed __call (string $method, array $args)
 
 __construct ($caller, array $data=[])
 
string serialize ()
 Dehydrated JSON encode. More...
 
array toArray ()
 
void unserialize ($serialized)
 
- Public Methods inherited from CreateTrait
$this create ()
 
- Public Methods inherited from DeleteTrait
void delete ()
 
- Public Methods inherited from UpdateTrait
$this update ()
 
- Public Methods inherited from MetafieldTrait
Metafield[] getMetafields ()
 
Metafield newMetafield ()
 Factory. More...
 

Additional Inherited Members

- Protected Properties inherited from Data
Api $api
 
Pool $pool
 
- Public Static Methods inherited from AbstractEntity
static null self load ($caller, string $id, array $query=[])
 
static self[] loadAll ($caller, string $path, array $query=[])
 
- Protected Methods inherited from AbstractEntity
null AbstractEntity _container ()
 The container/owner object, if any. More...
 
mixed _get (string $field)
 Lazy-loads missing fields. More...
 
void _onDelete ()
 
void _onSave ()
 
void _reload (string $field)
 
- Protected Methods inherited from Data
mixed _hydrate (string $class, $item)
 A factory that also hydrates / caches entities. More...
 
array _select ($subject, callable $filter,... $args)
 Magic method: selectField(callable $filter) More...
 
$this _setData (array $data)
 Clears all diffs and sets all data, hydrating mapped fields. More...
 
$this _setField (string $field, $value)
 Sets a value, hydrating if mapped, and clears the diff. More...
 
- Protected Methods inherited from CreateTrait
string _dir ()
 The POST directory. More...
 
- Protected Methods inherited from MetafieldTrait
string _metafieldType ()
 

Properties

◆ MAP

const MAP
Initial value:
= [
'image' => Image::class,
]

Methods

◆ getBodyHtml()

magic string getBodyHtml ( )
Returns
string

◆ getHandle()

magic string getHandle ( )
Returns
string

◆ getImage()

magic null Image getImage ( )
Returns
null|Image

◆ getProducts()

Product [] getProducts ( )
Returns
Product[]

◆ getPublishedAt()

magic null string getPublishedAt ( )
Returns
null|string

◆ getPublishedScope()

magic string getPublishedScope ( )

web|global, read-only for custom collections.

Returns
string

◆ getSortOrder()

magic string getSortOrder ( )

See the sort constants.

Returns
string

◆ getTemplateSuffix()

magic string getTemplateSuffix ( )
Returns
string

◆ getTitle()

magic string getTitle ( )
Returns
string

◆ getUpdatedAt()

magic string getUpdatedAt ( )
Returns
string

◆ newCollect()

AbstractCollect newCollect ( Product  $product)
abstract
Parameters
Product$product
Returns
AbstractCollect

Reimplemented in SmartCollection, and CustomCollection.

◆ setBodyHtml()

magic $this setBodyHtml ( string  $html)
Returns
$this

◆ setHandle()

magic $this setHandle ( string  $handle)
Returns
$this

◆ setImage()

magic $this setImage ( ?Image  $image)
Returns
$this

◆ setSortOrder()

magic $this setSortOrder ( string  $order)

See the sort constants.

Returns
$this

◆ setTemplateSuffix()

magic $this setTemplateSuffix ( string  $suffix)
Returns
$this

◆ setTitle()

magic $this setTitle ( string  $title)
Returns
$this