PHP Class MenaraSolutions\Geographer\Collections\MemberCollection

Inheritance: extends ArrayObject, use trait MenaraSolutions\Geographer\Traits\HasManager, use trait MenaraSolutions\Geographer\Collections\Traits\ImplementsArray
Show file Open project: menarasolutions/geographer

Protected Properties

Property Type Description
$manager MenaraSolutions\Geographer\Contracts\ManagerInterface

Public Methods

Method Description
__construct ( MenaraSolutions\Geographer\Contracts\ManagerInterface $config, array $divisions = [] ) MemberCollection constructor.
add ( $division, string | integer $key )
filter ( callable $callback = null ) : static Run a filter over each of the items.
find ( array $params = [] ) : MemberCollection
findOne ( array $params = [] ) : Divisible | boolean
first ( ) : mixed
get ( $key ) : mixed
sortBy ( string $field, integer $options = SORT_REGULAR, boolean $descending = false ) : static Sort the collection
toArray ( ) : array

Private Methods

Method Description
match ( Divisible $member, array $params ) : boolean

Method Details

__construct() public method

MemberCollection constructor.
public __construct ( MenaraSolutions\Geographer\Contracts\ManagerInterface $config, array $divisions = [] )
$config MenaraSolutions\Geographer\Contracts\ManagerInterface
$divisions array

add() public method

public add ( $division, string | integer $key )
$division
$key string | integer

filter() public method

Run a filter over each of the items.
public filter ( callable $callback = null ) : static
$callback callable
return static

find() public method

public find ( array $params = [] ) : MemberCollection
$params array
return MemberCollection

findOne() public method

public findOne ( array $params = [] ) : Divisible | boolean
$params array
return MenaraSolutions\Geographer\Divisible | boolean

first() public method

public first ( ) : mixed
return mixed

get() public method

public get ( $key ) : mixed
$key
return mixed

sortBy() public method

Sort the collection
public sortBy ( string $field, integer $options = SORT_REGULAR, boolean $descending = false ) : static
$field string
$options integer
$descending boolean
return static

toArray() public method

public toArray ( ) : array
return array

Property Details

$manager protected property

protected ManagerInterface,MenaraSolutions\Geographer\Contracts $manager
return MenaraSolutions\Geographer\Contracts\ManagerInterface