PHP Class Rinvex\Repository\Repositories\BaseRepository

Inheritance: implements Rinvex\Repository\Contracts\RepositoryContract, implements Rinvex\Repository\Contracts\CacheableContract, use trait Rinvex\Repository\Traits\Cacheable
Show file Open project: rinvex/repository

Protected Properties

Property Type Description
$container Illuminate\Contracts\Container\Container The IoC container instance.
$limit integer The "limit" value of the query.
$model string The repository model.
$offset integer The "offset" value of the query.
$orderBy array The column to order results by.
$relations array The relations to eager load on query execution.
$repositoryId string The repository identifier.
$where array The query where clauses.
$whereIn array The query whereIn clauses.
$whereNotIn array The query whereNotIn clauses.

Public Methods

Method Description
__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.
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.
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.
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.

Protected Methods

Method Description
executeCallback ( string $class, string $method, array $args, Closure $closure ) : mixed Execute given callback and return the result.
prepareQuery ( object $model ) : object Prepare query.
resetRepository ( ) Reset repository to it's defaults.

Method Details

__call() public method

Dynamically pass missing methods to the model.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed

__callStatic() public static method

Dynamically pass missing static methods to the model.
public static __callStatic ( $method, $parameters ) : mixed
$method
$parameters
return mixed

executeCallback() protected method

Execute given callback and return the result.
protected executeCallback ( string $class, string $method, array $args, Closure $closure ) : mixed
$class string
$method string
$args array
$closure Closure
return mixed

getContainer() public method

Get the IoC container instance or any of it's services.
public getContainer ( string | null $service = null ) : object
$service string | null
return object

getModel() public method

Get the repository model.
public getModel ( ) : string
return string

getRepositoryId() public method

Get the repository identifier.
public getRepositoryId ( ) : string
return string

limit() public method

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

offset() public method

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

orderBy() public method

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

prepareQuery() protected method

Prepare query.
protected prepareQuery ( object $model ) : object
$model object
return object

resetRepository() protected method

Reset repository to it's defaults.
protected resetRepository ( )

setContainer() public method

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

setModel() public method

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

setRepositoryId() public method

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

where() public method

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() public method

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() public method

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() public method

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

Property Details

$container protected property

The IoC container instance.
protected Container,Illuminate\Contracts\Container $container
return Illuminate\Contracts\Container\Container

$limit protected property

The "limit" value of the query.
protected int $limit
return integer

$model protected property

The repository model.
protected string $model
return string

$offset protected property

The "offset" value of the query.
protected int $offset
return integer

$orderBy protected property

The column to order results by.
protected array $orderBy
return array

$relations protected property

The relations to eager load on query execution.
protected array $relations
return array

$repositoryId protected property

The repository identifier.
protected string $repositoryId
return string

$where protected property

The query where clauses.
protected array $where
return array

$whereIn protected property

The query whereIn clauses.
protected array $whereIn
return array

$whereNotIn protected property

The query whereNotIn clauses.
protected array $whereNotIn
return array