PHP Класс sfContext

Автор: Fabien Potencier ([email protected])
Автор: Sean Kerr ([email protected])
Наследование: implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$configuration
$current
$dispatcher
$factories
$hasShutdownUserAndStorage
$instances
$mailerConfiguration
$serviceContainerConfiguration

Открытые методы

Метод Описание
__call ( string $method, array $arguments ) : mixed Calls methods defined via sfEventDispatcher.
createInstance ( sfApplicationConfiguration $configuration, string $name = null, string $class = __CLASS__ ) : sfContext Creates a new context instance.
dispatch ( ) Dispatches the current request.
filterTemplateParameters ( sfEvent $event, array $parameters ) : array Listens to the template.filter_parameters event.
get ( string $name ) : object Gets an object from the current context.
getActionName ( ) : string Retrieve the action name for this context.
getActionStack ( ) : sfActionStack Retrieve the ActionStack.
getConfigCache ( ) : sfConfigCache Returns the configuration cache.
getConfiguration ( ) : sfApplicationConfiguration Returns the configuration instance.
getController ( ) : sfController Retrieve the controller.
getDatabaseConnection ( name $name = 'default' ) : mixed Retrieve a database connection from the database manager.
getDatabaseManager ( ) : sfDatabaseManager Retrieve the database manager.
getEventDispatcher ( ) : sfEventDispatcher Retrieves the current event dispatcher.
getI18N ( ) : sfI18N Retrieve the i18n instance
getInstance ( string $name = null, string $class = __CLASS__ ) : sfContext Retrieves the singleton instance of this class.
getLogger ( ) : sfLogger Retrieve the logger.
getMailer ( ) : sfMailer Retrieves the mailer.
getModuleDirectory ( ) : string Retrieve the module directory for this context.
getModuleName ( ) : string Retrieve the module name for this context.
getRequest ( ) : sfRequest Retrieve the request.
getResponse ( ) : sfResponse Retrieve the response.
getRouting ( ) : sfRouting Retrieve the routing instance.
getService ( string $id ) : object Retrieves a service from the service container.
getServiceContainer ( ) : sfServiceContainer Retrieves the service container.
getStorage ( ) : sfStorage Retrieve the storage.
getUser ( ) : sfUser Retrieve the user.
getViewCacheManager ( ) : sfViewCacheManager Retrieve the view cache manager
has ( string $name ) : boolean Returns true if an object is currently stored in the current context with the given name, false otherwise.
hasInstance ( string $name = null ) : boolean Checks to see if there has been a context created
initialize ( sfApplicationConfiguration $configuration ) Initializes the current sfContext instance.
loadFactories ( ) Loads the symfony factories.
offsetExists ( string $name ) : boolean Returns true if the context object exists (implements the ArrayAccess interface).
offsetGet ( string $name ) : mixed Returns the context object associated with the name (implements the ArrayAccess interface).
offsetSet ( string $offset, string $value ) Sets the context object associated with the offset (implements the ArrayAccess interface).
offsetUnset ( string $offset ) Unsets the context object associated with the offset (implements the ArrayAccess interface).
set ( string $name, object $object ) Puts an object in the current context.
setMailerConfiguration ( array $configuration ) Set mailer configuration.
setResponse ( sfResponse $response ) : void Set the response object.
setServiceContainerConfiguration ( array $config ) Set service ontainer configuration
shutdown ( ) : void Execute the shutdown procedure.
shutdownUserAndStorage ( ) Shuts the user/storage down.
switchTo ( string $name ) Sets the current context to something else

Описание методов

__call() публичный Метод

If a method cannot be found via sfEventDispatcher, the method name will be parsed to magically handle getMyFactory() and setMyFactory() methods.
public __call ( string $method, array $arguments ) : mixed
$method string The method name
$arguments array The method arguments
Результат mixed The returned value of the called method

createInstance() публичный статический Метод

Creates a new context instance.
public static createInstance ( sfApplicationConfiguration $configuration, string $name = null, string $class = __CLASS__ ) : sfContext
$configuration sfApplicationConfiguration An sfApplicationConfiguration instance
$name string A name for this context (application name by default)
$class string The context class to use (sfContext by default)
Результат sfContext An sfContext instance

dispatch() публичный Метод

Dispatches the current request.
public dispatch ( )

filterTemplateParameters() публичный Метод

Listens to the template.filter_parameters event.
public filterTemplateParameters ( sfEvent $event, array $parameters ) : array
$event sfEvent An sfEvent instance
$parameters array An array of template parameters to filter
Результат array The filtered parameters array

get() публичный Метод

Gets an object from the current context.
public get ( string $name ) : object
$name string The name of the object to retrieve
Результат object The object associated with the given name

getActionName() публичный Метод

Retrieve the action name for this context.
public getActionName ( ) : string
Результат string The currently executing action name, if one is set, otherwise null.

getActionStack() публичный Метод

Retrieve the ActionStack.
public getActionStack ( ) : sfActionStack
Результат sfActionStack the sfActionStack instance

getConfigCache() публичный Метод

Returns the configuration cache.
public getConfigCache ( ) : sfConfigCache
Результат sfConfigCache A sfConfigCache instance

getConfiguration() публичный Метод

Returns the configuration instance.
public getConfiguration ( ) : sfApplicationConfiguration
Результат sfApplicationConfiguration The current application configuration instance

getController() публичный Метод

Retrieve the controller.
public getController ( ) : sfController
Результат sfController The current sfController implementation instance.

getDatabaseConnection() публичный Метод

This is a shortcut to manually getting a connection from an existing database implementation instance. If the [sf_use_database] setting is off, this will return null.
public getDatabaseConnection ( name $name = 'default' ) : mixed
$name name A database name.
Результат mixed A database instance.

