[Top]
Fins
Fins.Model
Fins.Model.DataObject
|
Method Fins.Model.DataObject()->has_many()
- Method
has_many
-
void has_many(.DataModelContext context, string other_type, string|void my_name, string|void other_field)
- Description
-
define a one to many relationship in which the local object is referred to
by one or more objects of another datatype. this method defines the reverse of
belongs_to . note that a datatype that uses this method won't have a field
in the corresponding "local" database table that contains the reference
information. as a result, the parameters in this method don't use database
field names at all, unlike belongs_to .
- Parameter other_type
-
pluralized version of the data type name (not the table name) of the type the field references.
- Parameter my_name
-
an optional attribute used to specify the name the object will be available
as in the current object. The default, if not specified, is the pluralized name of the
other type.
- Parameter other_field
-
the name of the field in the other datatype (not a database field name) that
represents the link to this data type. If you used belongs_to and specified an alternate
value for the my_name attribute, you'll need to provide that value to this parameter as well.
|