PHP Класс LMongo\Eloquent\Relations\Relation

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

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

Свойство Тип Описание
$parent LMongo\Eloquent\Model The parent model instance.
$query LMongo\Eloquent\Builder The Eloquent query builder instance.
$related LMongo\Eloquent\Model The related model instance.

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

Метод Описание
__call ( string $method, array $parameters ) : mixed Handle dynamic method calls to the relationship.
__construct ( Builder $query, Model $parent ) : void Create a new relation instance.
addConstraints ( ) : void Set the base constraints on the relation query.
addEagerConstraints ( array $models ) : void Set the constraints for an eager load of the relation.
createdAt ( ) : string Get the name of the "created at" column.
getAndResetWheres ( ) : array Remove the original where clause set by the relationship.
getBaseQuery ( ) : Builder Get the base query builder driving the Eloquent builder.
getParent ( ) : Model Get the parent model of the relation.
getQuery ( ) : Builder Get the underlying query for the relation.
getRelated ( ) : Model Get the related model of the relation.
getResults ( ) : mixed Get the results of the relationship.
initRelation ( array $models, string $relation ) : void Initialize the relation on a set of models.
match ( array $models, Collection $results, string $relation ) : array Match the eagerly loaded results to their parents.
rawUpdate ( array $attributes = [] ) : integer Run a raw update against the base query.
relatedUpdatedAt ( ) : string Get the name of the related model's "updated at" column.
restore ( ) : integer Restore all of the soft deleted related models.
touch ( ) : void Touch all of the related models for the relationship.
updatedAt ( ) : string Get the name of the "updated at" column.

Защищенные методы

Метод Описание
getKeys ( array $models ) : array Get all of the primary keys for an array of models.
removeFirstWhereClause ( ) : void Remove the first where clause from the relationship query.
removeSecondWhereClause ( ) : void Remove the second where clause from the relationship query.

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

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

Handle dynamic method calls to the relationship.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

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

Create a new relation instance.
public __construct ( Builder $query, Model $parent ) : void
$query LMongo\Eloquent\Builder
$parent LMongo\Eloquent\Model
Результат void

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

Set the base constraints on the relation query.
abstract public addConstraints ( ) : void
Результат void

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

Set the constraints for an eager load of the relation.
abstract public addEagerConstraints ( array $models ) : void
$models array
Результат void

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

Get the name of the "created at" column.
public createdAt ( ) : string
Результат string

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

The remaining constraints on the query will be reset and returned.
public getAndResetWheres ( ) : array
Результат array

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

Get the base query builder driving the Eloquent builder.
public getBaseQuery ( ) : Builder
Результат LMongo\Query\Builder

getKeys() защищенный Метод

Get all of the primary keys for an array of models.
protected getKeys ( array $models ) : array
$models array
Результат array

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

Get the parent model of the relation.
public getParent ( ) : Model
Результат LMongo\Eloquent\Model

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

Get the underlying query for the relation.
public getQuery ( ) : Builder
Результат LMongo\Eloquent\Builder

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

Get the related model of the relation.
public getRelated ( ) : Model
Результат LMongo\Eloquent\Model

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

Get the results of the relationship.
abstract public getResults ( ) : mixed
Результат mixed

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

Initialize the relation on a set of models.
abstract public initRelation ( array $models, string $relation ) : void
$models array
$relation string
Результат void

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

Match the eagerly loaded results to their parents.
abstract public match ( array $models, Collection $results, string $relation ) : array
$models array
$results LMongo\Eloquent\Collection
$relation string
Результат array

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

Run a raw update against the base query.
public rawUpdate ( array $attributes = [] ) : integer
$attributes array
Результат integer

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

Get the name of the related model's "updated at" column.
public relatedUpdatedAt ( ) : string
Результат string

removeFirstWhereClause() защищенный Метод

Remove the first where clause from the relationship query.
protected removeFirstWhereClause ( ) : void
Результат void

removeSecondWhereClause() защищенный Метод

Remove the second where clause from the relationship query.
protected removeSecondWhereClause ( ) : void
Результат void

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

Restore all of the soft deleted related models.
public restore ( ) : integer
Результат integer

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

Touch all of the related models for the relationship.
public touch ( ) : void
Результат void

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

Get the name of the "updated at" column.
public updatedAt ( ) : string
Результат string

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

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

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

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

The Eloquent query builder instance.
protected Builder,LMongo\Eloquent $query
Результат LMongo\Eloquent\Builder