PHP Class 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.
Inheritance: extends HasOne
Afficher le fichier Open project: akeeba/fof Class Usage Examples

Méthodes publiques

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

Method Details

__construct() public méthode

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() public méthode

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