Property | Type | Description | |
---|---|---|---|
$args | array | ||
$collected_class | string | ||
$models | TerminusModel[] | ||
$paged | boolean | ||
$url | string |
Method | Description | |
---|---|---|
__construct ( array $options = [] ) | Instantiates the collection, sets param members as properties | |
add ( object $model_data, array $options = [] ) : TerminusModel | Adds a model to this collection | |
all ( ) : TerminusModel[] | Retrieves all models TODO: Remove automatic fetching and make fetches explicit | |
fetch ( array $options = [] ) : |
Fetches model data from API and instantiates its model instances | |
get ( string $id ) : TerminusModel | Retrieves the model of the given ID | |
getFilteredMemberList ( array $filters, string $key = 'id', string | array $value = 'name' ) : array | Returns an array of data where the keys are the attribute $key and the values are the attribute $value, filtered by the given array | |
getMemberList ( string $key = 'id', string $value = 'name' ) : array | Returns an array of data where the keys are the attribute $key and the values are the attribute $value | |
getUrl ( ) : string | Get the listing URL for this collection | |
ids ( ) : string[] | List Model IDs | |
listing ( string $key = 'id', mixed $value = 'name' ) : array | Returns an array of data where the keys are the attribute $key and the values are the attribute $value |
Method | Description | |
---|---|---|
getCollectionData ( array $options = [] ) : array | Retrieves collection data from the API | |
getMembers ( ) : TerminusModel[] | Retrieves all members of this collection |
public __construct ( array $options = [] ) | ||
$options | array | Options with which to configure this collection |
public all ( ) : TerminusModel[] | ||
return | TerminusModel[] |
protected getCollectionData ( array $options = [] ) : array | ||
$options | array | params to pass to url request |
return | array |
public getFilteredMemberList ( array $filters, string $key = 'id', string | array $value = 'name' ) : array | ||
$filters | array | Attributes to match during filtration e.g. array('category' => 'other') |
$key | string | Name of attribute to make array keys |
$value | string | array | Name(s) of attribute to make array values |
return | array | Array rendered as requested $this->attribute->$key = $this->attribute->$value |
protected getMembers ( ) : TerminusModel[] | ||
return | TerminusModel[] |