PHP Класс App\Data\Repositories\Repository

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$model Illuminate\Database\Eloquent\Model The model instance.

Открытые методы

Метод Описание
__call ( string $method, array $arguments ) : mixed Implement a convenience call to findBy which allows finding by an attribute name as follows: findByName or findByAlias.
__construct ( $model )
all ( ) : Illuminate\Database\Eloquent\Collection Returns all the records.
count ( ) : integer Returns the count of all the records.
fill ( array $attributes ) : Model Fills out an instance of the model with $attributes.
fillAndSave ( array $attributes ) : Model Fills out an instance of the model and saves it, pretty much like mass assignment.
find ( string $id, array $relations = null ) : Model Find a record by its identifier.
findBy ( string $attribute, string $value, array $relations = null ) : Model Find a record by an attribute.
first ( ) : Model Returns the first record in the database.
getByAttributes ( array $attributes, string $operator = 'AND', array $relations = null ) : Collection Get all records by an associative array of attributes.
page ( $limit = 10, integer $offset, array $relations = [], $orderBy = 'updated_at', $sorting = 'desc' ) : Illuminate\Database\Eloquent\Collection Returns a range of records bounded by pagination parameters.
remove ( string $key ) : boolean Remove a selected record.

Описание методов

__call() публичный Метод

Implement a convenience call to findBy which allows finding by an attribute name as follows: findByName or findByAlias.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
Результат mixed

__construct() публичный Метод

public __construct ( $model )

all() публичный Метод

Returns all the records.
public all ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

count() публичный Метод

Returns the count of all the records.
public count ( ) : integer
Результат integer

fill() публичный Метод

Fills out an instance of the model with $attributes.
public fill ( array $attributes ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

fillAndSave() публичный Метод

Fills out an instance of the model and saves it, pretty much like mass assignment.
public fillAndSave ( array $attributes ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

find() публичный Метод

Find a record by its identifier.
public find ( string $id, array $relations = null ) : Model
$id string
$relations array
Результат Illuminate\Database\Eloquent\Model

findBy() публичный Метод

Fails if no model is found.
public findBy ( string $attribute, string $value, array $relations = null ) : Model
$attribute string
$value string
$relations array
Результат Illuminate\Database\Eloquent\Model

first() публичный Метод

Returns the first record in the database.
public first ( ) : Model
Результат Illuminate\Database\Eloquent\Model

getByAttributes() публичный Метод

Two operators values are handled: AND | OR.
public getByAttributes ( array $attributes, string $operator = 'AND', array $relations = null ) : Collection
$attributes array
$operator string
$relations array
Результат Illuminate\Support\Collection

page() публичный Метод

Returns a range of records bounded by pagination parameters.
public page ( $limit = 10, integer $offset, array $relations = [], $orderBy = 'updated_at', $sorting = 'desc' ) : Illuminate\Database\Eloquent\Collection
$offset integer
$relations array
Результат Illuminate\Database\Eloquent\Collection

remove() публичный Метод

Remove a selected record.
public remove ( string $key ) : boolean
$key string
Результат boolean

Описание свойств

$model защищенное свойство

The model instance.
protected Model,Illuminate\Database\Eloquent $model
Результат Illuminate\Database\Eloquent\Model