MODX Revolution Object Cheat Sheet: modResource

modResource (2.8.3-pl)

Table Fields


    [id] =>
    [type] => document
    [contentType] => text/html
    [pagetitle] =>
    [longtitle] =>
    [description] =>
    [alias] =>
    [alias_visible] => 1
    [link_attributes] =>
    [published] => 0
    [pub_date] => 0
    [unpub_date] => 0
    [parent] => 0
    [isfolder] => 0
    [introtext] =>
    [content] =>
    [richtext] => 1
    [template] => 0
    [menuindex] => 0
    [searchable] => 1
    [cacheable] => 1
    [createdby] => 0
    [createdon] => 0
    [editedby] => 0
    [editedon] => 0
    [deleted] => 0
    [deletedon] => 0
    [deletedby] => 0
    [publishedon] => 0
    [publishedby] => 0
    [menutitle] =>
    [donthit] => 0
    [privateweb] => 0
    [privatemgr] => 0
    [content_dispo] => 0
    [hidemenu] => 0
    [class_key] => modDocument
    [context_key] => web
    [content_type] => 1
    [uri] =>
    [uri_override] => 0
    [hide_children_in_tree] => 0
    [show_in_tree] => 1
    [properties] =>

Validation Rules


        

Index Meta



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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    [content_ft_idx] =>
            [alias] => content_ft_idx
            [primary] =>
            [unique] =>
            [type] => FULLTEXT
            [columns] =>
                    [pagetitle] =>
                            [length] =>
                            [collation] => A
                            [null] =>

                    [longtitle] =>
                            [length] =>
                            [collation] => A
                            [null] =>

                    [description] =>
                            [length] =>
                            [collation] => A
                            [null] =>

                    [introtext] =>
                            [length] =>
                            [collation] => A
                            [null] => 1

                    [content] =>
                            [length] =>
                            [collation] => A
                            [null] => 1

    [cache_refresh_idx] =>
            [alias] => cache_refresh_index
            [primary] =>
            [unique] =>
            [type] => BTREE
            [columns] =>
                    [parent] =>
                            [length] =>
                            [collation] => A
                            [null] =>

                    [menuindex] =>
                            [length] =>
                            [collation] => A
                            [null] =>

                    [id] =>
                            [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

    [type] =>
            [dbtype] => varchar
            [precision] => 20
            [phptype] => string
            [null] =>
            [default] => document

    [contentType] =>
            [dbtype] => varchar
            [precision] => 50
            [phptype] => string
            [null] =>
            [default] => text/html

    [pagetitle] =>
            [dbtype] => varchar
            [precision] => 191
            [phptype] => string
            [null] =>
            [default] =>
            [index] => fulltext
            [indexgrp] => content_ft_idx

    [longtitle] =>
            [dbtype] => varchar
            [precision] => 191
            [phptype] => string
            [null] =>
            [default] =>
            [index] => fulltext
            [indexgrp] => content_ft_idx

    [description] =>
            [dbtype] => text
            [phptype] => string
            [null] =>
            [default] =>
            [index] => fulltext
            [indexgrp] => content_ft_idx

    [alias] =>
            [dbtype] => varchar
            [precision] => 191
            [phptype] => string
            [null] => 1
            [default] =>
            [index] => index

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

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

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

    [pub_date] =>
            [dbtype] => int
            [precision] => 20
            [phptype] => timestamp
            [null] =>
            [default] => 0
            [index] => index

    [unpub_date] =>
            [dbtype] => int
            [precision] => 20
            [phptype] => timestamp
            [null] =>
            [default] => 0
            [index] => index

    [parent] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => index

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

    [introtext] =>
            [dbtype] => text
            [phptype] => string
            [index] => fulltext
            [indexgrp] => content_ft_idx

    [content] =>
            [dbtype] => mediumtext
            [phptype] => string
            [index] => fulltext
            [indexgrp] => content_ft_idx

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

    [template] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => index

    [menuindex] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => index

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

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

    [createdby] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0

    [createdon] =>
            [dbtype] => int
            [precision] => 20
            [phptype] => timestamp
            [null] =>
            [default] => 0

    [editedby] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0

    [editedon] =>
            [dbtype] => int
            [precision] => 20
            [phptype] => timestamp
            [null] =>
            [default] => 0

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

    [deletedon] =>
            [dbtype] => int
            [precision] => 20
            [phptype] => timestamp
            [null] =>
            [default] => 0

    [deletedby] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0

    [publishedon] =>
            [dbtype] => int
            [precision] => 20
            [phptype] => timestamp
            [null] =>
            [default] => 0

    [publishedby] =>
            [dbtype] => int
            [precision] => 10
            [phptype] => integer
            [null] =>
            [default] => 0

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

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

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

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

    [content_dispo] =>
            [dbtype] => tinyint
            [precision] => 1
            [phptype] => integer
            [null] =>
            [default] => 0

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

    [class_key] =>
            [dbtype] => varchar
            [precision] => 100
            [phptype] => string
            [null] =>
            [default] => modDocument
            [index] => index

    [context_key] =>
            [dbtype] => varchar
            [precision] => 100
            [phptype] => string
            [null] =>
            [default] => web
            [index] => index

    [content_type] =>
            [dbtype] => int
            [precision] => 11
            [attributes] => unsigned
            [phptype] => integer
            [null] =>
            [default] => 1

    [uri] =>
            [dbtype] => text
            [phptype] => string
            [null] => 1
            [index] => index

    [uri_override] =>
            [dbtype] => tinyint
            [precision] => 1
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => index

    [hide_children_in_tree] =>
            [dbtype] => tinyint
            [precision] => 1
            [phptype] => integer
            [null] =>
            [default] => 0
            [index] => index

    [show_in_tree] =>
            [dbtype] => tinyint
            [precision] => 1
            [phptype] => integer
            [null] =>
            [default] => 1
            [index] => index

    [properties] =>
            [dbtype] => mediumtext
            [phptype] => json
            [null] => 1

Aggregate Relations


    [Parent] =>
            [class] => modResource
            [local] => parent
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [CreatedBy] =>
            [class] => modUser
            [local] => createdby
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [EditedBy] =>
            [class] => modUser
            [local] => editedby
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [DeletedBy] =>
            [class] => modUser
            [local] => deletedby
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [PublishedBy] =>
            [class] => modUser
            [local] => publishedby
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [Template] =>
            [class] => modTemplate
            [local] => template
            [foreign] => id
            [cardinality] => one
            [owner] => foreign

    [TemplateVars] =>
            [class] => modTemplateVar
            [local] => id:template
            [foreign] => contentid:templateid
            [cardinality] => many
            [owner] => local

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

    [ContentType] =>
            [class] => modContentType
            [local] => content_type
            [foreign] => id
            [owner] => foreign
            [cardinality] => one

    [Context] =>
            [class] => modContext
            [local] => context_key
            [foreign] => key
            [owner] => foreign
            [cardinality] => one

Composite Relations



    [Children] =>
            [class] => modResource
            [local] => id
            [foreign] => parent
            [cardinality] => many
            [owner] => local

    [TemplateVarResources] =>
            [class] => modTemplateVarResource
            [local] => id
            [foreign] => contentid
            [cardinality] => many
            [owner] => local

    [ResourceGroupResources] =>
            [class] => modResourceGroupResource
            [local] => id
            [foreign] => document
            [cardinality] => many
            [owner] => local

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

    [ContextResources] =>
            [class] => modContextResource
            [local] => id
            [foreign] => resource
            [cardinality] => many
            [owner] => local

    [Setting] =>
            [class] => CollectionSetting
            [local] => id
            [foreign] => collection
            [cardinality] => one
            [owner] => local

    [Selection] =>
            [class] => CollectionSelection
            [local] => id
            [foreign] => collection
            [cardinality] => many
            [owner] => local

Ancestors


    [0] => modResource
    [1] => modAccessibleSimpleObject
    [2] => modAccessibleObject
    [3] => xPDOObject

** See the article comparing the modResource object as well as it being extended with the Articles Package.