getDatabaseManager() публичный Метод

Retrieve the database manager.
public getDatabaseManager ( ) : sfDatabaseManager
Результат sfDatabaseManager The current sfDatabaseManager instance.

getEventDispatcher() публичный Метод

Retrieves the current event dispatcher.
public getEventDispatcher ( ) : sfEventDispatcher
Результат sfEventDispatcher An sfEventDispatcher instance

getI18N() публичный Метод

Retrieve the i18n instance
public getI18N ( ) : sfI18N
Результат sfI18N The current sfI18N implementation instance.

getInstance() публичный статический Метод

Retrieves the singleton instance of this class.
public static getInstance ( string $name = null, string $class = __CLASS__ ) : sfContext
$name string The name of the sfContext to retrieve.
$class string The context class to use (sfContext by default)
Результат sfContext An sfContext implementation instance.

getLogger() публичный Метод

Retrieve the logger.
public getLogger ( ) : sfLogger
Результат sfLogger The current sfLogger implementation instance.

getMailer() публичный Метод

Retrieves the mailer.
public getMailer ( ) : sfMailer
Результат sfMailer The current sfMailer implementation instance.

getModuleDirectory() публичный Метод

Retrieve the module directory for this context.
public getModuleDirectory ( ) : string
Результат string An absolute filesystem path to the directory of the currently executing module, if one is set, otherwise null.

getModuleName() публичный Метод

Retrieve the module name for this context.
public getModuleName ( ) : string
Результат string The currently executing module name, if one is set, otherwise null.

getRequest() публичный Метод

Retrieve the request.
public getRequest ( ) : sfRequest
Результат sfRequest The current sfRequest implementation instance.

getResponse() публичный Метод

Retrieve the response.
public getResponse ( ) : sfResponse
Результат sfResponse The current sfResponse implementation instance.

getRouting() публичный Метод

Retrieve the routing instance.
public getRouting ( ) : sfRouting
Результат sfRouting The current sfRouting implementation instance.

getService() публичный Метод

Retrieves a service from the service container.
public getService ( string $id ) : object
$id string The service identifier
Результат object The service instance

getServiceContainer() публичный Метод

Retrieves the service container.
public getServiceContainer ( ) : sfServiceContainer
Результат sfServiceContainer The current sfServiceContainer implementation instance.

getStorage() публичный Метод

Retrieve the storage.
public getStorage ( ) : sfStorage
Результат sfStorage The current sfStorage implementation instance.

getUser() публичный Метод

Retrieve the user.
public getUser ( ) : sfUser
Результат sfUser The current sfUser implementation instance.

getViewCacheManager() публичный Метод

Retrieve the view cache manager
public getViewCacheManager ( ) : sfViewCacheManager
Результат sfViewCacheManager The current sfViewCacheManager implementation instance.

has() публичный Метод

Returns true if an object is currently stored in the current context with the given name, false otherwise.
public has ( string $name ) : boolean
$name string The object name
Результат boolean true if the object is not null, false otherwise

hasInstance() публичный статический Метод

Checks to see if there has been a context created
public static hasInstance ( string $name = null ) : boolean
$name string The name of the sfContext to check for
Результат boolean true is instanced, otherwise false

initialize() публичный Метод

Initializes the current sfContext instance.
public initialize ( sfApplicationConfiguration $configuration )
$configuration sfApplicationConfiguration An sfApplicationConfiguration instance

loadFactories() публичный Метод

Loads the symfony factories.
public loadFactories ( )

offsetExists() публичный Метод

Returns true if the context object exists (implements the ArrayAccess interface).
public offsetExists ( string $name ) : boolean
$name string The name of the context object
Результат boolean true if the context object exists, false otherwise

offsetGet() публичный Метод

Returns the context object associated with the name (implements the ArrayAccess interface).
public offsetGet ( string $name ) : mixed
$name string The offset of the value to get
Результат mixed The context object if exists, null otherwise

offsetSet() публичный Метод

Sets the context object associated with the offset (implements the ArrayAccess interface).
public offsetSet ( string $offset, string $value )
$offset string The parameter name
$value string The parameter value

offsetUnset() публичный Метод

Unsets the context object associated with the offset (implements the ArrayAccess interface).
public offsetUnset ( string $offset )
$offset string The parameter name

set() публичный Метод

Puts an object in the current context.
public set ( string $name, object $object )
$name string The name of the object to store
$object object The object to store

setMailerConfiguration() публичный Метод

Set mailer configuration.
public setMailerConfiguration ( array $configuration )
$configuration array

setResponse() публичный Метод

Set the response object.
public setResponse ( sfResponse $response ) : void
$response sfResponse An sfResponse instance.
Результат void

setServiceContainerConfiguration() публичный Метод

Set service ontainer configuration
public setServiceContainerConfiguration ( array $config )
$config array

shutdown() публичный Метод

Execute the shutdown procedure.
public shutdown ( ) : void
Результат void

shutdownUserAndStorage() публичный Метод

Shuts the user/storage down.

switchTo() публичный статический Метод

Sets the current context to something else
public static switchTo ( string $name )
$name string The name of the context to switch to

Описание свойств

$configuration защищенное свойство

protected $configuration

$current защищенное статическое свойство

protected static $current

$dispatcher защищенное свойство

protected $dispatcher

$factories защищенное свойство

protected $factories

$hasShutdownUserAndStorage защищенное свойство

protected $hasShutdownUserAndStorage

$instances защищенное статическое свойство

protected static $instances

$mailerConfiguration защищенное свойство

protected $mailerConfiguration

$serviceContainerConfiguration защищенное свойство

protected $serviceContainerConfiguration