3ca05db5b38fd9f83c5500f7196921987c5dcbf9
[GitHub/WoltLab/woltlab.github.io.git] / docs / package / pip / object-type-definition.md
1 # Object Type Definition Package Installation Plugin
2
3 Registers an object type definition.
4 An object type definition is a blueprint for a certain behaviour that is particularized by [objectTypes](object-type.md).
5 As an example: Tags can be attached to different types of content (such as forum posts or gallery images).
6 The bulk of the work is implemented in a generalized fashion, with all the tags stored in a single database table.
7 Certain things, such as permission checking, need to be particularized for the specific type of content, though.
8 Thus tags (or rather “taggable content”) are registered as an object type definition.
9 Posts are then registered as an object type, implementing the “taggable content” behaviour.
10
11 Other types of object type definitions include attachments, likes, polls, subscriptions, or even the category system.
12
13 ## Components
14
15 Each item is described as a `<definition>` element with the mandatory child `<name>` that should follow the naming pattern `<packageIdentifier>.<definition>`, e.g. `com.woltlab.wcf.example`.
16
17 ### `<interfacename>`
18
19 <span class="label label-info">Optional</span>
20
21 The name of the PHP interface [objectTypes](object-type.md) have to implement.
22
23 ## Example
24
25 {jinja{ codebox(
26 "xml",
27 "package/pip/objectTypeDefinition.xml",
28 "objectTypeDefinition.xml"
29 ) }}