PHP Интерфейс Rinvex\Repository\Contracts\RepositoryContract

Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
__call ( string $method, array $parameters ) : mixed Dynamically pass missing methods to the model.
__callStatic ( $method, $parameters ) : mixed Dynamically pass missing static methods to the model.
create ( array $attributes = [] ) : array Create a new entity with the given attributes.
createModel ( ) : object Create a new repository model instance.
delete ( mixed $id ) : array Delete an entity with the given id.
find ( integer $id, array $attributes = ['*'] ) : object Find an entity by it's primary key.
findAll ( array $attributes = ['*'] ) : Collection Find all entities.
findBy ( string $attribute, string $value, array $attributes = ['*'] ) : object Find an entity by one of it's attributes.
findWhere ( array $where, array $attributes = ['*'] ) : Collection Find all entities matching where conditions.
findWhereIn ( array $where, array $attributes = ['*'] ) : Collection Find all entities matching whereIn conditions.
findWhereNotIn ( array $where, array $attributes = ['*'] ) : Collection Find all entities matching whereNotIn conditions.
getContainer ( string | null $service = null ) : object Get the IoC container instance or any of it's services.
getModel ( ) : string Get the repository model.
getRepositoryId ( ) : string Get the repository identifier.
limit ( integer $limit ) Set the "limit" value of the query.
offset ( integer $offset ) Set the "offset" value of the query.
orderBy ( string $attribute, string $direction = 'asc' ) Add an "order by" clause to the query.
paginate ( integer | null $perPage = null, array $attributes = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Paginate all entities.
setContainer ( Illuminate\Contracts\Container\Container $container ) Set the IoC container instance.
setModel ( string $model ) Set the repository model.
setRepositoryId ( string $repositoryId ) Set the repository identifier.
simplePaginate ( integer | null $perPage = null, array $attributes = ['*'], string $pageName = 'page' ) : Illuminate\Contracts\Pagination\Paginator Paginate all entities into a simple paginator.
update ( mixed $id, array $attributes = [] ) : array Update an entity with the given attributes.
where ( string $attribute, string $operator = null, mixed $value = null, string $boolean = 'and' ) Add a basic where clause to the query.
whereIn ( string $attribute, mixed $values, string $boolean = 'and', boolean $not = false ) Add a "where in" clause to the query.
whereNotIn ( string $attribute, mixed $values, string $boolean = 'and' ) Add a "where not in" clause to the query.
with ( array $relations ) Set the relationships that should be eager loaded.

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

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

Dynamically pass missing methods to the model.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

__callStatic() публичный статический Метод

Dynamically pass missing static methods to the model.
public static __callStatic ( $method, $parameters ) : mixed
$method
$parameters
Результат mixed

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

Create a new entity with the given attributes.
public create ( array $attributes = [] ) : array
$attributes array
Результат array

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

Create a new repository model instance.
public createModel ( ) : object
Результат object

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

Delete an entity with the given id.
public delete ( mixed $id ) : array
$id mixed
Результат array

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

Find an entity by it's primary key.
public find ( integer $id, array $attributes = ['*'] ) : object
$id integer
$attributes array
Результат object

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

Find all entities.
public findAll ( array $attributes = ['*'] ) : Collection
$attributes array
Результат Illuminate\Support\Collection

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

Find an entity by one of it's attributes.
public findBy ( string $attribute, string $value, array $attributes = ['*'] ) : object
$attribute string
$value string
$attributes array
Результат object

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

Find all entities matching where conditions.
public findWhere ( array $where, array $attributes = ['*'] ) : Collection
$where array
$attributes array
Результат Illuminate\Support\Collection

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

Find all entities matching whereIn conditions.
public findWhereIn ( array $where, array $attributes = ['*'] ) : Collection
$where array
$attributes array
Результат Illuminate\Support\Collection

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

Find all entities matching whereNotIn conditions.
public findWhereNotIn ( array $where, array $attributes = ['*'] ) : Collection
$where array
$attributes array
Результат Illuminate\Support\Collection

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

Get the IoC container instance or any of it's services.
public getContainer ( string | null $service = null ) : object
$service string | null
Результат object

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

Get the repository model.
public getModel ( ) : string
Результат string

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

Get the repository identifier.
public getRepositoryId ( ) : string
Результат string

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

Set the "limit" value of the query.
public limit ( integer $limit )
$limit integer

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

Set the "offset" value of the query.
public offset ( integer $offset )
$offset integer

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

Add an "order by" clause to the query.
public orderBy ( string $attribute, string $direction = 'asc' )
$attribute string
$direction string

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

Paginate all entities.
public paginate ( integer | null $perPage = null, array $attributes = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer | null
$attributes array
$pageName string
$page integer | null
Результат Illuminate\Contracts\Pagination\LengthAwarePaginator

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

Set the IoC container instance.
public setContainer ( Illuminate\Contracts\Container\Container $container )
$container Illuminate\Contracts\Container\Container

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

Set the repository model.
public setModel ( string $model )
$model string

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

Set the repository identifier.
public setRepositoryId ( string $repositoryId )
$repositoryId string

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

Paginate all entities into a simple paginator.
public simplePaginate ( integer | null $perPage = null, array $attributes = ['*'], string $pageName = 'page' ) : Illuminate\Contracts\Pagination\Paginator
$perPage integer | null
$attributes array
$pageName string
Результат Illuminate\Contracts\Pagination\Paginator

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

Update an entity with the given attributes.
public update ( mixed $id, array $attributes = [] ) : array
$id mixed
$attributes array
Результат array

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

Add a basic where clause to the query.
public where ( string $attribute, string $operator = null, mixed $value = null, string $boolean = 'and' )
$attribute string
$operator string
$value mixed
$boolean string

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

Add a "where in" clause to the query.
public whereIn ( string $attribute, mixed $values, string $boolean = 'and', boolean $not = false )
$attribute string
$values mixed
$boolean string
$not boolean

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

Add a "where not in" clause to the query.
public whereNotIn ( string $attribute, mixed $values, string $boolean = 'and' )
$attribute string
$values mixed
$boolean string

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

Set the relationships that should be eager loaded.
public with ( array $relations )
$relations array