PHP Класс FOF30\Model\DataModel\Relation\BelongsTo

For example, parentModel is Articles and foreignModel is Users. Each article belongs to one user. One user can have one or more article. Example #2: parentModel is Phones and foreignModel is Users. Each phone belongs to one user. One user can have zero or one phones.
Наследование: extends HasOne
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( DataModel $parentModel, string $foreignModelName, string $localKey = null, string $foreignKey = null, string $pivotTable = null, string $pivotLocalKey = null, string $pivotForeignKey = null ) Public constructor. Initialises the relation.
getNew ( ) This is not supported by the belongsTo relation

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

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

Public constructor. Initialises the relation.
public __construct ( DataModel $parentModel, string $foreignModelName, string $localKey = null, string $foreignKey = null, string $pivotTable = null, string $pivotLocalKey = null, string $pivotForeignKey = null )
$parentModel FOF30\Model\DataModel The data model we are attached to
$foreignModelName string The name of the foreign key's model in the format "modelName@com_something"
$localKey string The local table key for this relation, default: parentModel's ID field name
$foreignKey string The foreign key for this relation, default: parentModel's ID field name
$pivotTable string IGNORED
$pivotLocalKey string IGNORED
$pivotForeignKey string IGNORED

getNew() публичный метод

This is not supported by the belongsTo relation
public getNew ( )