MODX Revolution Object Cheat Sheet: modTemplate

modTemplate (2.8.3-pl)

Table Fields


    [id] =>
    [source] => 0
    [property_preprocess] => 0
    [templatename] =>
    [description] => Template
    [editor_type] => 0
    [category] => 0
    [icon] =>
    [template_type] => 0
    [content] =>
    [locked] => 0
    [properties] =>
    [static] => 0
    [static_file] =>

Validation Rules


    [templatename] =>         
            [invalid] =>
                    [type] => preg_match
                    [rule] => /^?!\s[a-zA-Z0-9\x23-\x2f\x3a\x5b-\x5d\x7f-\xff-_\s]+? template_err_invalid_name

Index Meta


    [PRIMARY] =>
            [alias] => PRIMARY
            [primary] => 1
            [unique] => 1
            [type] => BTREE
            [columns] =>
                    [id] =>
                            [length] =>
                            [collation] => A
                            [null] =>

    [templatename] =>
            [alias] => templatename
            [primary] =>
            [unique] => 1
            [type] => BTREE
            [columns] =>
                    [templatename] =>
                            [length] =>
                            [collation] => A
                            [null] =>

    [category] =>
            [alias] => category
            [primary] =>
            [unique] =>
            [type] => BTREE
            [columns] =>
                    [category] =>
                            [length] =>
                            [collation] => A
                            [null] =>

    [locked] =>
            [alias] => locked
            [primary] =>
            [unique] =>
            [type] => BTREE
            [columns] =>
                    [locked] =>
                            [length] =>
                            [collation] => A
                            [null] =>

    [static] =>
            [alias] => static
            [primary] =>
            [unique] =>
            [type] => BTREE
            [columns] =>
                    [static] =>
                            [length] =>
                            [collation] => A
                            [null] =>

Field Aliases




Table Construction meta defined in schema


    [id] =>
            [dbtype] => int
            [precision] => 10
            [attributes] => unsigned
            [phptype] => integer
            [null] =>
            [index] => pk
            [generated] => native

    [source] =>
            [dbtype] => int
            [attributes] => unsigned
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => fk

    [property_preprocess] =>
            [dbtype] => tinyint
            [precision] => 1
            [attributes] => unsigned
            [phptype] => boolean
            [null] =>
            [default] => 0

    [templatename] =>
            [dbtype] => varchar
            [precision] => 50
            [phptype] => string
            [null] =>
            [default] =>
            [index] => unique

    [description] =>
            [dbtype] => varchar
            [precision] => 191
            [phptype] => string
            [null] =>
            [default] => Template

    [editor_type] =>
            [dbtype] => int
            [precision] => 11
            [phptype] => integer
            [null] =>
            [default] => 0

    [category] =>
            [dbtype] => int
            [precision] => 11
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => fk

    [icon] =>
            [dbtype] => varchar
            [precision] => 191
            [phptype] => string
            [null] =>
            [default] =>

    [template_type] =>
            [dbtype] => int
            [precision] => 11
            [phptype] => integer
            [null] =>
            [default] => 0

    [content] =>
            [dbtype] => mediumtext
            [phptype] => string
            [null] =>
            [default] =>

    [locked] =>
            [dbtype] => tinyint
            [precision] => 1
            [attributes] => unsigned
            [phptype] => boolean
            [null] =>
            [default] => 0
            [index] => index

    [properties] =>
            [dbtype] => text
            [phptype] => array
            [null] => 1

    [static] =>
            [dbtype] => tinyint
            [precision] => 1
            [attributes] => unsigned
            [phptype] => boolean
            [null] =>
            [default] => 0
            [index] => index

    [static_file] =>
            [dbtype] => varchar
            [precision] => 191
            [phptype] => string
            [null] =>
            [default] =>

Aggregate Relations


    [CategoryAcls] =>
            [class] => modAccessCategory
            [local] => category
            [foreign] => target
            [owner] => local
            [cardinality] => many

    [Source] =>
            [class] => sources.modMediaSource
            [local] => source
            [foreign] => id
            [owner] => foreign
            [cardinality] => one

    [Category] =>
            [class] => modCategory
            [local] => category
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [Resources] =>
            [class] => modResource
            [local] => id
            [foreign] => template
            [cardinality] => many
            [owner] => local

Composite Relations


    [Acls] =>
            [class] => modAccessElement
            [local] => id
            [foreign] => target
            [owner] => local
            [cardinality] => many


    [PropertySets] =>
            [class] => modElementPropertySet
            [local] => id
            [foreign] => element
            [owner] => local
            [cardinality] => many
            [criteria] =>
                    [foreign] =>
                            [element_class] => modTemplate

    [TemplateVarTemplates] =>
            [class] => modTemplateVarTemplate
            [local] => id
            [foreign] => templateid
            [cardinality] => many
            [owner] => local

Ancestors


    [0] => modTemplate
    [1] => modElement
    [2] => modAccessibleSimpleObject
    [3] => modAccessibleObject
    [4] => xPDOObject