Template Reference
element-templates
Elements and their structure.
element-template
Attribute | Values |
---|---|
element | project, module, region, comment, entity, index, field, association, many-to-many, inheritance, many-to-many-entity, inheritance-parent, inheritance-child |
use-case | create, update, template |
selector | primary-field, new-project, association-field, many-to-many-field, discriminator-field, many-to-many-entity |
Selectors
selector | allowed element | used when |
---|---|---|
project_new | project | new project is created |
primary_field | field | project is imported |
association-field | field | association is created |
discriminator-field | field | inheritance is created |
many-to-many-field | field | many-to-many is created |
many-to-many | entity | many-to-many is created |
Selector use
primary-field
Note: Only used for entities without primary key upon project import.
new-project
association-field
discriminator-field
many-to-many-field
many-to-many
Definining many-to-many asociation
Dynamic templates
There is one more use case for templates and selectors. It’s possibe to define custom templates for dynamic fields. These fields are used as templates in GUI in Entity editor.
As use-case select template
, as element enter field
and as selector use any custom value, which will be displayed in GUI.
For example to define uuid
field template, enter following fragment to your configuration:
Substitution marks
List of all substitution marks available for each element.
Element | Selector | Create | Update |
---|---|---|---|
project | none | project | |
module | project | module, project | |
region | module | module, region | |
comment | module | module, comment | |
entity | project, module | project, module, entity | |
field | entity | entity, field | |
field | association | entity-inverse,field-inverse | none |
field | many-to-many | entity-inverse,field-inverse | none |
field | inheritance | entity-parent | none |
index | entity | entity, index | |
inheritance-parent | entity-parent | entity-parrent | |
inheritance-child | entity-parent, entity-child | entity-parent, entity-child | |
association | entity-owner, entity-inverse, collection-inverse | entity-owner, entity-inverse, collection-inverse | |
association-field | entity-owner, field-inverse | none | |
many-to-many | entity-owner, entity-inverse, entity-mn | entity-owner, entity-inverse, entity-mn |
Local name vs Full name
Because Skipper now handles object names with full namespace, each object capable to hold namespace has two substitution marks. One for local name and one for name including namespace. Currently namespace can be configured for entity
, collection
and universal-object
.
Short (local) object name is stored in entity
substitution mark as before. If you want to use full object name, use entity-full
mark. The same is true for all other substitution marks which use any of namespaced objects.
For example entity-inverse
is “User” and entity-inverse-full
is “\Model\Users\User”.
Naming styles
Keyword | Description |
---|---|
#CFU |
CamelCaseFirstUpper |
#CFL |
camelCaseFirstLower |
#UL |
under_line |
#CFUs |
CamelCaseFirstUpper in plural form |
#CFLs |
camelCaseFirstLower in plural form |
#ULs |
under_line in plural form |