...
Log Behavior
XXX
Enumerations
XXX
Non-Standard Foreign Key Relations
Normally, a relation can simply be defined using something like
Code Block |
---|
$this->belongsTo('Types') |
which implies the current table has a columns type_id
. However, sometimes it is necessary or desirable to use a different foreign key name, such as default_type_id
. This can be accomplished with something like
Code Block |
---|
$this->belongsTo('Types')->setForeignKey('default_type_id'); |
Registry's foreign key checks further require a property to be set so that ruleValidateCO
can properly validate foreign keys at run time. This can be accomplished by setting a property with the name of the foreign key without the _id
:
Code Block |
---|
$this->belongsTo('Type')->setForeignKey('default_type_id')->setProperty('default_type'); |
Localizations
When localizing text strings, use the table name and/or field name as is whenever possible.
...