Model Configuration

The property gives access to the metadata that was derrived from the projects main Idea file. This can be used to dynamically generate code.
Copy
NOTE:  depends on your configuration.
You can also access these action easier through a plugin like the following.
Copy

icon

Returns the value. These names are from Font Awesome. For example, would be used as .

Schema Example

Copy

Code Example

Copy

label

Returns the model names. This is an array of strings that consist of the singular and plural name of the model.

Schema Example

Copy

Code Example

Copy

plural

Returns the model plural .

Schema Example

Copy

Code Example

Copy

singular

Returns the schema singular .

Schema Example

Copy

Code Example

Copy

camel

Returns the camel cased version of the model name.
Copy
Copy

dash

Returns the dashed version of the model name.
Copy
Copy

lower

Returns the lower case version of the model name.
Copy
Copy

snake

Returns the snake version of the model name.
Copy
Copy

title

Returns the title version of the model name.
Copy
Copy

enums

Returns all the columns with types that are .

Schema Example

Copy

Code Example

Copy

fieldsets

Returns all the columns with types that are fieldsets.

Schema Example

Copy

Code Example

Copy

ids

Returns all the columns with the attribute.

Schema Example

Copy

Code Example

Copy

indexables

Returns all columns that with either the , , or attribute.

Schema Example

Copy

Code Example

Copy

searchables

Returns all the columns with the attribute.

Schema Example

Copy

Code Example

Copy

sortables

Returns all the columns with the attribute.

Schema Example

Copy

Code Example

Copy

uniques

Returns all the columns with the attribute.

Schema Example

Copy

Code Example

Copy

related

Returns all the models with columns related to this model. This is like except it returns the column of the other model that it has a to.

Schema Example

Copy

Code Example

Copy

relations

Returns all the columns with the attribute.

Schema Example

Copy

Code Example

Copy

active

Returns the column with the attribute. If there is one column with this attribute, it will be make the rows in the table restorable, in that when the row is deleted, it will be marked as inactive instead of being actually removed from the database. In turn the row can be set to active again to make it part of the system again.
NOTE: There should only be at most one column with this attribute. This property will only return the first one found.

Schema Example

Copy

Code Example

Copy

created

Returns the column with the attribute. Columns marked with this attribute are automatically set to the current date and time when the table row is created.
NOTE: There should only be at most one column with this attribute. This property will only return the first one found.

Schema Example

Copy

Code Example

Copy

updated

Returns the column with the attribute. Columns marked with this attribute are automatically updated to the current date and time when the table row is updated.
NOTE: There should only be at most one column with this attribute. This property will only return the first one found.

Schema Example

Copy

Code Example

Copy

fields

Returns all the columns with the attribute. Field columns are used in the create and update forms. You can find all the field attributes in the Schema Specifications.

Schema Example

Copy

Code Example

Copy

filters

Returns all the columns with the attribute. Filter columns are used in the search filter form. You can find all the filter attributes in the Schema Specifications.

Schema Example

Copy

Code Example

Copy

lists

Returns all the columns with that are listable. Listable columns are used in the search results. You can find all the list attributes in the Schema Specifications.
NOTE: All columns by default are listable. This property will only return the columns that are not hidden.
To make a column not listable, use the attribute.

Schema Example

Copy
Copy

Code Example

Copy

spans

Returns all the columns with the attribute. Span columns are used in the search filter form. You can find all the span attributes in the Schema Specifications.

Schema Example

Copy

Code Example

Copy

views

Returns all the columns with that are viewable. Viewable columns are used in detail pages. You can find all the view attributes in the Schema Specifications.
NOTE: All columns by default are viewable. This property will only return the columns that are not hidden.
To make a column not viewable, use the attribute.

Schema Example

Copy
Copy

Code Example

Copy

assertions

Returns all the columns with the attribute. Validation columns are used validate insertions and updates. You can find all the validation attributes in the Schema Specifications.

Schema Example

Copy

Code Example

Copy

defaults

Returns all the columns with the attribute.

Schema Example

Copy

Code Example

Copy

encrypted

Returns all the columns with the attribute. Encrypted columns will automatically be encrypted when inserted into the database and decrypted when read from the database.

Schema Example

Copy

Code Example

Copy

query

Returns the value. These are used to configure the query builder by defining what column you want to return. For example you may want to join tables in the results.

Schema Example

The following example will add the columns to the query builder. This means that when you query the model, it will also return the columns joined per row. This is assuming that the model has a relation to the model.
Copy

Code Example

Copy
Copy
Copy

restorable

Returns true if the model is restorable. This is determined if at least one column has the attribute.

Schema Example

Copy

Code Example

Copy

template

Returns the value. This value is used to compute the label that will be represented for each row. This is useful for autocompletes fields and drop downs.

Schema Example

Copy

Code Example

Copy

assert()

Asserts the values and returns errors. If no errors, will return .
Copy

column()

Returns a column by name. If no column is found, it will return.
Copy

filter()

Removes values that are not columns
Copy

fromSnake()

Finds a column by snake case name. This was added to map database column names to the model column names.
Copy

input()

Removes values that are not columns or (strict) input fields. This is useful for forms that only allow certain fields to be submitted.

Schema Example

Copy

Code Example

Copy
Copy

render()

Renders a template given the data.

Schema Example

Copy

Code Example

Copy

serialize()

Serializes values to be inserted into the database
Copy

unserialize()

Unserializes all values coming from the database.
Copy