PHP Трейт TORM\HasMany

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

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

Метод Описание
hasHasMany ( string $attr ) : boolean Check if there is a has many association
hasMany ( string $attr, mixed $options = null ) : null Create a has many relationship
hasManyClass ( string $attr ) : the Check class from a relation, like hasManyClass("tickets") => "Ticket"
hasManyForeignKey ( string $attr ) : string Check if there is a has many foreign key
push ( mixed $obj ) : pushed Push an objet to a has many association

Приватные методы

Метод Описание
_checkAndReturnMany ( string $method, mixed $value ) : has Check a has many association and returns it resolved, if exists.
_nullNotPresentIds ( string $klass, string $foreign, mixed $ids, string $id ) : null Nullify foreign class keys not present in array
_pushLater ( mixed $obj ) : null Send an object to push later
_resolveCollection ( string $attr, mixed $values ) : collections Set values to a has many association, from an array
_resolveHasMany ( string $attr, mixed $value ) : collection Resolve the has many association and returns the collection with values
_resolveIds ( string $attr, mixed $values = null ) : ids Resolve has many ids

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

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

Check if there is a has many association
public static hasHasMany ( string $attr ) : boolean
$attr string attribute to check
Результат boolean

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

Create a has many relationship
public static hasMany ( string $attr, mixed $options = null ) : null
$attr string attribute
$options mixed to use
Результат null

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

Check class from a relation, like hasManyClass("tickets") => "Ticket"
public static hasManyClass ( string $attr ) : the
$attr string attribute to check
Результат the class

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

Check if there is a has many foreign key
public static hasManyForeignKey ( string $attr ) : string
$attr string attribute
Результат string foreign key

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

Push an objet to a has many association
public push ( mixed $obj ) : pushed
$obj mixed object
Результат pushed