PHP Class mtv\models\Collection

Inheritance: implements Iterato\Iterator, implements ArrayAcces\ArrayAccess, implements Countabl\Countable
Datei anzeigen Open project: newsapps/wordpress-mtv

Public Properties

Property Type Description
$default_filter
$model
$models

Public Methods

Method Description
__construct ( $array = [] )
add ( $model ) Add a model instance to this collection
all ( ) Return a collection containing all model instances
clear ( ) Remove all model instances from this collection
count ( ) Countable interface Makes count($collection) work
current ( ) Makes a collection iterable like an array
filter ( $args ) Return a collection containing model instances matching certian criteria
get ( $args ) Create, fetch and return a single model instance with primary keys
get_by ( $args ) Create, fetch and return a single model instances based on some unique keys
key ( )
next ( )
offsetExists ( $offset ) ArrayAccess interface Makes a collection object addressable like an array
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
rewind ( )
to_json ( ) Return the results of calling to_json on all the model instances in this collection
valid ( )
values ( ) Return specific values from all the model instances in this collection TODO: Return all values if no params are given

Method Details

__construct() public method

public __construct ( $array = [] )

add() public method

Add a model instance to this collection
public add ( $model )

all() public static method

Return a collection containing all model instances
public static all ( )

clear() public method

Remove all model instances from this collection
public clear ( )

count() public method

Countable interface Makes count($collection) work
public count ( )

current() public method

Makes a collection iterable like an array
public current ( )

filter() public static method

Return a collection containing model instances matching certian criteria
public static filter ( $args )

get() public static method

Create, fetch and return a single model instance with primary keys
public static get ( $args )

get_by() public static method

Create, fetch and return a single model instances based on some unique keys
public static get_by ( $args )

key() public method

public key ( )

next() public method

public next ( )

offsetExists() public method

ArrayAccess interface Makes a collection object addressable like an array
public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

rewind() public method

public rewind ( )

to_json() public method

Return the results of calling to_json on all the model instances in this collection
public to_json ( )

valid() public method

public valid ( )

values() public method

Return specific values from all the model instances in this collection TODO: Return all values if no params are given
public values ( )

Property Details

$default_filter public_oe static_oe property

public static $default_filter

$model public_oe static_oe property

public static $model

$models public_oe property

public $models