Overview

Namespaces

  • rsanchez
    • Deep
      • App
        • EE
        • Laravel
          • Facade
      • Collection
      • Hydrator
      • Model
      • Plugin
      • Relations
      • Repository

Classes

  • AbstractFieldCollection
  • AbstractTitleCollection
  • AssetCollection
  • CategoryCollection
  • CategoryFieldCollection
  • ChannelCollection
  • EntryCollection
  • FieldCollection
  • FileCollection
  • GridColCollection
  • GridRowCollection
  • MatrixColCollection
  • MatrixRowCollection
  • MemberFieldCollection
  • PlayaCollection
  • RelationshipCollection
  • SiteCollection
  • TitleCollection
  • UploadPrefCollection

Interfaces

  • FilterableInterface

Traits

  • FilterableTrait
  • Overview
  • Namespace
  • Class
  • Tree

Trait FilterableTrait

A model collection that is sortable and filterable by common parameters

Direct Known Users

rsanchez\Deep\Collection\AbstractTitleCollection, rsanchez\Deep\Collection\AssetCollection, rsanchez\Deep\Collection\CategoryCollection, rsanchez\Deep\Collection\GridRowCollection, rsanchez\Deep\Collection\MatrixRowCollection

Indirect Known Users

rsanchez\Deep\Collection\EntryCollection, rsanchez\Deep\Collection\PlayaCollection, rsanchez\Deep\Collection\RelationshipCollection, rsanchez\Deep\Collection\TitleCollection
Namespace: rsanchez\Deep\Collection
Located at Collection/FilterableTrait.php
Methods summary
public Illuminate\Database\Eloquent\Collection
# createClone( )

Create a copy of this Collection

Create a copy of this Collection

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# filterByAttributeContains( string $attribute, array $values, boolean $and = false, boolean $not = false )

Filter by model attribute contains

Filter by model attribute contains

Parameters

$attribute
string
$attribute name of the attribute on which to filter
$values
array
$values
$and
boolean
$and
$not
boolean
$not

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# filterByAttributeInString( string $attribute, string $filter )

Filter by model attribute in array string

Filter by model attribute in array string

Parameters

$attribute
string
$attribute name of the attribute on which to filter
$filter
string
$filter pipe-delimited list of values, optionaly prefixed by not

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# filterByAttributeIn( string $attribute, array $values, boolean $not = false )

Filter by model attribute in array

Filter by model attribute in array

Parameters

$attribute
string
$attribute name of the attribute on which to filter
$values
array
$values
$not
boolean
$not

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# filterByAttributeComparison( string $attribute, mixed $value, string $operator )

Filter by model attribute numerical comparison

Filter by model attribute numerical comparison

Parameters

$attribute
string
$attribute name of the attribute on which to filter
$value
mixed
$value
$operator
string
$operator >, >=, <, <=

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# filterByAttribute( string $attribute, string $filter )

Filter by model attribute

Filter by model attribute

The filter should be one of the following formats:

  • 'foo|bar'
  • 'not foo|bar'
  • '=foo|bar'
  • '=not foo|bar'
  • 'foo&&bar'
  • 'not foo|bar'
  • 'foo\W|bar'
  • '>=3'

Parameters

$attribute
string
$attribute name of the attribute on which to filter
$filter
string
$filter a string describing the filter

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# filterById( integer $id,… )

Filter by model ID

Filter by model ID

Parameters

$id,…
integer
$id,... one or more IDs

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# limit( integer $limit, integer $offset = 0 )

Limit the collection

Limit the collection

Parameters

$limit
integer
$limit
$offset
integer
$offset

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# offset( integer $offset, integer $limit = null )

Offset the collection

Offset the collection

Parameters

$offset
integer
$limit
$limit
integer
$offset

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# sortByAttribute( array|integer $attribute, array|string $sort = 'asc' )

Sort by one or more model attributes

Sort by one or more model attributes

Parameters

$attribute
array|integer
$id one or more IDs
$sort
array|string
$sort sort direction

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# sortByFixedOrder( integer $id,… )

Sort by model ID in the specified order

Sort by model ID in the specified order

Parameters

$id,…
integer
$id,... one or more IDs

Returns

Illuminate\Database\Eloquent\Collection
public Illuminate\Database\Eloquent\Collection
# tagparams( array $params )

Sort and filter a clone of this collection according to the given array of params.

Sort and filter a clone of this collection according to the given array of params.

The array may contain the following:

  • limit
  • offset
  • search:your_field
  • fixed_order
  • orderby
  • sort
  • any model attribute (ex. row_id)

Parameters

$params
array
$params

Returns

Illuminate\Database\Eloquent\Collection
public mixed|null
# __get( string $name )

Get the first Model's given attribute

Get the first Model's given attribute

Parameters

$name
string
$name

Returns

mixed|null
public Illuminate\Database\Eloquent\Collection
# __invoke( array $params )

Alias to tagparams

Alias to tagparams

Parameters

$params
array
$params

Returns

Illuminate\Database\Eloquent\Collection
API documentation generated by ApiGen 2.8.0