interceptors

Class Mementifier

lucee.Component
    extended by interceptors.Mementifier

Listen to various entity methods so we can inject our mementifying capabilties to objects. If an object already has a `getMemento()` method, we will inject a `$getMemento()` method so you can still decorate it.

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


    • access = public
    • returntype = any
    • inject = coldbox:moduleSettings:mementifier
    true false
    Method Summary
    any $buildNestedMementoList(any list, any root)
         Build a new memento include/exclude list using the target list and a property root.
    any $injectMixin([any name], [any target])
         Inject mixins into target scopes.
    any afterInstanceCreation([any interceptData])
         Listen to object creations.
    any configure()
         Configure interceptor.
    struct getMemento([any includes=''], [any excludes=''], [struct mappers='[runtime expression]'], [struct defaults='[runtime expression]'], [boolean ignoreDefaults='false'])
         Construct a memento representation from an entity according to includes and exclude lists.
    any ORMPostLoad([any interceptData])
         Listen to entity loads.
    any ORMPostNew([any interceptData])
         Listen to entity creations.
    any processMemento([any entity])
         Process the memento decorations.
     
    Methods inherited from class lucee.Component
    None

    Property Detail

    settings

    property any settings

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:moduleSettings:mementifier
    serializable - true

    Method Detail

    $buildNestedMementoList

    public any $buildNestedMementoList(any list, any root)

    Build a new memento include/exclude list using the target list and a property root

    Parameters:
    list - The list to use for construction
    root - The root to filter out
    Returns:
    A string list of the new hiearchy to use

    $injectMixin

    public any $injectMixin([any name], [any target])

    Inject mixins into target scopes

    Parameters:
    name
    target

    afterInstanceCreation

    public any afterInstanceCreation([any interceptData])

    Listen to object creations

    Parameters:
    interceptData

    configure

    public any configure()

    Configure interceptor


    getMemento

    public struct getMemento([any includes=''], [any excludes=''], [struct mappers='[runtime expression]'], [struct defaults='[runtime expression]'], [boolean ignoreDefaults='false'])

    Construct a memento representation from an entity according to includes and exclude lists

    Parameters:
    includes - The properties array or list to build the memento with alongside the default includes
    excludes - The properties array or list to exclude from the memento alongside the default excludes
    mappers - A struct of key-function pairs that will map properties to closures/lambadas to process the item value. The closure will transform the item value.
    defaults - A struct of key-value pairs that denotes the default values for properties if they are null, defaults for everything are a blank string.
    ignoreDefaults - If set to true, default includes and excludes will be ignored and only the incoming `includes` and `excludes` list will be used.

    ORMPostLoad

    public any ORMPostLoad([any interceptData])

    Listen to entity loads

    Parameters:
    interceptData - true

    ORMPostNew

    public any ORMPostNew([any interceptData])

    Listen to entity creations

    Parameters:
    interceptData - true

    processMemento

    public any processMemento([any entity])

    Process the memento decorations

    Parameters:
    entity - The entity to process