PHP Class Isswp101\Persimmon\ElasticsearchModel

Inheritance: extends Model, use trait Isswp101\Persimmon\Traits\Elasticsearchable, use trait Isswp101\Persimmon\Traits\Paginationable, use trait Isswp101\Persimmon\Traits\Relationshipable
Show file Open project: isswp101/elasticsearch-eloquent Class Usage Examples

Public Properties

Property Type Description
$_dal Isswp101\Persimmon\DAL\ElasticsearchDAL

Public Methods

Method Description
__construct ( Isswp101\Persimmon\DAL\IDAL $dal, array $attributes = [] )
all ( QueryBuilder | array $query = [] ) : Collection | static[] Execute the query and get all items.
findWithParentId ( $id, $parent, array $columns = ['*'] )
first ( QueryBuilder | array $query = [] ) : static Execute the query and get the first result.
firstOrFail ( QueryBuilder | array $query = [] ) : static Execute the query and get the first result or throw an exception.
map ( QueryBuilder | array $query = [], callable $callback = null, integer $limit ) : integer Apply the callback to the documents of the given query.
search ( QueryBuilder | array $query = [] ) : ElasticsearchCollection | static[] Execute the query and get the result.

Protected Methods

Method Description
belongsTo ( $class )
hasMany ( $class )

Method Details

__construct() public method

public __construct ( Isswp101\Persimmon\DAL\IDAL $dal, array $attributes = [] )
$dal Isswp101\Persimmon\DAL\IDAL
$attributes array

all() public static method

Execute the query and get all items.
public static all ( QueryBuilder | array $query = [] ) : Collection | static[]
$query Isswp101\Persimmon\QueryBuilder\QueryBuilder | array
return Illuminate\Support\Collection | static[]

belongsTo() protected method

protected belongsTo ( $class )

findWithParentId() public static method

public static findWithParentId ( $id, $parent, array $columns = ['*'] )
$columns array

first() public static method

Execute the query and get the first result.
public static first ( QueryBuilder | array $query = [] ) : static
$query Isswp101\Persimmon\QueryBuilder\QueryBuilder | array
return static

firstOrFail() public static method

Execute the query and get the first result or throw an exception.
public static firstOrFail ( QueryBuilder | array $query = [] ) : static
$query Isswp101\Persimmon\QueryBuilder\QueryBuilder | array
return static

hasMany() protected method

protected hasMany ( $class )

map() public static method

Apply the callback to the documents of the given query.
public static map ( QueryBuilder | array $query = [], callable $callback = null, integer $limit ) : integer
$query Isswp101\Persimmon\QueryBuilder\QueryBuilder | array
$callback callable
$limit integer
return integer hits.total

Property Details

$_dal public property

public ElasticsearchDAL,Isswp101\Persimmon\DAL $_dal
return Isswp101\Persimmon\DAL\ElasticsearchDAL