Get a field by name
Field instance to add, or field name to get
The field - throws if not found
Get the get flag for all fields in the Mjoin instance.
True if gettable, false otherwise.
Set the get flag for all fields in the Mjoin instance.
When set to false no read operations will occur on the join tables.
true to mark as readable, false otherwise
Self for chaining
Add a left join condition to the Mjoin instance, allowing it to operate over multiple tables.
In this form the method will take a function as the second parameter which is a Knex callback function allowing a complex join expression to be built.
Table name to do a join onto
Self for chaining
Add a left join condition to the Mjoin instance, allowing it to operate over multiple tables.
Table name to do a join onto
Field from the parent table to use as the join link
Join condition (=, '<`, etc)
Field from the child table to use as the join link
Self for chaining
Create a join link between two tables. The order of the fields does not matter, but each field must contain the table name as well as the field name.
This method can be called a maximum of two times for an Mjoin instance:
Please refer to the Editor Mjoin documentation for further details: https://editor.datatables.net/manual/php
Table and field name
Table and field name
Self for chaining
Get the instance's configured name.
The name of the Join is the JSON property key that is used when
'getting' the data, and the HTTP property key (in a JSON style) when
'setting' data. Typically the name of the db table will be used here,
but this method allows that to be overridden.
Current name.
InternalGet options for the fields in this join.
Options object
Database connection object
Refresh indication flag
Get the column name to order the data by
SQL column name
Specify the property that the data will be sorted by.
SQL column name to order the data by
Self for chaining
Set the field's set configuration.
A field can be marked as read only using this option, to be set only during an create or edit action or to be set during both actions. This provides the ability to have fields that are only set when a new row is created (for example a "created" time stamp).
Set flag.
Self for chaining.
Get join table name.
Please note that this will also set the name used by the Join as well. This is for convenience as the JSON output / HTTP input will typically use the same name as the database name. If you want to set a custom name, the name method must be called after this one.
Join table name
Set a validator for the array of data (not on a field basis)
Name of the field that any error should be shown against on the client-side
Callback function for validation
Get the array of conditions applied to the method.
Knex where conditions.
Where condition to add to the query used to get data from the database. Note that this is applied to the child table.
Knex query condition
Self for chaining.
The MJoin class provides a one-to-many join link for Editor. This can be useful in cases were an attribute can take multiple values at the same time - for example cumulative security access levels.
Typically the MJoin class should be used with a link table, but this is optional. Please note that if you don't use a link table you should be aware that on edit the linked rows are deleted and then reinserted, thus if any values should be retained they should also be submitted.
Please refer to the Editor Node documentation for further information https://editor.datatables.net/manual/node
Mjoin