API Documentation for: 1.1.1
Show:

Config Class

Data class which represents a single config property. Located in the namespace Canteen\Services\Objects.

Methods

add

() protected

Inherited from ObjectForm:

Add a new object

autoDetectType

(
  • value
)
String private

Provided by the Canteen\Forms module.

Auto detect the value type

Parameters:

  • value String

    The value to check

Returns:

String:

The value type (boolean, string, integer)

error

(
  • message
)
protected

Inherited from Form:

Convenience function for passing an error to the form factory

Parameters:

  • message String

    The str error to pass

getData

(
  • name
  • value
)
protected

Inherited from Form:

Save the form data to the form factory

Parameters:

  • name String

    The name of the variable to save

  • value Mixed

    The value of the variable to save

getObject

(
  • id
)
Object private

Inherited from ObjectForm:

Generalized get object by ID

Parameters:

  • id Int

    The unique object id

Returns:

Object:

The object, or null

onBeforeAdd

(
  • event
)

Provided by the Canteen\Forms module.

Delete a config variable

Parameters:

onBeforeRemove

(
  • event
)

Provided by the Canteen\Forms module.

Delete a config variable

Parameters:

onBeforeUpdate

(
  • event
)

Provided by the Canteen\Forms module.

Do some checking before updating

Parameters:

parse

(
  • content
  • substitutions
)
String protected

Inherited from CanteenBase

Convenience method for parsing content

Parameters:

  • content String

    The string to parse

  • substitutions Dictionary

    The dictionary of tags to replace

Returns:

String:

The parsed string

privilege

(
  • [required=Privilege::GUEST]
)
protected

Inherited from Form:

You can run to make sure a process requires a particular privilege

Parameters:

  • [required=Privilege::GUEST] Int optional

    The privilege level required, default is anonymous

remove

() protected

Inherited from ObjectForm:

Generalized remove function

service

(
  • alias
)
Service protected

Inherited from CanteenBase:

Get a service by alias

Parameters:

Returns:

Service:

The service matching the alias

success

(
  • message
)
protected

Inherited from Form:

Convenience function for passing a success message to the form factory

Parameters:

  • message String

    The str success message to pass

template

(
  • name
  • [substitutions=[]
)
String protected

Inherited from CanteenBase:

Convenience method for parsing content

Parameters:

  • name String

    The name of the template to parse

  • [substitutions=[] Dictionary optional

    The dictionary of tags to replace

Returns:

String:

The parsed string

update

() protected

Inherited from ObjectForm:

Update the object

validate

() private

Inherited from ObjectForm:

Do some initial sanitize

verify

(
  • data
  • [type=null]
  • [suppressErrors=false]
)
Mixed protected

Inherited from Form:

Sanitize input data using the validation types above

Parameters:

  • data Mixed

    The data to be validated, can be an array of items

  • [type=null] RegExp optional

    The type of validation, defaults to Numeric. Can also be an array set of items

  • [suppressErrors=false] Boolean optional

    If we should suppress throwing errors

Returns:

Mixed:

If we don't verify and suppress errors, returns false, else returns the data

Properties

access

Int

The settings manager access option

addRedirect

Boolean protected

Inherited from ObjectForm:

If we should redirect after an add

Default: true

cache

ServerCache

Inherited from CanteenBase:

Get the instance of the site cache

id

Int

The unique config id

ifError

Boolean

Inherited from Form:

If we've reported errors

item

ObjectServiceItem protected

Inherited from ObjectForm:

The object service item reference

name

String

The config name

parser

Parser

Inherited from CanteenBase:

The parser is responsible for rendering templates

profiler

Profiler

Inherited from CanteenBase:

The instance of the profiler for debugging performance

redirect

String protected

Inherited from ObjectForm:

The redirect uri after remove or add

removeRedirect

Boolean protected

Inherited from ObjectForm:

If we should redirect after a remove

Default: true

settings

SettingsManager

Inherited from CanteenBase:

Get the instance of the settings manager

site

Site

Inherited from CanteenBase:

Convenience getter for the site

type

Sring

Either string, integer, boolean, page, or path

updateNothingError

Boolean protected

Inherited from ObjectForm:

If we should do the update nothing error

Default: true

updateRedirect

Boolean protected

Inherited from ObjectForm:

If we should redirect after an update

Default: true

user

Authorization

Inherited from CanteenBase:

Get the Authorization class to handle things like login, password change

value

Mixed

The value of the config