contentbox.models

Class BaseEntityMethods

lucee.Component
    extended by contentbox.models.BaseEntityMethods
Direct Known Subclasses:
BaseEntity , BaseContent , ContentTemplate , BaseMenuItem , BaseSubscription

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- This is an abstract class that represents base entity methods. We created this due to the stupid bug in ACF 9-2016, where the mapped super class is not respected in table inheritance

Class Attributes:
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any cachebox


    • access = public
    • returntype = any
    • inject = provider:cachebox
    • persistent = false
    true false
    any coldbox


    • access = public
    • returntype = any
    • inject = provider:coldbox
    • persistent = false
    true false
    any interceptorService


    • access = public
    • returntype = any
    • inject = provider:coldbox:interceptorService
    • persistent = false
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    • persistent = false
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any appendToMemento(any collection, [any target='defaultIncludes'])
         Append an incoming array of properties to a memento list target.
    any appendToMementoProfile(any collection, any profile, [any target='defaultIncludes'])
         Append an incoming array of properties to a memento list target for a specific profile.
    private array arrayWrap(any items)
         convert one or a list of permissions to an array, if it's an array we don't touch it.
    string getDisplayCreatedDate([any dateFormat='[runtime expression]'], [any timeFormat='[runtime expression]'])
         Get the created date in the default or specific date/time format.
    string getDisplayModifiedDate([any dateFormat='[runtime expression]'], [any timeFormat='[runtime expression]'])
         Get the modified date in the default or specific date/time format.
    any getEntityName()
         Get the entity name.
    any getId()
         Shortcut to get the id of the object using the this.
    any includeMixin(any helper)
         Pass in a helper path and load it into this object as a mixin.
    boolean isLoaded()
         Verify if entity is loaded or not.
    void preInsert()
         pre insertion procedures.
    void preUpdate([struct oldData])
         pre update procedures.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    cachebox

    property any cachebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:cachebox
    persistent - false
    serializable - true

    coldbox

    property any coldbox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:coldbox
    persistent - false
    serializable - true

    interceptorService

    property any interceptorService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:coldbox:interceptorService
    persistent - false
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    persistent - false
    serializable - true

    Method Detail

    appendToMemento

    public any appendToMemento(any collection, [any target='defaultIncludes'])

    Append an incoming array of properties to a memento list target

    Parameters:
    collection - The array to append
    target - The target to append to: defaultIncludes, defaultExcludes, neverInclude, defaults, etc.

    appendToMementoProfile

    public any appendToMementoProfile(any collection, any profile, [any target='defaultIncludes'])

    Append an incoming array of properties to a memento list target for a specific profile

    Parameters:
    collection - The array to append
    profile - The profile to append to: export, import, etc.
    target - The target to append to: defaultIncludes, defaultExcludes, neverInclude, defaults, etc.

    arrayWrap

    private array arrayWrap(any items)

    convert one or a list of permissions to an array, if it's an array we don't touch it

    Parameters:
    items - One, a list or an array
    Returns:
    An array

    getDisplayCreatedDate

    public string getDisplayCreatedDate([any dateFormat='[runtime expression]'], [any timeFormat='[runtime expression]'])

    Get the created date in the default or specific date/time format

    Parameters:
    dateFormat - The date format to use, defaulted by ContentBox to mmm dd, yyyy
    timeFormat - The time format to use, defaulted by ContentBox to HH:mm:ss z

    getDisplayModifiedDate

    public string getDisplayModifiedDate([any dateFormat='[runtime expression]'], [any timeFormat='[runtime expression]'])

    Get the modified date in the default or specific date/time format

    Parameters:
    dateFormat - The date format to use, defaulted by ContentBox to mmm dd, yyyy
    timeFormat - The time format to use, defaulted by ContentBox to HH:mm:ss z

    getEntityName

    public any getEntityName()

    Get the entity name


    getId

    public any getId()

    Shortcut to get the id of the object using the this.pk

    Returns:
    The id of the object or empty value if not loaded

    includeMixin

    public any includeMixin(any helper)

    Pass in a helper path and load it into this object as a mixin

    Parameters:
    helper - The path to the helper to load.
    Throws:
    ContentHelperNotFoundException - When the passed helper is not found

    isLoaded

    public boolean isLoaded()

    Verify if entity is loaded or not


    preInsert

    public void preInsert()

    pre insertion procedures


    preUpdate

    public void preUpdate([struct oldData])

    pre update procedures

    Parameters:
    oldData