Class modContext

Description

Represents a virtual site context within a modX repository.

Located in /model/modx/modcontext.class.php (line 12)

xPDOObject
   |
   --modAccessibleObject
      |
      --modContext
Variable Summary
Method Summary
 modContext __construct ( &$xpdo)
 void findPolicy ([ $context = ''])
 string getCacheKey ()
 mixed getOption (string $key, [string $default = null], [array $options = null])
 string makeUrl (integer $id, [string $args = ''], [mixed $scheme = -1])
 boolean prepare ([boolean $regenerate = false])
 void remove ([ $ancestors = array()])
 void save ([ $cacheFlag = null])
Variables
mixed $aliasMap = null (line 14)
  • access: public
mixed $config = null (line 13)
  • access: public
mixed $documentListing = null (line 17)
  • access: public
mixed $documentMap = null (line 18)
  • access: public
mixed $eventMap = null (line 19)
  • access: public
mixed $pluginCache = null (line 20)
  • access: public
mixed $resourceListing = null (line 16)
  • access: public
mixed $resourceMap = null (line 15)
  • access: public
mixed $_cacheKey = '[contextKey]/context' (line 21)
  • access: protected

Inherited Variables

Inherited from modAccessibleObject

modAccessibleObject::$_policies

Inherited from xPDOObject

xPDOObject::$container
xPDOObject::$fieldNames
xPDOObject::$xpdo
xPDOObject::$_aggregates
xPDOObject::$_alias
xPDOObject::$_cacheFlag
xPDOObject::$_class
xPDOObject::$_composites
xPDOObject::$_dirty
xPDOObject::$_fieldMeta
xPDOObject::$_fields
xPDOObject::$_lazy
xPDOObject::$_new
xPDOObject::$_options
xPDOObject::$_package
xPDOObject::$_pk
xPDOObject::$_pktype
xPDOObject::$_relatedObjects
xPDOObject::$_table
xPDOObject::$_tableMeta
xPDOObject::$_validated
xPDOObject::$_validationLoaded
xPDOObject::$_validationRules
xPDOObject::$_validator
Methods
Constructor __construct (line 23)
modContext __construct ( &$xpdo)
  • &$xpdo

Redefinition of:
xPDOObject::__construct()
Constructor
findPolicy (line 99)

Loads the access control policies applicable to this element.

  • access: public
void findPolicy ([ $context = ''])
  • $context

Redefinition of:
modAccessibleObject::findPolicy()
Find access policies applicable to this object in a specific context.
getCacheKey (line 85)

Returns the file name representing this context in the cache.

  • return: The cache filename.
  • access: public
string getCacheKey ()
getOption (line 70)

Returns a context-specific setting value.

  • return: The option value or the provided default.
  • access: public
mixed getOption (string $key, [string $default = null], [array $options = null])
  • string $key: The option key to check.
  • string $default: A default value to use if not found.
  • array $options: An array of additional options to merge over top of the context settings.

Redefinition of:
xPDOObject::getOption()
Get an option value for this instance.
makeUrl (line 152)

Generates a URL representing a specified resource in this context.

Note that if this method is called from a context other than the one initialized for the modX instance, and the scheme is not specified, an empty string, or abs, the method will force the scheme to full.

  • return: The URL for the resource.
  • access: public
string makeUrl (integer $id, [string $args = ''], [mixed $scheme = -1])
  • integer $id: The id of a resource.
  • string $args: A query string to append to the generated URL.
  • mixed $scheme: The scheme indicates in what format the URL is generated.
          -1 : (default value) URL is relative to site_url
           0 : see http
           1 : see https
        full : URL is absolute, prepended with site_url from config
         abs : URL is absolute, prepended with base_url from config
        http : URL is absolute, forced to http scheme
       https : URL is absolute, forced to https scheme
prepare (line 40)

Prepare a context for use.

  • return: Indicates if the context was successfully prepared.
  • access: public
  • uses: modCacheManager::generateContext() - This method is responsible for preparing the context for use.
boolean prepare ([boolean $regenerate = false])
  • boolean $regenerate: If true, the existing cache file will be ignored and regenerated.
remove (line 246)

Overrides xPDOObject::remove to fire modX-specific events

{@inheritDoc}

  • access: public
void remove ([ $ancestors = array()])
  • array $ancestors

Redefinition of:
modAccessibleObject::remove()
Custom remove that respects access policies.
save (line 270)

Overrides xPDOObject::save to fire modX-specific events.

{@inheritDoc}

  • access: public
void save ([ $cacheFlag = null])
  • $cacheFlag

Redefinition of:
modAccessibleObject::save()
Custom save that respects access policies.

Inherited Methods

Inherited From modAccessibleObject

 modAccessibleObject::checkPolicy()
 modAccessibleObject::findPolicy()
 modAccessibleObject::getPolicies()
 modAccessibleObject::load()
 modAccessibleObject::loadCollection()
 modAccessibleObject::remove()
 modAccessibleObject::save()
 modAccessibleObject::setPolicies()
 modAccessibleObject::_loadCollectionInstance()
 modAccessibleObject::_loadInstance()

Inherited From xPDOObject

 xPDOObject::__construct()
 xPDOObject::addMany()
 xPDOObject::addOne()
 xPDOObject::addValidationRule()
 xPDOObject::encode()
 xPDOObject::fromArray()
 xPDOObject::fromJSON()
 xPDOObject::get()
 xPDOObject::getFieldName()
 xPDOObject::getFKClass()
 xPDOObject::getFKDefinition()
 xPDOObject::getMany()
 xPDOObject::getOne()
 xPDOObject::getOption()
 xPDOObject::getPK()
 xPDOObject::getPKType()
 xPDOObject::getPrimaryKey()
 xPDOObject::getSelectColumns()
 xPDOObject::getValidator()
 xPDOObject::isDirty()
 xPDOObject::isLazy()
 xPDOObject::isNew()
 xPDOObject::isValidated()
 xPDOObject::load()
 xPDOObject::loadCollection()
 xPDOObject::loadCollectionGraph()
 xPDOObject::remove()
 xPDOObject::removeValidationRules()
 xPDOObject::save()
 xPDOObject::set()
 xPDOObject::setDirty()
 xPDOObject::setOption()
 xPDOObject::toArray()
 xPDOObject::toJSON()
 xPDOObject::validate()
 xPDOObject::_getAliases()
 xPDOObject::_getDataType()
 xPDOObject::_getPHPType()
 xPDOObject::_getRelatedObjectsByFK()
 xPDOObject::_initFields()
 xPDOObject::_loadCollectionInstance()
 xPDOObject::_loadFieldData()
 xPDOObject::_loadInstance()
 xPDOObject::_loadRows()
 xPDOObject::_loadValidation()
 xPDOObject::_saveRelatedObject()
 xPDOObject::_saveRelatedObjects()
 xPDOObject::_setRaw()

Documentation generated on Fri, 17 Jun 2011 10:03:31 -0600 by phpDocumentor 1.4.3