Metafield
+ Inheritance diagram for Metafield:

Description

Public Properties

const DIR = 'metafields'
 
const TYPE = 'metafield'
 
const TYPE_INT = 'integer'
 
const TYPE_JSON = 'json_string'
 
const TYPE_STRING = 'string'
 
- 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 = []
 

Protected Properties

AbstractEntity $container
 
- Protected Properties inherited from Data
Api $api
 
Pool $pool
 

Public Methods

 __construct (AbstractEntity $container, array $data=[])
 
string __toString ()
 
magic string getCreatedAt ()
 
magic string getDescription ()
 
magic string getKey ()
 
magic string getNamespace ()
 
magic string getOwnerId ()
 injected More...
 
magic string getOwnerResource ()
 injected More...
 
AbstractEntity getResource ()
 
magic string getUpdatedAt ()
 
mixed getValue ()
 
magic string getValueType ()
 
bool isInt ()
 
bool isJson ()
 
bool isString ()
 
magic $this setDescription (string $description)
 
magic $this setKey (string $key)
 
magic $this setNamespace (string $ns)
 
$this setValue ($value)
 
- Public Methods inherited from AbstractEntity
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 ()
 

Protected Methods

 _container ()
 The container/owner object, if any. More...
 
string _dir ()
 The POST directory. More...
 
- Protected Methods inherited from AbstractEntity
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...
 

Additional Inherited Members

- Public Static Methods inherited from AbstractEntity
static null self load ($caller, string $id, array $query=[])
 
static self[] loadAll ($caller, string $path, array $query=[])
 

Constructor

◆ __construct()

__construct ( AbstractEntity  $container,
array  $data = [] 
)
Parameters
AbstractEntity$container
array$data

Methods

◆ __toString()

string __toString ( )
final
Returns
string

Reimplemented from AbstractEntity.

◆ _container()

_container ( )
protected

The container/owner object, if any.

Returns
null|AbstractEntity

Reimplemented from AbstractEntity.

◆ _dir()

string _dir ( )
protected

The POST directory.

Defaults to including the container.

Returns
string

Reimplemented from CreateTrait.

◆ getCreatedAt()

magic string getCreatedAt ( )
Returns
string

◆ getDescription()

magic string getDescription ( )
Returns
string

◆ getKey()

magic string getKey ( )
Returns
string

◆ getNamespace()

magic string getNamespace ( )
Returns
string

◆ getOwnerId()

magic string getOwnerId ( )

injected

Returns
string

◆ getOwnerResource()

magic string getOwnerResource ( )

injected

Returns
string

◆ getResource()

AbstractEntity getResource ( )
Returns
AbstractEntity

◆ getUpdatedAt()

magic string getUpdatedAt ( )
Returns
string

◆ getValue()

mixed getValue ( )
Returns
mixed

◆ getValueType()

magic string getValueType ( )
Returns
string

◆ isInt()

bool isInt ( )
final
Returns
bool

◆ isJson()

bool isJson ( )
final
Returns
bool

◆ isString()

bool isString ( )
final
Returns
bool

◆ setDescription()

magic $this setDescription ( string  $description)
Returns
$this

◆ setKey()

magic $this setKey ( string  $key)
Depends:
create-only
Returns
$this

◆ setNamespace()

magic $this setNamespace ( string  $ns)
Depends:
create-only
Returns
$this

◆ setValue()

$this setValue (   $value)
Parameters
mixed$value
Returns
$this