PHP Class App\Data\Repositories\Repository

Afficher le fichier Open project: Vinelab/lucid

Protected Properties

Свойство Type Description
$model Illuminate\Database\Eloquent\Model The model instance.

Méthodes publiques

Méthode Description
__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.

Method Details

__call() public méthode

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
Résultat mixed

__construct() public méthode

public __construct ( $model )

all() public méthode

Returns all the records.
public all ( ) : Illuminate\Database\Eloquent\Collection
Résultat Illuminate\Database\Eloquent\Collection

count() public méthode

Returns the count of all the records.
public count ( ) : integer
Résultat integer

fill() public méthode

Fills out an instance of the model with $attributes.
public fill ( array $attributes ) : Model
$attributes array
Résultat Illuminate\Database\Eloquent\Model

fillAndSave() public méthode

Fills out an instance of the model and saves it, pretty much like mass assignment.
public fillAndSave ( array $attributes ) : Model
$attributes array
Résultat Illuminate\Database\Eloquent\Model

find() public méthode

Find a record by its identifier.
public find ( string $id, array $relations = null ) : Model
$id string
$relations array
Résultat Illuminate\Database\Eloquent\Model

findBy() public méthode

Fails if no model is found.
public findBy ( string $attribute, string $value, array $relations = null ) : Model
$attribute string
$value string
$relations array
Résultat Illuminate\Database\Eloquent\Model

first() public méthode

Returns the first record in the database.
public first ( ) : Model
Résultat Illuminate\Database\Eloquent\Model

getByAttributes() public méthode

Two operators values are handled: AND | OR.
public getByAttributes ( array $attributes, string $operator = 'AND', array $relations = null ) : Collection
$attributes array
$operator string
$relations array
Résultat Illuminate\Support\Collection

page() public méthode

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
Résultat Illuminate\Database\Eloquent\Collection

remove() public méthode

Remove a selected record.
public remove ( string $key ) : boolean
$key string
Résultat boolean

Property Details

$model protected_oe property

The model instance.
protected Model,Illuminate\Database\Eloquent $model
Résultat Illuminate\Database\Eloquent\Model