code
stringlengths
2.5k
150k
kind
stringclasses
1 value
symfony PhpFilesCache PhpFilesCache ============== class **PhpFilesCache** extends [AbstractCache](abstractcache "Symfony\Component\Cache\Simple\AbstractCache") implements [PruneableInterface](../pruneableinterface "Symfony\Component\Cache\PruneableInterface") Traits ------ | | | | --- | --- | | [PhpFilesTrait](../traits/phpfilestrait "Symfony\Component\Cache\Traits\PhpFilesTrait") | | | [FilesystemCommonTrait](../traits/filesystemcommontrait "Symfony\Component\Cache\Traits\FilesystemCommonTrait") | | | [AbstractTrait](../traits/abstracttrait "Symfony\Component\Cache\Traits\AbstractTrait") | | | LoggerAwareTrait | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected int|null | $maxIdLength | | from [AbstractTrait](../traits/abstracttrait#property_maxIdLength "Symfony\Component\Cache\Traits\AbstractTrait") | Methods ------- | | | | | --- | --- | --- | | array|[Traversable](http://php.net/Traversable) | [doFetch](#method_doFetch)(array $ids) Fetches several cache items. | from [AbstractTrait](../traits/abstracttrait#method_doFetch "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doHave](#method_doHave)(string $id) Confirms if the cache contains specified cache item. | from [AbstractTrait](../traits/abstracttrait#method_doHave "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doClear](#method_doClear)(string $namespace) Deletes all items in the pool. | from [AbstractTrait](../traits/abstracttrait#method_doClear "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doDelete](#method_doDelete)(array $ids) Removes multiple items from the pool. | from [AbstractTrait](../traits/abstracttrait#method_doDelete "Symfony\Component\Cache\Traits\AbstractTrait") | | array|bool | [doSave](#method_doSave)(array $values, int $lifetime) Persists several cache items immediately. | from [AbstractTrait](../traits/abstracttrait#method_doSave "Symfony\Component\Cache\Traits\AbstractTrait") | | | [hasItem](#method_hasItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_hasItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [clear](#method_clear)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_clear "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItem](#method_deleteItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItems](#method_deleteItems)(array $keys) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItems "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [enableVersioning](#method_enableVersioning)(bool $enable = true) Enables/disables versioning of items. | from [AbstractTrait](../traits/abstracttrait#method_enableVersioning "Symfony\Component\Cache\Traits\AbstractTrait") | | | [reset](#method_reset)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_reset "Symfony\Component\Cache\Traits\AbstractTrait") | | static mixed | [unserialize](#method_unserialize)(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. | from [AbstractTrait](../traits/abstracttrait#method_unserialize "Symfony\Component\Cache\Traits\AbstractTrait") | | static | [handleUnserializeCallback](#method_handleUnserializeCallback)($class) | from [AbstractTrait](../traits/abstracttrait#method_handleUnserializeCallback "Symfony\Component\Cache\Traits\AbstractTrait") | | | [\_\_construct](#method___construct)(string $namespace = '', int $defaultLifetime = 0, string $directory = null) | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_get "Symfony\Component\Cache\Simple\AbstractCache") | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_set "Symfony\Component\Cache\Simple\AbstractCache") | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_getMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_setMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | from [AbstractCache](abstractcache#method_deleteMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | static | [throwError](#method_throwError)($type, $message, $file, $line) | from [FilesystemCommonTrait](../traits/filesystemcommontrait#method_throwError "Symfony\Component\Cache\Traits\FilesystemCommonTrait") | | | [\_\_destruct](#method___destruct)() | from [FilesystemCommonTrait](../traits/filesystemcommontrait#method___destruct "Symfony\Component\Cache\Traits\FilesystemCommonTrait") | | static | [isSupported](#method_isSupported)() | from [PhpFilesTrait](../traits/phpfilestrait#method_isSupported "Symfony\Component\Cache\Traits\PhpFilesTrait") | | bool | [prune](#method_prune)() | from [PhpFilesTrait](../traits/phpfilestrait#method_prune "Symfony\Component\Cache\Traits\PhpFilesTrait") | Details ------- ### abstract protected array|[Traversable](http://php.net/Traversable) doFetch(array $ids) Fetches several cache items. #### Parameters | | | | | --- | --- | --- | | array | $ids | The cache identifiers to fetch | #### Return Value | | | | --- | --- | | array|[Traversable](http://php.net/Traversable) | The corresponding values found in the cache | ### abstract protected bool doHave(string $id) Confirms if the cache contains specified cache item. #### Parameters | | | | | --- | --- | --- | | string | $id | The identifier for which to check existence | #### Return Value | | | | --- | --- | | bool | True if item exists in the cache, false otherwise | ### abstract protected bool doClear(string $namespace) Deletes all items in the pool. #### Parameters | | | | | --- | --- | --- | | string | $namespace | The prefix used for all identifiers managed by this pool | #### Return Value | | | | --- | --- | | bool | True if the pool was successfully cleared, false otherwise | ### abstract protected bool doDelete(array $ids) Removes multiple items from the pool. #### Parameters | | | | | --- | --- | --- | | array | $ids | An array of identifiers that should be removed from the pool | #### Return Value | | | | --- | --- | | bool | True if the items were successfully removed, false otherwise | ### abstract protected array|bool doSave(array $values, int $lifetime) Persists several cache items immediately. #### Parameters | | | | | --- | --- | --- | | array | $values | The values to cache, indexed by their cache identifier | | int | $lifetime | The lifetime of the cached values, 0 for persisting until manual cleaning | #### Return Value | | | | --- | --- | | array|bool | The identifiers that failed to be cached or a boolean stating if caching succeeded or not | ### hasItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### clear() {@inheritdoc} ### deleteItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### deleteItems(array $keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | array | $keys | | ### bool enableVersioning(bool $enable = true) Enables/disables versioning of items. When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed, but old keys may need garbage collection and extra round-trips to the back-end are required. Calling this method also clears the memoized namespace version and thus forces a resynchonization of it. #### Parameters | | | | | --- | --- | --- | | bool | $enable | | #### Return Value | | | | --- | --- | | bool | the previous state of versioning | ### reset() {@inheritdoc} ### static protected mixed unserialize(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | | ### static handleUnserializeCallback($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### \_\_construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null) #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | int | $defaultLifetime | | | string | $directory | | #### Exceptions | | | | --- | --- | | [CacheException](../exception/cacheexception "Symfony\Component\Cache\Exception\CacheException") | if OPcache is not enabled | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | ### static throwError($type, $message, $file, $line) #### Parameters | | | | | --- | --- | --- | | | $type | | | | $message | | | | $file | | | | $line | | ### \_\_destruct() ### static isSupported() ### bool prune() #### Return Value | | | | --- | --- | | bool | | symfony DoctrineCache DoctrineCache ============== class **DoctrineCache** extends [AbstractCache](abstractcache "Symfony\Component\Cache\Simple\AbstractCache") Traits ------ | | | | --- | --- | | [DoctrineTrait](../traits/doctrinetrait "Symfony\Component\Cache\Traits\DoctrineTrait") | | | [AbstractTrait](../traits/abstracttrait "Symfony\Component\Cache\Traits\AbstractTrait") | | | LoggerAwareTrait | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected int|null | $maxIdLength | | from [AbstractTrait](../traits/abstracttrait#property_maxIdLength "Symfony\Component\Cache\Traits\AbstractTrait") | Methods ------- | | | | | --- | --- | --- | | array|[Traversable](http://php.net/Traversable) | [doFetch](#method_doFetch)(array $ids) Fetches several cache items. | from [AbstractTrait](../traits/abstracttrait#method_doFetch "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doHave](#method_doHave)(string $id) Confirms if the cache contains specified cache item. | from [AbstractTrait](../traits/abstracttrait#method_doHave "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doClear](#method_doClear)(string $namespace) Deletes all items in the pool. | from [AbstractTrait](../traits/abstracttrait#method_doClear "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doDelete](#method_doDelete)(array $ids) Removes multiple items from the pool. | from [AbstractTrait](../traits/abstracttrait#method_doDelete "Symfony\Component\Cache\Traits\AbstractTrait") | | array|bool | [doSave](#method_doSave)(array $values, int $lifetime) Persists several cache items immediately. | from [AbstractTrait](../traits/abstracttrait#method_doSave "Symfony\Component\Cache\Traits\AbstractTrait") | | | [hasItem](#method_hasItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_hasItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [clear](#method_clear)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_clear "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItem](#method_deleteItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItems](#method_deleteItems)(array $keys) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItems "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [enableVersioning](#method_enableVersioning)(bool $enable = true) Enables/disables versioning of items. | from [AbstractTrait](../traits/abstracttrait#method_enableVersioning "Symfony\Component\Cache\Traits\AbstractTrait") | | | [reset](#method_reset)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_reset "Symfony\Component\Cache\Traits\AbstractTrait") | | static mixed | [unserialize](#method_unserialize)(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. | from [AbstractTrait](../traits/abstracttrait#method_unserialize "Symfony\Component\Cache\Traits\AbstractTrait") | | static | [handleUnserializeCallback](#method_handleUnserializeCallback)($class) | from [AbstractTrait](../traits/abstracttrait#method_handleUnserializeCallback "Symfony\Component\Cache\Traits\AbstractTrait") | | | [\_\_construct](#method___construct)(CacheProvider $provider, string $namespace = '', int $defaultLifetime = 0) | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_get "Symfony\Component\Cache\Simple\AbstractCache") | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_set "Symfony\Component\Cache\Simple\AbstractCache") | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_getMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_setMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | from [AbstractCache](abstractcache#method_deleteMultiple "Symfony\Component\Cache\Simple\AbstractCache") | Details ------- ### abstract protected array|[Traversable](http://php.net/Traversable) doFetch(array $ids) Fetches several cache items. #### Parameters | | | | | --- | --- | --- | | array | $ids | The cache identifiers to fetch | #### Return Value | | | | --- | --- | | array|[Traversable](http://php.net/Traversable) | The corresponding values found in the cache | ### abstract protected bool doHave(string $id) Confirms if the cache contains specified cache item. #### Parameters | | | | | --- | --- | --- | | string | $id | The identifier for which to check existence | #### Return Value | | | | --- | --- | | bool | True if item exists in the cache, false otherwise | ### abstract protected bool doClear(string $namespace) Deletes all items in the pool. #### Parameters | | | | | --- | --- | --- | | string | $namespace | The prefix used for all identifiers managed by this pool | #### Return Value | | | | --- | --- | | bool | True if the pool was successfully cleared, false otherwise | ### abstract protected bool doDelete(array $ids) Removes multiple items from the pool. #### Parameters | | | | | --- | --- | --- | | array | $ids | An array of identifiers that should be removed from the pool | #### Return Value | | | | --- | --- | | bool | True if the items were successfully removed, false otherwise | ### abstract protected array|bool doSave(array $values, int $lifetime) Persists several cache items immediately. #### Parameters | | | | | --- | --- | --- | | array | $values | The values to cache, indexed by their cache identifier | | int | $lifetime | The lifetime of the cached values, 0 for persisting until manual cleaning | #### Return Value | | | | --- | --- | | array|bool | The identifiers that failed to be cached or a boolean stating if caching succeeded or not | ### hasItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### clear() {@inheritdoc} ### deleteItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### deleteItems(array $keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | array | $keys | | ### bool enableVersioning(bool $enable = true) Enables/disables versioning of items. When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed, but old keys may need garbage collection and extra round-trips to the back-end are required. Calling this method also clears the memoized namespace version and thus forces a resynchonization of it. #### Parameters | | | | | --- | --- | --- | | bool | $enable | | #### Return Value | | | | --- | --- | | bool | the previous state of versioning | ### reset() {@inheritdoc} ### static protected mixed unserialize(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | | ### static handleUnserializeCallback($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### \_\_construct(CacheProvider $provider, string $namespace = '', int $defaultLifetime = 0) #### Parameters | | | | | --- | --- | --- | | CacheProvider | $provider | | | string | $namespace | | | int | $defaultLifetime | | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | symfony MemcachedCache MemcachedCache =============== class **MemcachedCache** extends [AbstractCache](abstractcache "Symfony\Component\Cache\Simple\AbstractCache") Traits ------ | | | | --- | --- | | [MemcachedTrait](../traits/memcachedtrait "Symfony\Component\Cache\Traits\MemcachedTrait") | | | [AbstractTrait](../traits/abstracttrait "Symfony\Component\Cache\Traits\AbstractTrait") | | | LoggerAwareTrait | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $maxIdLength | | | Methods ------- | | | | | --- | --- | --- | | array|[Traversable](http://php.net/Traversable) | [doFetch](#method_doFetch)(array $ids) Fetches several cache items. | from [AbstractTrait](../traits/abstracttrait#method_doFetch "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doHave](#method_doHave)(string $id) Confirms if the cache contains specified cache item. | from [AbstractTrait](../traits/abstracttrait#method_doHave "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doClear](#method_doClear)(string $namespace) Deletes all items in the pool. | from [AbstractTrait](../traits/abstracttrait#method_doClear "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doDelete](#method_doDelete)(array $ids) Removes multiple items from the pool. | from [AbstractTrait](../traits/abstracttrait#method_doDelete "Symfony\Component\Cache\Traits\AbstractTrait") | | array|bool | [doSave](#method_doSave)(array $values, int $lifetime) Persists several cache items immediately. | from [AbstractTrait](../traits/abstracttrait#method_doSave "Symfony\Component\Cache\Traits\AbstractTrait") | | | [hasItem](#method_hasItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_hasItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [clear](#method_clear)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_clear "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItem](#method_deleteItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItems](#method_deleteItems)(array $keys) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItems "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [enableVersioning](#method_enableVersioning)(bool $enable = true) Enables/disables versioning of items. | from [AbstractTrait](../traits/abstracttrait#method_enableVersioning "Symfony\Component\Cache\Traits\AbstractTrait") | | | [reset](#method_reset)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_reset "Symfony\Component\Cache\Traits\AbstractTrait") | | static mixed | [unserialize](#method_unserialize)(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. | from [AbstractTrait](../traits/abstracttrait#method_unserialize "Symfony\Component\Cache\Traits\AbstractTrait") | | static | [handleUnserializeCallback](#method_handleUnserializeCallback)($class) | from [AbstractTrait](../traits/abstracttrait#method_handleUnserializeCallback "Symfony\Component\Cache\Traits\AbstractTrait") | | | [\_\_construct](#method___construct)(Memcached $client, string $namespace = '', int $defaultLifetime = 0) | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_get "Symfony\Component\Cache\Simple\AbstractCache") | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_set "Symfony\Component\Cache\Simple\AbstractCache") | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_getMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_setMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | from [AbstractCache](abstractcache#method_deleteMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | static | [isSupported](#method_isSupported)() | from [MemcachedTrait](../traits/memcachedtrait#method_isSupported "Symfony\Component\Cache\Traits\MemcachedTrait") | | static Memcached | [createConnection](#method_createConnection)(array[]|string|string[] $servers, array $options = array()) Creates a Memcached instance. | from [MemcachedTrait](../traits/memcachedtrait#method_createConnection "Symfony\Component\Cache\Traits\MemcachedTrait") | Details ------- ### abstract protected array|[Traversable](http://php.net/Traversable) doFetch(array $ids) Fetches several cache items. #### Parameters | | | | | --- | --- | --- | | array | $ids | The cache identifiers to fetch | #### Return Value | | | | --- | --- | | array|[Traversable](http://php.net/Traversable) | The corresponding values found in the cache | ### abstract protected bool doHave(string $id) Confirms if the cache contains specified cache item. #### Parameters | | | | | --- | --- | --- | | string | $id | The identifier for which to check existence | #### Return Value | | | | --- | --- | | bool | True if item exists in the cache, false otherwise | ### abstract protected bool doClear(string $namespace) Deletes all items in the pool. #### Parameters | | | | | --- | --- | --- | | string | $namespace | The prefix used for all identifiers managed by this pool | #### Return Value | | | | --- | --- | | bool | True if the pool was successfully cleared, false otherwise | ### abstract protected bool doDelete(array $ids) Removes multiple items from the pool. #### Parameters | | | | | --- | --- | --- | | array | $ids | An array of identifiers that should be removed from the pool | #### Return Value | | | | --- | --- | | bool | True if the items were successfully removed, false otherwise | ### abstract protected array|bool doSave(array $values, int $lifetime) Persists several cache items immediately. #### Parameters | | | | | --- | --- | --- | | array | $values | The values to cache, indexed by their cache identifier | | int | $lifetime | The lifetime of the cached values, 0 for persisting until manual cleaning | #### Return Value | | | | --- | --- | | array|bool | The identifiers that failed to be cached or a boolean stating if caching succeeded or not | ### hasItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### clear() {@inheritdoc} ### deleteItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### deleteItems(array $keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | array | $keys | | ### bool enableVersioning(bool $enable = true) Enables/disables versioning of items. When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed, but old keys may need garbage collection and extra round-trips to the back-end are required. Calling this method also clears the memoized namespace version and thus forces a resynchonization of it. #### Parameters | | | | | --- | --- | --- | | bool | $enable | | #### Return Value | | | | --- | --- | | bool | the previous state of versioning | ### reset() {@inheritdoc} ### static protected mixed unserialize(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | | ### static handleUnserializeCallback($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### \_\_construct(Memcached $client, string $namespace = '', int $defaultLifetime = 0) #### Parameters | | | | | --- | --- | --- | | Memcached | $client | | | string | $namespace | | | int | $defaultLifetime | | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | ### static isSupported() ### static Memcached createConnection(array[]|string|string[] $servers, array $options = array()) Creates a Memcached instance. By default, the binary protocol, no block, and libketama compatible options are enabled. Examples for servers: - 'memcached://user:pass@localhost?weight=33' - array(array('localhost', 11211, 33)) #### Parameters | | | | | --- | --- | --- | | array[]|string|string[] | $servers | An array of servers, a DSN, or an array of DSNs | | array | $options | An array of options | #### Return Value | | | | --- | --- | | Memcached | | #### Exceptions | | | | --- | --- | | [ErrorException](http://php.net/ErrorException) | When invalid options or servers are provided |
programming_docs
symfony ApcuCache ApcuCache ========== class **ApcuCache** extends [AbstractCache](abstractcache "Symfony\Component\Cache\Simple\AbstractCache") Traits ------ | | | | --- | --- | | [ApcuTrait](../traits/apcutrait "Symfony\Component\Cache\Traits\ApcuTrait") | | | [AbstractTrait](../traits/abstracttrait "Symfony\Component\Cache\Traits\AbstractTrait") | | | LoggerAwareTrait | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected int|null | $maxIdLength | | from [AbstractTrait](../traits/abstracttrait#property_maxIdLength "Symfony\Component\Cache\Traits\AbstractTrait") | Methods ------- | | | | | --- | --- | --- | | array|[Traversable](http://php.net/Traversable) | [doFetch](#method_doFetch)(array $ids) Fetches several cache items. | from [AbstractTrait](../traits/abstracttrait#method_doFetch "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doHave](#method_doHave)(string $id) Confirms if the cache contains specified cache item. | from [AbstractTrait](../traits/abstracttrait#method_doHave "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doClear](#method_doClear)(string $namespace) Deletes all items in the pool. | from [AbstractTrait](../traits/abstracttrait#method_doClear "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doDelete](#method_doDelete)(array $ids) Removes multiple items from the pool. | from [AbstractTrait](../traits/abstracttrait#method_doDelete "Symfony\Component\Cache\Traits\AbstractTrait") | | array|bool | [doSave](#method_doSave)(array $values, int $lifetime) Persists several cache items immediately. | from [AbstractTrait](../traits/abstracttrait#method_doSave "Symfony\Component\Cache\Traits\AbstractTrait") | | | [hasItem](#method_hasItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_hasItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [clear](#method_clear)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_clear "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItem](#method_deleteItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItems](#method_deleteItems)(array $keys) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItems "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [enableVersioning](#method_enableVersioning)(bool $enable = true) Enables/disables versioning of items. | from [AbstractTrait](../traits/abstracttrait#method_enableVersioning "Symfony\Component\Cache\Traits\AbstractTrait") | | | [reset](#method_reset)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_reset "Symfony\Component\Cache\Traits\AbstractTrait") | | static mixed | [unserialize](#method_unserialize)(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. | from [AbstractTrait](../traits/abstracttrait#method_unserialize "Symfony\Component\Cache\Traits\AbstractTrait") | | static | [handleUnserializeCallback](#method_handleUnserializeCallback)($class) | from [AbstractTrait](../traits/abstracttrait#method_handleUnserializeCallback "Symfony\Component\Cache\Traits\AbstractTrait") | | | [\_\_construct](#method___construct)(string $namespace = '', int $defaultLifetime = 0, string $version = null) | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_get "Symfony\Component\Cache\Simple\AbstractCache") | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_set "Symfony\Component\Cache\Simple\AbstractCache") | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_getMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_setMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | from [AbstractCache](abstractcache#method_deleteMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | static | [isSupported](#method_isSupported)() | from [ApcuTrait](../traits/apcutrait#method_isSupported "Symfony\Component\Cache\Traits\ApcuTrait") | Details ------- ### abstract protected array|[Traversable](http://php.net/Traversable) doFetch(array $ids) Fetches several cache items. #### Parameters | | | | | --- | --- | --- | | array | $ids | The cache identifiers to fetch | #### Return Value | | | | --- | --- | | array|[Traversable](http://php.net/Traversable) | The corresponding values found in the cache | ### abstract protected bool doHave(string $id) Confirms if the cache contains specified cache item. #### Parameters | | | | | --- | --- | --- | | string | $id | The identifier for which to check existence | #### Return Value | | | | --- | --- | | bool | True if item exists in the cache, false otherwise | ### abstract protected bool doClear(string $namespace) Deletes all items in the pool. #### Parameters | | | | | --- | --- | --- | | string | $namespace | The prefix used for all identifiers managed by this pool | #### Return Value | | | | --- | --- | | bool | True if the pool was successfully cleared, false otherwise | ### abstract protected bool doDelete(array $ids) Removes multiple items from the pool. #### Parameters | | | | | --- | --- | --- | | array | $ids | An array of identifiers that should be removed from the pool | #### Return Value | | | | --- | --- | | bool | True if the items were successfully removed, false otherwise | ### abstract protected array|bool doSave(array $values, int $lifetime) Persists several cache items immediately. #### Parameters | | | | | --- | --- | --- | | array | $values | The values to cache, indexed by their cache identifier | | int | $lifetime | The lifetime of the cached values, 0 for persisting until manual cleaning | #### Return Value | | | | --- | --- | | array|bool | The identifiers that failed to be cached or a boolean stating if caching succeeded or not | ### hasItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### clear() {@inheritdoc} ### deleteItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### deleteItems(array $keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | array | $keys | | ### bool enableVersioning(bool $enable = true) Enables/disables versioning of items. When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed, but old keys may need garbage collection and extra round-trips to the back-end are required. Calling this method also clears the memoized namespace version and thus forces a resynchonization of it. #### Parameters | | | | | --- | --- | --- | | bool | $enable | | #### Return Value | | | | --- | --- | | bool | the previous state of versioning | ### reset() {@inheritdoc} ### static protected mixed unserialize(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | | ### static handleUnserializeCallback($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### \_\_construct(string $namespace = '', int $defaultLifetime = 0, string $version = null) #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | int | $defaultLifetime | | | string | $version | | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | ### static isSupported() symfony PdoCache PdoCache ========= class **PdoCache** extends [AbstractCache](abstractcache "Symfony\Component\Cache\Simple\AbstractCache") implements [PruneableInterface](../pruneableinterface "Symfony\Component\Cache\PruneableInterface") Traits ------ | | | | --- | --- | | [PdoTrait](../traits/pdotrait "Symfony\Component\Cache\Traits\PdoTrait") | | | [AbstractTrait](../traits/abstracttrait "Symfony\Component\Cache\Traits\AbstractTrait") | | | LoggerAwareTrait | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $maxIdLength | | | Methods ------- | | | | | --- | --- | --- | | array|[Traversable](http://php.net/Traversable) | [doFetch](#method_doFetch)(array $ids) Fetches several cache items. | from [AbstractTrait](../traits/abstracttrait#method_doFetch "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doHave](#method_doHave)(string $id) Confirms if the cache contains specified cache item. | from [AbstractTrait](../traits/abstracttrait#method_doHave "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doClear](#method_doClear)(string $namespace) Deletes all items in the pool. | from [AbstractTrait](../traits/abstracttrait#method_doClear "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [doDelete](#method_doDelete)(array $ids) Removes multiple items from the pool. | from [AbstractTrait](../traits/abstracttrait#method_doDelete "Symfony\Component\Cache\Traits\AbstractTrait") | | array|bool | [doSave](#method_doSave)(array $values, int $lifetime) Persists several cache items immediately. | from [AbstractTrait](../traits/abstracttrait#method_doSave "Symfony\Component\Cache\Traits\AbstractTrait") | | | [hasItem](#method_hasItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_hasItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [clear](#method_clear)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_clear "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItem](#method_deleteItem)($key) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItem "Symfony\Component\Cache\Traits\AbstractTrait") | | | [deleteItems](#method_deleteItems)(array $keys) {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_deleteItems "Symfony\Component\Cache\Traits\AbstractTrait") | | bool | [enableVersioning](#method_enableVersioning)(bool $enable = true) Enables/disables versioning of items. | from [AbstractTrait](../traits/abstracttrait#method_enableVersioning "Symfony\Component\Cache\Traits\AbstractTrait") | | | [reset](#method_reset)() {@inheritdoc} | from [AbstractTrait](../traits/abstracttrait#method_reset "Symfony\Component\Cache\Traits\AbstractTrait") | | static mixed | [unserialize](#method_unserialize)(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. | from [AbstractTrait](../traits/abstracttrait#method_unserialize "Symfony\Component\Cache\Traits\AbstractTrait") | | static | [handleUnserializeCallback](#method_handleUnserializeCallback)($class) | from [AbstractTrait](../traits/abstracttrait#method_handleUnserializeCallback "Symfony\Component\Cache\Traits\AbstractTrait") | | | [\_\_construct](#method___construct)($connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = array()) You can either pass an existing database connection as PDO instance or a Doctrine DBAL Connection or a DSN string that will be used to lazy-connect to the database when the cache is actually used. | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_get "Symfony\Component\Cache\Simple\AbstractCache") | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_set "Symfony\Component\Cache\Simple\AbstractCache") | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_getMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | from [AbstractCache](abstractcache#method_setMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | from [AbstractCache](abstractcache#method_deleteMultiple "Symfony\Component\Cache\Simple\AbstractCache") | | | [createTable](#method_createTable)() Creates the table to store cache items which can be called once for setup. | from [PdoTrait](../traits/pdotrait#method_createTable "Symfony\Component\Cache\Traits\PdoTrait") | | | [prune](#method_prune)() {@inheritdoc} | from [PdoTrait](../traits/pdotrait#method_prune "Symfony\Component\Cache\Traits\PdoTrait") | Details ------- ### abstract protected array|[Traversable](http://php.net/Traversable) doFetch(array $ids) Fetches several cache items. #### Parameters | | | | | --- | --- | --- | | array | $ids | The cache identifiers to fetch | #### Return Value | | | | --- | --- | | array|[Traversable](http://php.net/Traversable) | The corresponding values found in the cache | ### abstract protected bool doHave(string $id) Confirms if the cache contains specified cache item. #### Parameters | | | | | --- | --- | --- | | string | $id | The identifier for which to check existence | #### Return Value | | | | --- | --- | | bool | True if item exists in the cache, false otherwise | ### abstract protected bool doClear(string $namespace) Deletes all items in the pool. #### Parameters | | | | | --- | --- | --- | | string | $namespace | The prefix used for all identifiers managed by this pool | #### Return Value | | | | --- | --- | | bool | True if the pool was successfully cleared, false otherwise | ### abstract protected bool doDelete(array $ids) Removes multiple items from the pool. #### Parameters | | | | | --- | --- | --- | | array | $ids | An array of identifiers that should be removed from the pool | #### Return Value | | | | --- | --- | | bool | True if the items were successfully removed, false otherwise | ### abstract protected array|bool doSave(array $values, int $lifetime) Persists several cache items immediately. #### Parameters | | | | | --- | --- | --- | | array | $values | The values to cache, indexed by their cache identifier | | int | $lifetime | The lifetime of the cached values, 0 for persisting until manual cleaning | #### Return Value | | | | --- | --- | | array|bool | The identifiers that failed to be cached or a boolean stating if caching succeeded or not | ### hasItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### clear() {@inheritdoc} ### deleteItem($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### deleteItems(array $keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | array | $keys | | ### bool enableVersioning(bool $enable = true) Enables/disables versioning of items. When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed, but old keys may need garbage collection and extra round-trips to the back-end are required. Calling this method also clears the memoized namespace version and thus forces a resynchonization of it. #### Parameters | | | | | --- | --- | --- | | bool | $enable | | #### Return Value | | | | --- | --- | | bool | the previous state of versioning | ### reset() {@inheritdoc} ### static protected mixed unserialize(string $value) Like the native unserialize() function but throws an exception if anything goes wrong. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | | ### static handleUnserializeCallback($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### \_\_construct($connOrDsn, string $namespace = '', int $defaultLifetime = 0, array $options = array()) You can either pass an existing database connection as PDO instance or a Doctrine DBAL Connection or a DSN string that will be used to lazy-connect to the database when the cache is actually used. List of available options: \* db\_table: The name of the table [default: cache\_items] \* db\_id\_col: The column where to store the cache id [default: item\_id] \* db\_data\_col: The column where to store the cache data [default: item\_data] \* db\_lifetime\_col: The column where to store the lifetime [default: item\_lifetime] \* db\_time\_col: The column where to store the timestamp [default: item\_time] \* db\_username: The username when lazy-connect [default: ''] \* db\_password: The password when lazy-connect [default: ''] \* db\_connection\_options: An array of driver-specific connection options [default: array()] #### Parameters | | | | | --- | --- | --- | | | $connOrDsn | | | string | $namespace | | | int | $defaultLifetime | | | array | $options | | #### Exceptions | | | | --- | --- | | InvalidArgumentException | When first argument is not PDO nor Connection nor string | | InvalidArgumentException | When PDO error mode is not PDO::ERRMODE\_EXCEPTION | | InvalidArgumentException | When namespace contains invalid characters | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | ### createTable() Creates the table to store cache items which can be called once for setup. Cache ID are saved in a column of maximum length 255. Cache data is saved in a BLOB. #### Exceptions | | | | --- | --- | | [PDOException](http://php.net/PDOException) | When the table already exists | | DBALException | When the table already exists | | [DomainException](http://php.net/DomainException) | When an unsupported PDO driver is used | ### prune() {@inheritdoc} symfony TraceableCache TraceableCache =============== class **TraceableCache** implements CacheInterface, [PruneableInterface](../pruneableinterface "Symfony\Component\Cache\PruneableInterface"), [ResettableInterface](../resettableinterface "Symfony\Component\Cache\ResettableInterface") An adapter that collects data about all cache calls. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(CacheInterface $pool) | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | | | | [has](#method_has)($key) {@inheritdoc} | | | | [delete](#method_delete)($key) {@inheritdoc} | | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | | | | [clear](#method_clear)() {@inheritdoc} | | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | | | bool | [prune](#method_prune)() | | | | [reset](#method_reset)() | | | | [getCalls](#method_getCalls)() | | Details ------- ### \_\_construct(CacheInterface $pool) #### Parameters | | | | | --- | --- | --- | | CacheInterface | $pool | | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### has($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### delete($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### clear() {@inheritdoc} ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | ### bool prune() #### Return Value | | | | --- | --- | | bool | | ### reset() ### getCalls()
programming_docs
symfony ChainCache ChainCache =========== class **ChainCache** implements CacheInterface, [PruneableInterface](../pruneableinterface "Symfony\Component\Cache\PruneableInterface"), [ResettableInterface](../resettableinterface "Symfony\Component\Cache\ResettableInterface") Chains several caches together. Cached items are fetched from the first cache having them in its data store. They are saved and deleted in all caches at once. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $caches, int $defaultLifetime = 0) | | | | [get](#method_get)($key, $default = null) {@inheritdoc} | | | | [getMultiple](#method_getMultiple)($keys, $default = null) {@inheritdoc} | | | | [has](#method_has)($key) {@inheritdoc} | | | | [clear](#method_clear)() {@inheritdoc} | | | | [delete](#method_delete)($key) {@inheritdoc} | | | | [deleteMultiple](#method_deleteMultiple)($keys) {@inheritdoc} | | | | [set](#method_set)($key, $value, $ttl = null) {@inheritdoc} | | | | [setMultiple](#method_setMultiple)($values, $ttl = null) {@inheritdoc} | | | bool | [prune](#method_prune)() | | | | [reset](#method_reset)() | | Details ------- ### \_\_construct(array $caches, int $defaultLifetime = 0) #### Parameters | | | | | --- | --- | --- | | array | $caches | The ordered list of caches used to fetch cached items | | int | $defaultLifetime | The lifetime of items propagated from lower caches to upper ones | ### get($key, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### getMultiple($keys, $default = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | | | $default | | ### has($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### clear() {@inheritdoc} ### delete($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### deleteMultiple($keys) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $keys | | ### set($key, $value, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | | | $ttl | | ### setMultiple($values, $ttl = null) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $values | | | | $ttl | | ### bool prune() #### Return Value | | | | --- | --- | | bool | | ### reset() symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements InvalidArgumentException, InvalidArgumentException symfony CacheException CacheException =============== class **CacheException** extends [Exception](http://php.net/Exception) implements CacheException, CacheException symfony Symfony\Component\Asset\Exception Symfony\Component\Asset\Exception ================================= Classes ------- | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Asset\Exception\InvalidArgumentException") | Base InvalidArgumentException for the Asset component. | | [LogicException](exception/logicexception "Symfony\Component\Asset\Exception\LogicException") | Base LogicException for the Asset component. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Asset\Exception\ExceptionInterface")* | Base ExceptionInterface for the Asset component. | symfony PathPackage PathPackage ============ class **PathPackage** extends [Package](package "Symfony\Component\Asset\Package") Package that adds a base path to asset URLs in addition to a version. In addition to the provided base path, this package also automatically prepends the current request base path if a Context is available to allow a website to be hosted easily under any given path under the Web Server root directory. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $basePath, [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") $versionStrategy, [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") $context = null) | | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | from [Package](package#method_getVersion "Symfony\Component\Asset\Package") | | string | [getUrl](#method_getUrl)(string $path) Returns an absolute or root-relative public path. | | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | [getContext](#method_getContext)() | from [Package](package#method_getContext "Symfony\Component\Asset\Package") | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | [getVersionStrategy](#method_getVersionStrategy)() | from [Package](package#method_getVersionStrategy "Symfony\Component\Asset\Package") | | | [isAbsoluteUrl](#method_isAbsoluteUrl)($url) | from [Package](package#method_isAbsoluteUrl "Symfony\Component\Asset\Package") | | string | [getBasePath](#method_getBasePath)() Returns the base path. | | Details ------- ### \_\_construct(string $basePath, [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") $versionStrategy, [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") $context = null) #### Parameters | | | | | --- | --- | --- | | string | $basePath | The base path to be prepended to relative paths | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | $versionStrategy | | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | $context | | ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string getUrl(string $path) Returns an absolute or root-relative public path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The public path | ### protected [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") getContext() #### Return Value | | | | --- | --- | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | | ### protected [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") getVersionStrategy() #### Return Value | | | | --- | --- | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | | ### protected isAbsoluteUrl($url) #### Parameters | | | | | --- | --- | --- | | | $url | | ### string getBasePath() Returns the base path. #### Return Value | | | | --- | --- | | string | The base path | symfony Packages Packages ========= class **Packages** Helps manage asset URLs. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") $defaultPackage = null, array $packages = array()) | | | | [setDefaultPackage](#method_setDefaultPackage)([PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") $defaultPackage) | | | | [addPackage](#method_addPackage)(string $name, [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") $package) Adds a package. | | | [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") | [getPackage](#method_getPackage)(string $name = null) Returns an asset package. | | | string | [getVersion](#method_getVersion)(string $path, string $packageName = null) Gets the version to add to public URL. | | | string | [getUrl](#method_getUrl)(string $path, string $packageName = null) Returns the public path. | | Details ------- ### \_\_construct([PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") $defaultPackage = null, array $packages = array()) #### Parameters | | | | | --- | --- | --- | | [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") | $defaultPackage | The default package | | array | $packages | Additional packages indexed by name | ### setDefaultPackage([PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") $defaultPackage) #### Parameters | | | | | --- | --- | --- | | [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") | $defaultPackage | | ### addPackage(string $name, [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") $package) Adds a package. #### Parameters | | | | | --- | --- | --- | | string | $name | The package name | | [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") | $package | The package | ### [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") getPackage(string $name = null) Returns an asset package. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the package or null for the default package | #### Return Value | | | | --- | --- | | [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") | An asset package | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Asset\Exception\InvalidArgumentException") | If there is no package by that name | | [LogicException](exception/logicexception "Symfony\Component\Asset\Exception\LogicException") | If no default package is defined | ### string getVersion(string $path, string $packageName = null) Gets the version to add to public URL. #### Parameters | | | | | --- | --- | --- | | string | $path | A public path | | string | $packageName | A package name | #### Return Value | | | | --- | --- | | string | The current version | ### string getUrl(string $path, string $packageName = null) Returns the public path. Absolute paths (i.e. http://...) are returned unmodified. #### Parameters | | | | | --- | --- | --- | | string | $path | A public path | | string | $packageName | The name of the asset package to use | #### Return Value | | | | --- | --- | | string | A public path which takes into account the base path and URL path | symfony Symfony\Component\Asset\Context Symfony\Component\Asset\Context =============================== Classes ------- | | | | --- | --- | | [NullContext](context/nullcontext "Symfony\Component\Asset\Context\NullContext") | A context that does nothing. | | [RequestStackContext](context/requeststackcontext "Symfony\Component\Asset\Context\RequestStackContext") | Uses a RequestStack to populate the context. | Interfaces ---------- | | | | --- | --- | | *[ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface")* | Holds information about the current request. | symfony Package Package ======== class **Package** implements [PackageInterface](packageinterface "Symfony\Component\Asset\PackageInterface") Basic package that adds a version to asset URLs. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") $versionStrategy, [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") $context = null) | | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | | | string | [getUrl](#method_getUrl)(string $path) Returns an absolute or root-relative public path. | | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | [getContext](#method_getContext)() | | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | [getVersionStrategy](#method_getVersionStrategy)() | | | | [isAbsoluteUrl](#method_isAbsoluteUrl)($url) | | Details ------- ### \_\_construct([VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") $versionStrategy, [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") $context = null) #### Parameters | | | | | --- | --- | --- | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | $versionStrategy | | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | $context | | ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string getUrl(string $path) Returns an absolute or root-relative public path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The public path | ### protected [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") getContext() #### Return Value | | | | --- | --- | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | | ### protected [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") getVersionStrategy() #### Return Value | | | | --- | --- | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | | ### protected isAbsoluteUrl($url) #### Parameters | | | | | --- | --- | --- | | | $url | | symfony UrlPackage UrlPackage =========== class **UrlPackage** extends [Package](package "Symfony\Component\Asset\Package") Package that adds a base URL to asset URLs in addition to a version. The package allows to use more than one base URLs in which case it randomly chooses one for each asset; it also guarantees that any given path will always use the same base URL to be nice with HTTP caching mechanisms. When the request context is available, this package can choose the best base URL to use based on the current request scheme: * For HTTP request, it chooses between all base URLs; * For HTTPs requests, it chooses between HTTPs base URLs and relative protocol URLs or falls back to any base URL if no secure ones are available. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|string[] $baseUrls, [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") $versionStrategy, [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") $context = null) | | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | from [Package](package#method_getVersion "Symfony\Component\Asset\Package") | | string | [getUrl](#method_getUrl)(string $path) Returns an absolute or root-relative public path. | | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | [getContext](#method_getContext)() | from [Package](package#method_getContext "Symfony\Component\Asset\Package") | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | [getVersionStrategy](#method_getVersionStrategy)() | from [Package](package#method_getVersionStrategy "Symfony\Component\Asset\Package") | | | [isAbsoluteUrl](#method_isAbsoluteUrl)($url) | from [Package](package#method_isAbsoluteUrl "Symfony\Component\Asset\Package") | | string | [getBaseUrl](#method_getBaseUrl)(string $path) Returns the base URL for a path. | | | int | [chooseBaseUrl](#method_chooseBaseUrl)(string $path) Determines which base URL to use for the given path. | | Details ------- ### \_\_construct(string|string[] $baseUrls, [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") $versionStrategy, [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") $context = null) #### Parameters | | | | | --- | --- | --- | | string|string[] | $baseUrls | Base asset URLs | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | $versionStrategy | | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | $context | | ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string getUrl(string $path) Returns an absolute or root-relative public path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The public path | ### protected [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") getContext() #### Return Value | | | | --- | --- | | [ContextInterface](context/contextinterface "Symfony\Component\Asset\Context\ContextInterface") | | ### protected [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") getVersionStrategy() #### Return Value | | | | --- | --- | | [VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") | | ### protected isAbsoluteUrl($url) #### Parameters | | | | | --- | --- | --- | | | $url | | ### string getBaseUrl(string $path) Returns the base URL for a path. #### Parameters | | | | | --- | --- | --- | | string | $path | | #### Return Value | | | | --- | --- | | string | The base URL | ### protected int chooseBaseUrl(string $path) Determines which base URL to use for the given path. Override this method to change the default distribution strategy. This method should always return the same base URL index for a given path. #### Parameters | | | | | --- | --- | --- | | string | $path | | #### Return Value | | | | --- | --- | | int | The base URL index for the given path | symfony PackageInterface PackageInterface ================= interface **PackageInterface** Asset package interface. Methods ------- | | | | | --- | --- | --- | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | | | string | [getUrl](#method_getUrl)(string $path) Returns an absolute or root-relative public path. | | Details ------- ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string getUrl(string $path) Returns an absolute or root-relative public path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The public path |
programming_docs
symfony Symfony\Component\Asset\VersionStrategy Symfony\Component\Asset\VersionStrategy ======================================= Classes ------- | | | | --- | --- | | [EmptyVersionStrategy](versionstrategy/emptyversionstrategy "Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy") | Disable version for all assets. | | [JsonManifestVersionStrategy](versionstrategy/jsonmanifestversionstrategy "Symfony\Component\Asset\VersionStrategy\JsonManifestVersionStrategy") | Reads the versioned path of an asset from a JSON manifest file. | | [StaticVersionStrategy](versionstrategy/staticversionstrategy "Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy") | Returns the same version for all assets. | Interfaces ---------- | | | | --- | --- | | *[VersionStrategyInterface](versionstrategy/versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface")* | Asset version strategy interface. | symfony ContextInterface ContextInterface ================= interface **ContextInterface** Holds information about the current request. Methods ------- | | | | | --- | --- | --- | | string | [getBasePath](#method_getBasePath)() Gets the base path. | | | bool | [isSecure](#method_isSecure)() Checks whether the request is secure or not. | | Details ------- ### string getBasePath() Gets the base path. #### Return Value | | | | --- | --- | | string | The base path | ### bool isSecure() Checks whether the request is secure or not. #### Return Value | | | | --- | --- | | bool | true if the request is secure, false otherwise | symfony NullContext NullContext ============ class **NullContext** implements [ContextInterface](contextinterface "Symfony\Component\Asset\Context\ContextInterface") A context that does nothing. Methods ------- | | | | | --- | --- | --- | | string | [getBasePath](#method_getBasePath)() Gets the base path. | | | bool | [isSecure](#method_isSecure)() Checks whether the request is secure or not. | | Details ------- ### string getBasePath() Gets the base path. #### Return Value | | | | --- | --- | | string | The base path | ### bool isSecure() Checks whether the request is secure or not. #### Return Value | | | | --- | --- | | bool | true if the request is secure, false otherwise | symfony RequestStackContext RequestStackContext ==================== class **RequestStackContext** implements [ContextInterface](contextinterface "Symfony\Component\Asset\Context\ContextInterface") Uses a RequestStack to populate the context. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RequestStack](../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack, string $basePath = '', bool $secure = false) | | | string | [getBasePath](#method_getBasePath)() Gets the base path. | | | bool | [isSecure](#method_isSecure)() Checks whether the request is secure or not. | | Details ------- ### \_\_construct([RequestStack](../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack, string $basePath = '', bool $secure = false) #### Parameters | | | | | --- | --- | --- | | [RequestStack](../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") | $requestStack | | | string | $basePath | | | bool | $secure | | ### string getBasePath() Gets the base path. #### Return Value | | | | --- | --- | | string | The base path | ### bool isSecure() Checks whether the request is secure or not. #### Return Value | | | | --- | --- | | bool | true if the request is secure, false otherwise | symfony EmptyVersionStrategy EmptyVersionStrategy ===================== class **EmptyVersionStrategy** implements [VersionStrategyInterface](versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") Disable version for all assets. Methods ------- | | | | | --- | --- | --- | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | | | string | [applyVersion](#method_applyVersion)(string $path) Applies version to the supplied path. | | Details ------- ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string applyVersion(string $path) Applies version to the supplied path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The versionized path | symfony VersionStrategyInterface VersionStrategyInterface ========================= interface **VersionStrategyInterface** Asset version strategy interface. Methods ------- | | | | | --- | --- | --- | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | | | string | [applyVersion](#method_applyVersion)(string $path) Applies version to the supplied path. | | Details ------- ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string applyVersion(string $path) Applies version to the supplied path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The versionized path | symfony JsonManifestVersionStrategy JsonManifestVersionStrategy ============================ class **JsonManifestVersionStrategy** implements [VersionStrategyInterface](versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") Reads the versioned path of an asset from a JSON manifest file. For example, the manifest file might look like this: { "main.js": "main.abc123.js", "css/styles.css": "css/styles.555abc.css" } You could then ask for the version of "main.js" or "css/styles.css". Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $manifestPath) | | | string | [getVersion](#method_getVersion)(string $path) With a manifest, we don't really know or care about what the version is. Instead, this returns the path to the versioned file. | | | string | [applyVersion](#method_applyVersion)(string $path) Applies version to the supplied path. | | Details ------- ### \_\_construct(string $manifestPath) #### Parameters | | | | | --- | --- | --- | | string | $manifestPath | Absolute path to the manifest file | ### string getVersion(string $path) With a manifest, we don't really know or care about what the version is. Instead, this returns the path to the versioned file. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string applyVersion(string $path) Applies version to the supplied path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The versionized path | symfony StaticVersionStrategy StaticVersionStrategy ====================== class **StaticVersionStrategy** implements [VersionStrategyInterface](versionstrategyinterface "Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface") Returns the same version for all assets. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $version, string $format = null) | | | string | [getVersion](#method_getVersion)(string $path) Returns the asset version for an asset. | | | string | [applyVersion](#method_applyVersion)(string $path) Applies version to the supplied path. | | Details ------- ### \_\_construct(string $version, string $format = null) #### Parameters | | | | | --- | --- | --- | | string | $version | Version number | | string | $format | Url format | ### string getVersion(string $path) Returns the asset version for an asset. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The version string | ### string applyVersion(string $path) Applies version to the supplied path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path | #### Return Value | | | | --- | --- | | string | The versionized path | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Asset\Exception\ExceptionInterface") Base InvalidArgumentException for the Asset component. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Base ExceptionInterface for the Asset component. symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Asset\Exception\ExceptionInterface") Base LogicException for the Asset component. symfony Symfony\Component\Intl\ResourceBundle Symfony\Component\Intl\ResourceBundle ===================================== Classes ------- | | | | --- | --- | | [CurrencyBundle](resourcebundle/currencybundle "Symfony\Component\Intl\ResourceBundle\CurrencyBundle") | Default implementation of {@link CurrencyBundleInterface}. | | [LanguageBundle](resourcebundle/languagebundle "Symfony\Component\Intl\ResourceBundle\LanguageBundle") | Default implementation of {@link LanguageBundleInterface}. | | [LocaleBundle](resourcebundle/localebundle "Symfony\Component\Intl\ResourceBundle\LocaleBundle") | Default implementation of {@link LocaleBundleInterface}. | | [RegionBundle](resourcebundle/regionbundle "Symfony\Component\Intl\ResourceBundle\RegionBundle") | Default implementation of {@link RegionBundleInterface}. | Interfaces ---------- | | | | --- | --- | | *[CurrencyBundleInterface](resourcebundle/currencybundleinterface "Symfony\Component\Intl\ResourceBundle\CurrencyBundleInterface")* | Gives access to currency-related ICU data. | | *[LanguageBundleInterface](resourcebundle/languagebundleinterface "Symfony\Component\Intl\ResourceBundle\LanguageBundleInterface")* | Gives access to language-related ICU data. | | *[LocaleBundleInterface](resourcebundle/localebundleinterface "Symfony\Component\Intl\ResourceBundle\LocaleBundleInterface")* | Gives access to locale-related ICU data. | | *[RegionBundleInterface](resourcebundle/regionbundleinterface "Symfony\Component\Intl\ResourceBundle\RegionBundleInterface")* | Gives access to region-related ICU data. | | *[ResourceBundleInterface](resourcebundle/resourcebundleinterface "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface")* | Gives access to ICU data. | symfony Intl Intl ===== class **Intl** Gives access to internationalization data. Constants --------- | | | | --- | --- | | BUFFER\_SIZE | *The number of resource bundles to buffer. Loading the same resource bundle for n locales takes up n spots in the buffer.* | | CURRENCY\_DIR | *The directory name of the currency data.* | | LANGUAGE\_DIR | *The directory name of the language data.* | | SCRIPT\_DIR | *The directory name of the script data.* | | LOCALE\_DIR | *The directory name of the locale data.* | | REGION\_DIR | *The directory name of the region data.* | Methods ------- | | | | | --- | --- | --- | | static bool | [isExtensionLoaded](#method_isExtensionLoaded)() Returns whether the intl extension is installed. | | | static [CurrencyBundleInterface](resourcebundle/currencybundleinterface "Symfony\Component\Intl\ResourceBundle\CurrencyBundleInterface") | [getCurrencyBundle](#method_getCurrencyBundle)() Returns the bundle containing currency information. | | | static [LanguageBundleInterface](resourcebundle/languagebundleinterface "Symfony\Component\Intl\ResourceBundle\LanguageBundleInterface") | [getLanguageBundle](#method_getLanguageBundle)() Returns the bundle containing language information. | | | static [LocaleBundleInterface](resourcebundle/localebundleinterface "Symfony\Component\Intl\ResourceBundle\LocaleBundleInterface") | [getLocaleBundle](#method_getLocaleBundle)() Returns the bundle containing locale information. | | | static [RegionBundleInterface](resourcebundle/regionbundleinterface "Symfony\Component\Intl\ResourceBundle\RegionBundleInterface") | [getRegionBundle](#method_getRegionBundle)() Returns the bundle containing region information. | | | static string|null | [getIcuVersion](#method_getIcuVersion)() Returns the version of the installed ICU library. | | | static string | [getIcuDataVersion](#method_getIcuDataVersion)() Returns the version of the installed ICU data. | | | static string | [getIcuStubVersion](#method_getIcuStubVersion)() Returns the ICU version that the stub classes mimic. | | | static string | [getDataDirectory](#method_getDataDirectory)() Returns the absolute path to the data directory. | | Details ------- ### static bool isExtensionLoaded() Returns whether the intl extension is installed. #### Return Value | | | | --- | --- | | bool | Returns true if the intl extension is installed, false otherwise | ### static [CurrencyBundleInterface](resourcebundle/currencybundleinterface "Symfony\Component\Intl\ResourceBundle\CurrencyBundleInterface") getCurrencyBundle() Returns the bundle containing currency information. #### Return Value | | | | --- | --- | | [CurrencyBundleInterface](resourcebundle/currencybundleinterface "Symfony\Component\Intl\ResourceBundle\CurrencyBundleInterface") | The currency resource bundle | ### static [LanguageBundleInterface](resourcebundle/languagebundleinterface "Symfony\Component\Intl\ResourceBundle\LanguageBundleInterface") getLanguageBundle() Returns the bundle containing language information. #### Return Value | | | | --- | --- | | [LanguageBundleInterface](resourcebundle/languagebundleinterface "Symfony\Component\Intl\ResourceBundle\LanguageBundleInterface") | The language resource bundle | ### static [LocaleBundleInterface](resourcebundle/localebundleinterface "Symfony\Component\Intl\ResourceBundle\LocaleBundleInterface") getLocaleBundle() Returns the bundle containing locale information. #### Return Value | | | | --- | --- | | [LocaleBundleInterface](resourcebundle/localebundleinterface "Symfony\Component\Intl\ResourceBundle\LocaleBundleInterface") | The locale resource bundle | ### static [RegionBundleInterface](resourcebundle/regionbundleinterface "Symfony\Component\Intl\ResourceBundle\RegionBundleInterface") getRegionBundle() Returns the bundle containing region information. #### Return Value | | | | --- | --- | | [RegionBundleInterface](resourcebundle/regionbundleinterface "Symfony\Component\Intl\ResourceBundle\RegionBundleInterface") | The region resource bundle | ### static string|null getIcuVersion() Returns the version of the installed ICU library. #### Return Value | | | | --- | --- | | string|null | The ICU version or NULL if it could not be determined | ### static string getIcuDataVersion() Returns the version of the installed ICU data. #### Return Value | | | | --- | --- | | string | The version of the installed ICU data | ### static string getIcuStubVersion() Returns the ICU version that the stub classes mimic. #### Return Value | | | | --- | --- | | string | The ICU version of the stub classes | ### static string getDataDirectory() Returns the absolute path to the data directory. #### Return Value | | | | --- | --- | | string | The absolute path to the data directory | symfony Symfony\Component\Intl\Util Symfony\Component\Intl\Util =========================== Classes ------- | | | | --- | --- | | [GitRepository](util/gitrepository "Symfony\Component\Intl\Util\GitRepository") | | | [IcuVersion](util/icuversion "Symfony\Component\Intl\Util\IcuVersion") | Facilitates the comparison of ICU version strings. | | [IntlTestHelper](util/intltesthelper "Symfony\Component\Intl\Util\IntlTestHelper") | Helper class for preparing test cases that rely on the Intl component. | | [Version](util/version "Symfony\Component\Intl\Util\Version") | Facilitates the comparison of version strings. | symfony Symfony\Component\Intl\NumberFormatter Symfony\Component\Intl\NumberFormatter ====================================== Classes ------- | | | | --- | --- | | [NumberFormatter](numberformatter/numberformatter "Symfony\Component\Intl\NumberFormatter\NumberFormatter") | Replacement for PHP's native {@link \NumberFormatter} class. | symfony Symfony\Component\Intl\Exception Symfony\Component\Intl\Exception ================================ Classes ------- | | | | --- | --- | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\Intl\Exception\BadMethodCallException") | Base BadMethodCallException for the Intl component. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Intl\Exception\InvalidArgumentException") | InvalidArgumentException for the Intl component. | | [MethodArgumentNotImplementedException](exception/methodargumentnotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException") | | | [MethodArgumentValueNotImplementedException](exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | | | [MethodNotImplementedException](exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | | [MissingResourceException](exception/missingresourceexception "Symfony\Component\Intl\Exception\MissingResourceException") | Thrown when an invalid entry of a resource bundle was requested. | | [NotImplementedException](exception/notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") | Base exception class for not implemented behaviors of the intl extension in the Locale component. | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\Intl\Exception\OutOfBoundsException") | Base OutOfBoundsException for the Intl component. | | [ResourceBundleNotFoundException](exception/resourcebundlenotfoundexception "Symfony\Component\Intl\Exception\ResourceBundleNotFoundException") | | | [RuntimeException](exception/runtimeexception "Symfony\Component\Intl\Exception\RuntimeException") | RuntimeException for the Intl component. | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\Intl\Exception\UnexpectedTypeException") | Thrown when a method argument had an unexpected type. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Intl\Exception\ExceptionInterface")* | Base ExceptionInterface for the Intl component. | symfony Symfony\Component\Intl\Collator Symfony\Component\Intl\Collator =============================== Classes ------- | | | | --- | --- | | [Collator](collator/collator "Symfony\Component\Intl\Collator\Collator") | Replacement for PHP's native {@link \Collator} class. | symfony Symfony\Component\Intl\Data Symfony\Component\Intl\Data =========================== Namespaces ---------- [Symfony\Component\Intl\Data\Bundle](data/bundle)[Symfony\Component\Intl\Data\Generator](data/generator)[Symfony\Component\Intl\Data\Provider](data/provider)[Symfony\Component\Intl\Data\Util](data/util)
programming_docs
symfony Symfony\Component\Intl\DateFormatter Symfony\Component\Intl\DateFormatter ==================================== Namespaces ---------- [Symfony\Component\Intl\DateFormatter\DateFormat](dateformatter/dateformat) Classes ------- | | | | --- | --- | | [IntlDateFormatter](dateformatter/intldateformatter "Symfony\Component\Intl\DateFormatter\IntlDateFormatter") | Replacement for PHP's native {@link \IntlDateFormatter} class. | symfony Locale Locale ======= class **Locale** extends [Locale](http://php.net/Locale) Provides access to locale-related data. Methods ------- | | | | | --- | --- | --- | | static | [setDefaultFallback](#method_setDefaultFallback)(string|null $locale) Sets the default fallback locale. | | | static string|null | [getDefaultFallback](#method_getDefaultFallback)() Returns the default fallback locale. | | | static string|null | [getFallback](#method_getFallback)(string $locale) Returns the fallback locale for a given locale. | | Details ------- ### static setDefaultFallback(string|null $locale) Sets the default fallback locale. The default fallback locale is used as fallback for locales that have no fallback otherwise. #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The default fallback locale | #### See also | | | | --- | --- | | getFallback() | | ### static string|null getDefaultFallback() Returns the default fallback locale. #### Return Value | | | | --- | --- | | string|null | The default fallback locale | #### See also | | | | --- | --- | | setDefaultFallback() | | | getFallback() | | ### static string|null getFallback(string $locale) Returns the fallback locale for a given locale. For example, the fallback of "fr\_FR" is "fr". The fallback of "fr" is the default fallback locale configured with {@link setDefaultFallback()}. The default fallback locale has no fallback. #### Parameters | | | | | --- | --- | --- | | string | $locale | The ICU locale code to find the fallback for | #### Return Value | | | | --- | --- | | string|null | The ICU locale code of the fallback locale, or null if no fallback exists | symfony Symfony\Component\Intl\Globals Symfony\Component\Intl\Globals ============================== Classes ------- | | | | --- | --- | | [IntlGlobals](globals/intlglobals "Symfony\Component\Intl\Globals\IntlGlobals") | Provides fake static versions of the global functions in the intl extension. | symfony IntlGlobals IntlGlobals ============ abstract class **IntlGlobals** Provides fake static versions of the global functions in the intl extension. Constants --------- | | | | --- | --- | | U\_ZERO\_ERROR | *Indicates that no error occurred.* | | U\_ILLEGAL\_ARGUMENT\_ERROR | *Indicates that an invalid argument was passed.* | | U\_PARSE\_ERROR | *Indicates that the parse() operation failed.* | Methods ------- | | | | | --- | --- | --- | | static bool | [isFailure](#method_isFailure)(int $errorCode) Returns whether the error code indicates a failure. | | | static int | [getErrorCode](#method_getErrorCode)() Returns the error code of the last operation. | | | static string | [getErrorMessage](#method_getErrorMessage)() Returns the error message of the last operation. | | | static string | [getErrorName](#method_getErrorName)(int $code) Returns the symbolic name for a given error code. | | | static | [setError](#method_setError)(int $code, string $message = '') Sets the current error. | | Details ------- ### static bool isFailure(int $errorCode) Returns whether the error code indicates a failure. #### Parameters | | | | | --- | --- | --- | | int | $errorCode | The error code returned by IntlGlobals::getErrorCode() | #### Return Value | | | | --- | --- | | bool | | ### static int getErrorCode() Returns the error code of the last operation. Returns IntlGlobals::U\_ZERO\_ERROR if no error occurred. #### Return Value | | | | --- | --- | | int | | ### static string getErrorMessage() Returns the error message of the last operation. Returns "U\_ZERO\_ERROR" if no error occurred. #### Return Value | | | | --- | --- | | string | | ### static string getErrorName(int $code) Returns the symbolic name for a given error code. #### Parameters | | | | | --- | --- | --- | | int | $code | The error code returned by IntlGlobals::getErrorCode() | #### Return Value | | | | --- | --- | | string | | ### static setError(int $code, string $message = '') Sets the current error. #### Parameters | | | | | --- | --- | --- | | int | $code | One of the error constants in this class | | string | $message | The ICU class error message | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the code is not one of the error constants in this class | symfony IntlDateFormatter IntlDateFormatter ================== class **IntlDateFormatter** Replacement for PHP's native {@link \IntlDateFormatter} class. The only methods currently supported in this class are: * {@link \_\_construct} * {@link create} * {@link format} * {@link getCalendar} * {@link getDateType} * {@link getErrorCode} * {@link getErrorMessage} * {@link getLocale} * {@link getPattern} * {@link getTimeType} * {@link getTimeZoneId} * {@link isLenient} * {@link parse} * {@link setLenient} * {@link setPattern} * {@link setTimeZoneId} * {@link setTimeZone} Constants --------- | | | | --- | --- | | NONE | | | FULL | | | LONG | | | MEDIUM | | | SHORT | | | TRADITIONAL | | | GREGORIAN | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected int | $errorCode | The error code from the last operation. | | | protected string | $errorMessage | The error message from the last operation. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $locale, int $datetype, int $timetype, mixed $timezone = null, int|null $calendar = self::GREGORIAN, string $pattern = null) | | | static [IntlDateFormatter](intldateformatter "Symfony\Component\Intl\DateFormatter\IntlDateFormatter") | [create](#method_create)(string $locale, int $datetype, int $timetype, string $timezone = null, int $calendar = self::GREGORIAN, string $pattern = null) Static constructor. | | | string|bool | [format](#method_format)(int|[DateTime](http://php.net/DateTime) $timestamp) Format the date/time value (timestamp) as a string. | | | string | [formatObject](#method_formatObject)(object $object, mixed $format = null, string $locale = null) Not supported. Formats an object. | | | int | [getCalendar](#method_getCalendar)() Returns the formatter's calendar. | | | object | [getCalendarObject](#method_getCalendarObject)() Not supported. Returns the formatter's calendar object. | | | int | [getDateType](#method_getDateType)() Returns the formatter's datetype. | | | int | [getErrorCode](#method_getErrorCode)() Returns formatter's last error code. Always returns the U\_ZERO\_ERROR class constant value. | | | string | [getErrorMessage](#method_getErrorMessage)() Returns formatter's last error message. Always returns the U\_ZERO\_ERROR\_MESSAGE class constant value. | | | string | [getLocale](#method_getLocale)(int $type = Locale::ACTUAL\_LOCALE) Returns the formatter's locale. | | | string | [getPattern](#method_getPattern)() Returns the formatter's pattern. | | | int | [getTimeType](#method_getTimeType)() Returns the formatter's time type. | | | string | [getTimeZoneId](#method_getTimeZoneId)() Returns the formatter's timezone identifier. | | | mixed | [getTimeZone](#method_getTimeZone)() Not supported. Returns the formatter's timezone. | | | bool | [isLenient](#method_isLenient)() Returns whether the formatter is lenient. | | | string | [localtime](#method_localtime)(string $value, int $position = 0) Not supported. Parse string to a field-based time value. | | | int | [parse](#method_parse)(string $value, int $position = null) Parse string to a timestamp value. | | | bool | [setCalendar](#method_setCalendar)(string $calendar) Not supported. Set the formatter's calendar. | | | bool | [setLenient](#method_setLenient)(bool $lenient) Set the leniency of the parser. | | | bool | [setPattern](#method_setPattern)(string $pattern) Set the formatter's pattern. | | | bool | [setTimeZoneId](#method_setTimeZoneId)(string $timeZoneId) Set the formatter's timezone identifier. | | | bool | [setTimeZone](#method_setTimeZone)(mixed $timeZone) This method was added in PHP 5.5 as replacement for `setTimeZoneId()`. | | | [DateTime](http://php.net/DateTime) | [createDateTime](#method_createDateTime)(int $timestamp) Create and returns a DateTime object with the specified timestamp and with the current time zone. | | | string | [getDefaultPattern](#method_getDefaultPattern)() Returns a pattern string based in the datetype and timetype values. | | Details ------- ### \_\_construct(string|null $locale, int $datetype, int $timetype, mixed $timezone = null, int|null $calendar = self::GREGORIAN, string $pattern = null) #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en") | | int | $datetype | Type of date formatting, one of the format type constants | | int | $timetype | Type of time formatting, one of the format type constants | | mixed | $timezone | Timezone identifier | | int|null | $calendar | Calendar to use for formatting or parsing. The only currently supported value is IntlDateFormatter::GREGORIAN (or null using the default calendar, i.e. "GREGORIAN") | | string | $pattern | Optional pattern to use when formatting | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $locale different than "en" or null is passed | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $calendar different than GREGORIAN is passed | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.create.php> | | | <http://userguide.icu-project.org/formatparse/datetime> | | ### static [IntlDateFormatter](intldateformatter "Symfony\Component\Intl\DateFormatter\IntlDateFormatter") create(string $locale, int $datetype, int $timetype, string $timezone = null, int $calendar = self::GREGORIAN, string $pattern = null) Static constructor. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en") | | int | $datetype | Type of date formatting, one of the format type constants | | int | $timetype | Type of time formatting, one of the format type constants | | string | $timezone | Timezone identifier | | int | $calendar | Calendar to use for formatting or parsing; default is Gregorian One of the calendar constants | | string | $pattern | Optional pattern to use when formatting | #### Return Value | | | | --- | --- | | [IntlDateFormatter](intldateformatter "Symfony\Component\Intl\DateFormatter\IntlDateFormatter") | | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $locale different than "en" or null is passed | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $calendar different than GREGORIAN is passed | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.create.php> | | | <http://userguide.icu-project.org/formatparse/datetime> | | ### string|bool format(int|[DateTime](http://php.net/DateTime) $timestamp) Format the date/time value (timestamp) as a string. #### Parameters | | | | | --- | --- | --- | | int|[DateTime](http://php.net/DateTime) | $timestamp | The timestamp to format | #### Return Value | | | | --- | --- | | string|bool | The formatted value or false if formatting failed | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | If one of the formatting characters is not implemented | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.format.php> | | ### string formatObject(object $object, mixed $format = null, string $locale = null) Not supported. Formats an object. #### Parameters | | | | | --- | --- | --- | | object | $object | | | mixed | $format | | | string | $locale | | #### Return Value | | | | --- | --- | | string | The formatted value | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.formatobject.php> | | ### int getCalendar() Returns the formatter's calendar. #### Return Value | | | | --- | --- | | int | The calendar being used by the formatter. Currently always returns IntlDateFormatter::GREGORIAN. | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.getcalendar.php> | | ### object getCalendarObject() Not supported. Returns the formatter's calendar object. #### Return Value | | | | --- | --- | | object | The calendar's object being used by the formatter | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.getcalendarobject.php> | | ### int getDateType() Returns the formatter's datetype. #### Return Value | | | | --- | --- | | int | The current value of the formatter | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.getdatetype.php> | | ### int getErrorCode() Returns formatter's last error code. Always returns the U\_ZERO\_ERROR class constant value. #### Return Value | | | | --- | --- | | int | The error code from last formatter call | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.geterrorcode.php> | | ### string getErrorMessage() Returns formatter's last error message. Always returns the U\_ZERO\_ERROR\_MESSAGE class constant value. #### Return Value | | | | --- | --- | | string | The error message from last formatter call | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.geterrormessage.php> | | ### string getLocale(int $type = Locale::ACTUAL\_LOCALE) Returns the formatter's locale. #### Parameters | | | | | --- | --- | --- | | int | $type | Not supported. The locale name type to return (Locale::VALID\_LOCALE or Locale::ACTUAL\_LOCALE) | #### Return Value | | | | --- | --- | | string | The locale used to create the formatter. Currently always returns "en". | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.getlocale.php> | | ### string getPattern() Returns the formatter's pattern. #### Return Value | | | | --- | --- | | string | The pattern string used by the formatter | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.getpattern.php> | | ### int getTimeType() Returns the formatter's time type. #### Return Value | | | | --- | --- | | int | The time type used by the formatter | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.gettimetype.php> | | ### string getTimeZoneId() Returns the formatter's timezone identifier. #### Return Value | | | | --- | --- | | string | The timezone identifier used by the formatter | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.gettimezoneid.php> | | ### mixed getTimeZone() Not supported. Returns the formatter's timezone. #### Return Value | | | | --- | --- | | mixed | The timezone used by the formatter | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.gettimezone.php> | | ### bool isLenient() Returns whether the formatter is lenient. #### Return Value | | | | --- | --- | | bool | Currently always returns false | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.islenient.php> | | ### string localtime(string $value, int $position = 0) Not supported. Parse string to a field-based time value. #### Parameters | | | | | --- | --- | --- | | string | $value | String to convert to a time value | | int | $position | Position at which to start the parsing in $value (zero-based) If no error occurs before $value is consumed, $parse\_pos will contain -1 otherwise it will contain the position at which parsing ended. If $parse\_pos > strlen($value), the parse fails immediately. | #### Return Value | | | | --- | --- | | string | Localtime compatible array of integers: contains 24 hour clock value in tm\_hour field | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.localtime.php> | | ### int parse(string $value, int $position = null) Parse string to a timestamp value. #### Parameters | | | | | --- | --- | --- | | string | $value | String to convert to a time value | | int | $position | Not supported. Position at which to start the parsing in $value (zero-based) If no error occurs before $value is consumed, $parse\_pos will contain -1 otherwise it will contain the position at which parsing ended. If $parse\_pos > strlen($value), the parse fails immediately. | #### Return Value | | | | --- | --- | | int | Parsed value as a timestamp | #### Exceptions | | | | --- | --- | | [MethodArgumentNotImplementedException](../exception/methodargumentnotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException") | When $position different than null, behavior not implemented | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.parse.php> | | ### bool setCalendar(string $calendar) Not supported. Set the formatter's calendar. #### Parameters | | | | | --- | --- | --- | | string | $calendar | The calendar to use. Default is IntlDateFormatter::GREGORIAN | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.setcalendar.php> | | ### bool setLenient(bool $lenient) Set the leniency of the parser. Define if the parser is strict or lenient in interpreting inputs that do not match the pattern exactly. Enabling lenient parsing allows the parser to accept otherwise flawed date or time patterns, parsing as much as possible to obtain a value. Extra space, unrecognized tokens, or invalid values ("February 30th") are not accepted. #### Parameters | | | | | --- | --- | --- | | bool | $lenient | Sets whether the parser is lenient or not. Currently only false (strict) is supported. | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $lenient is true | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.setlenient.php> | | ### bool setPattern(string $pattern) Set the formatter's pattern. #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern string in conformance with the ICU IntlDateFormatter documentation | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.setpattern.php> | | | <http://userguide.icu-project.org/formatparse/datetime> | | ### bool setTimeZoneId(string $timeZoneId) Set the formatter's timezone identifier. #### Parameters | | | | | --- | --- | --- | | string | $timeZoneId | The time zone ID string of the time zone to use. If NULL or the empty string, the default time zone for the runtime is used. | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.settimezoneid.php> | | ### bool setTimeZone(mixed $timeZone) This method was added in PHP 5.5 as replacement for `setTimeZoneId()`. #### Parameters | | | | | --- | --- | --- | | mixed | $timeZone | | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/intldateformatter.settimezone.php> | | ### protected [DateTime](http://php.net/DateTime) createDateTime(int $timestamp) Create and returns a DateTime object with the specified timestamp and with the current time zone. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | | #### Return Value | | | | --- | --- | | [DateTime](http://php.net/DateTime) | | ### protected string getDefaultPattern() Returns a pattern string based in the datetype and timetype values. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony Symfony\Component\Intl\DateFormatter\DateFormat Symfony\Component\Intl\DateFormatter\DateFormat =============================================== Classes ------- | | | | --- | --- | | [AmPmTransformer](dateformat/ampmtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\AmPmTransformer") | Parser and formatter for AM/PM markers format. | | [DayOfWeekTransformer](dateformat/dayofweektransformer "Symfony\Component\Intl\DateFormatter\DateFormat\DayOfWeekTransformer") | Parser and formatter for day of week format. | | [DayOfYearTransformer](dateformat/dayofyeartransformer "Symfony\Component\Intl\DateFormatter\DateFormat\DayOfYearTransformer") | Parser and formatter for day of year format. | | [DayTransformer](dateformat/daytransformer "Symfony\Component\Intl\DateFormatter\DateFormat\DayTransformer") | Parser and formatter for day format. | | [FullTransformer](dateformat/fulltransformer "Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer") | Parser and formatter for date formats. | | [Hour1200Transformer](dateformat/hour1200transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Hour1200Transformer") | Parser and formatter for 12 hour format (0-11). | | [Hour1201Transformer](dateformat/hour1201transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Hour1201Transformer") | Parser and formatter for 12 hour format (1-12). | | [Hour2400Transformer](dateformat/hour2400transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Hour2400Transformer") | Parser and formatter for 24 hour format (0-23). | | [Hour2401Transformer](dateformat/hour2401transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Hour2401Transformer") | Parser and formatter for 24 hour format (1-24). | | [HourTransformer](dateformat/hourtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer") | Base class for hour transformers. | | [MinuteTransformer](dateformat/minutetransformer "Symfony\Component\Intl\DateFormatter\DateFormat\MinuteTransformer") | Parser and formatter for minute format. | | [MonthTransformer](dateformat/monthtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer") | Parser and formatter for month format. | | [QuarterTransformer](dateformat/quartertransformer "Symfony\Component\Intl\DateFormatter\DateFormat\QuarterTransformer") | Parser and formatter for quarter format. | | [SecondTransformer](dateformat/secondtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\SecondTransformer") | Parser and formatter for the second format. | | [TimezoneTransformer](dateformat/timezonetransformer "Symfony\Component\Intl\DateFormatter\DateFormat\TimezoneTransformer") | Parser and formatter for time zone format. | | [Transformer](dateformat/transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Parser and formatter for date formats. | | [YearTransformer](dateformat/yeartransformer "Symfony\Component\Intl\DateFormatter\DateFormat\YearTransformer") | Parser and formatter for year format. | symfony FullTransformer FullTransformer ================ class **FullTransformer** Parser and formatter for date formats. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $pattern, string $timezone) | | | [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer")[] | [getTransformers](#method_getTransformers)() Return the array of Transformer objects. | | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime) Format a DateTime using ICU dateformat pattern. | | | string | [formatReplace](#method_formatReplace)(string $dateChars, [DateTime](http://php.net/DateTime) $dateTime) Return the formatted ICU value for the matched date characters. | | | int|false | [parse](#method_parse)([DateTime](http://php.net/DateTime) $dateTime, string $value) Parse a pattern based string to a timestamp value. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(string $pattern) Retrieve a regular expression to match with a formatted value. | | | bool | [isQuoteMatch](#method_isQuoteMatch)(string $quoteMatch) Check if the first char of a string is a single quote. | | | string | [replaceQuoteMatch](#method_replaceQuoteMatch)(string $quoteMatch) Replaces single quotes at the start or end of a string with two single quotes. | | | string | [buildCharsMatch](#method_buildCharsMatch)(string $specialChars) Builds a chars match regular expression. | | | array | [normalizeArray](#method_normalizeArray)(array $data) Normalize a preg\_replace match array, removing the numeric keys and returning an associative array with the value and pattern values for the matched Transformer. | | | bool|int | [calculateUnixTimestamp](#method_calculateUnixTimestamp)([DateTime](http://php.net/DateTime) $dateTime, array $options) Calculates the Unix timestamp based on the matched values by the reverse matching regular expression of parse(). | | Details ------- ### \_\_construct(string $pattern, string $timezone) #### Parameters | | | | | --- | --- | --- | | string | $pattern | The pattern to be used to format and/or parse values | | string | $timezone | The timezone to perform the date/time calculations | ### [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer")[] getTransformers() Return the array of Transformer objects. #### Return Value | | | | --- | --- | | [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer")[] | Associative array of Transformer objects (format char => Transformer) | ### string format([DateTime](http://php.net/DateTime) $dateTime) Format a DateTime using ICU dateformat pattern. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | #### Return Value | | | | --- | --- | | string | The formatted value | ### string formatReplace(string $dateChars, [DateTime](http://php.net/DateTime) $dateTime) Return the formatted ICU value for the matched date characters. #### Parameters | | | | | --- | --- | --- | | string | $dateChars | The date characters to be replaced with a formatted ICU value | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | #### Return Value | | | | --- | --- | | string | The formatted value | #### Exceptions | | | | --- | --- | | [NotImplementedException](../../exception/notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") | When it encounters a not implemented date character | ### int|false parse([DateTime](http://php.net/DateTime) $dateTime, string $value) Parse a pattern based string to a timestamp value. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A configured DateTime object to use to perform the date calculation | | string | $value | String to convert to a time value | #### Return Value | | | | --- | --- | | int|false | The corresponding Unix timestamp | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the value can not be matched with pattern | ### string getReverseMatchingRegExp(string $pattern) Retrieve a regular expression to match with a formatted value. #### Parameters | | | | | --- | --- | --- | | string | $pattern | The pattern to create the reverse matching regular expression | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression with named captures being formed by the transformer index in the $transformer array | ### bool isQuoteMatch(string $quoteMatch) Check if the first char of a string is a single quote. #### Parameters | | | | | --- | --- | --- | | string | $quoteMatch | The string to check | #### Return Value | | | | --- | --- | | bool | true if matches, false otherwise | ### string replaceQuoteMatch(string $quoteMatch) Replaces single quotes at the start or end of a string with two single quotes. #### Parameters | | | | | --- | --- | --- | | string | $quoteMatch | The string to replace the quotes | #### Return Value | | | | --- | --- | | string | A string with the single quotes replaced | ### protected string buildCharsMatch(string $specialChars) Builds a chars match regular expression. #### Parameters | | | | | --- | --- | --- | | string | $specialChars | A string of chars to build the regular expression | #### Return Value | | | | --- | --- | | string | The chars match regular expression | ### protected array normalizeArray(array $data) Normalize a preg\_replace match array, removing the numeric keys and returning an associative array with the value and pattern values for the matched Transformer. #### Parameters | | | | | --- | --- | --- | | array | $data | | #### Return Value | | | | --- | --- | | array | | ### protected bool|int calculateUnixTimestamp([DateTime](http://php.net/DateTime) $dateTime, array $options) Calculates the Unix timestamp based on the matched values by the reverse matching regular expression of parse(). #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | The DateTime object to be used to calculate the timestamp | | array | $options | An array with the matched values to be used to calculate the timestamp | #### Return Value | | | | --- | --- | | bool|int | The calculated timestamp or false if matched date is invalid | symfony HourTransformer HourTransformer ================ abstract class **HourTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Base class for hour transformers. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | from [Transformer](transformer#method_format "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | from [Transformer](transformer#method_getReverseMatchingRegExp "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | from [Transformer](transformer#method_extractDateOptions "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | int | [normalizeHour](#method_normalizeHour)(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. | | Details ------- ### abstract string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### abstract string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### abstract array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### abstract int normalizeHour(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. #### Parameters | | | | | --- | --- | --- | | int | $hour | The hour value | | string | $marker | An optional AM/PM marker | #### Return Value | | | | --- | --- | | int | The normalized hour value | symfony DayOfYearTransformer DayOfYearTransformer ===================== class **DayOfYearTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for day of year format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony Transformer Transformer ============ abstract class **Transformer** Parser and formatter for date formats. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | | Details ------- ### abstract string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### abstract string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### abstract array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony AmPmTransformer AmPmTransformer ================ class **AmPmTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for AM/PM markers format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string |
programming_docs
symfony MonthTransformer MonthTransformer ================= class **MonthTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for month format. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $months | | | | static protected | $shortMonths | Short months names (first 3 letters). | | | static protected | $flippedMonths | Flipped $months array, $name => $index. | | | static protected | $flippedShortMonths | Flipped $shortMonths array, $name => $index. | | Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | | [\_\_construct](#method___construct)() | | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### \_\_construct() symfony TimezoneTransformer TimezoneTransformer ==================== class **TimezoneTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for time zone format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | static string | [getEtcTimeZoneId](#method_getEtcTimeZoneId)(string $formattedTimeZone) Get an Etc/GMT timezone identifier for the specified timezone. | | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### static string getEtcTimeZoneId(string $formattedTimeZone) Get an Etc/GMT timezone identifier for the specified timezone. The PHP documentation for timezones states to not use the 'Other' time zones because them exists "for backwards compatibility". However all Etc/GMT time zones are in the tz database 'etcetera' file, which indicates they are not deprecated (neither are old names). Only GMT, Etc/Universal, Etc/Zulu, Etc/Greenwich, Etc/GMT-0, Etc/GMT+0 and Etc/GMT0 are old names and are linked to Etc/GMT or Etc/UTC. #### Parameters | | | | | --- | --- | --- | | string | $formattedTimeZone | A GMT timezone string (GMT-03:00, e.g.) | #### Return Value | | | | --- | --- | | string | A timezone identifier | #### Exceptions | | | | --- | --- | | [NotImplementedException](../../exception/notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") | When the GMT time zone have minutes offset different than zero | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the value can not be matched with pattern | #### See also | | | | --- | --- | | <http://php.net/manual/en/timezones.others.php> | | | <http://www.twinsun.com/tz/tz-link.htm> | | symfony Hour1200Transformer Hour1200Transformer ==================== class **Hour1200Transformer** extends [HourTransformer](hourtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer") Parser and formatter for 12 hour format (0-11). Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | int | [normalizeHour](#method_normalizeHour)(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. | | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### int normalizeHour(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. #### Parameters | | | | | --- | --- | --- | | int | $hour | The hour value | | string | $marker | An optional AM/PM marker | #### Return Value | | | | --- | --- | | int | The normalized hour value | symfony DayOfWeekTransformer DayOfWeekTransformer ===================== class **DayOfWeekTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for day of week format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony MinuteTransformer MinuteTransformer ================== class **MinuteTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for minute format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony Hour2401Transformer Hour2401Transformer ==================== class **Hour2401Transformer** extends [HourTransformer](hourtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer") Parser and formatter for 24 hour format (1-24). Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | int | [normalizeHour](#method_normalizeHour)(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. | | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### int normalizeHour(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. #### Parameters | | | | | --- | --- | --- | | int | $hour | The hour value | | string | $marker | An optional AM/PM marker | #### Return Value | | | | --- | --- | | int | The normalized hour value | symfony QuarterTransformer QuarterTransformer =================== class **QuarterTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for quarter format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string |
programming_docs
symfony DayTransformer DayTransformer =============== class **DayTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for day format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony Hour2400Transformer Hour2400Transformer ==================== class **Hour2400Transformer** extends [HourTransformer](hourtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer") Parser and formatter for 24 hour format (0-23). Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | int | [normalizeHour](#method_normalizeHour)(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. | | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### int normalizeHour(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. #### Parameters | | | | | --- | --- | --- | | int | $hour | The hour value | | string | $marker | An optional AM/PM marker | #### Return Value | | | | --- | --- | | int | The normalized hour value | symfony YearTransformer YearTransformer ================ class **YearTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for year format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony Hour1201Transformer Hour1201Transformer ==================== class **Hour1201Transformer** extends [HourTransformer](hourtransformer "Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer") Parser and formatter for 12 hour format (1-12). Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | | int | [normalizeHour](#method_normalizeHour)(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. | | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | ### int normalizeHour(int $hour, string $marker = null) Returns a normalized hour value suitable for the hour transformer type. #### Parameters | | | | | --- | --- | --- | | int | $hour | The hour value | | string | $marker | An optional AM/PM marker | #### Return Value | | | | --- | --- | | int | The normalized hour value | symfony SecondTransformer SecondTransformer ================== class **SecondTransformer** extends [Transformer](transformer "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") Parser and formatter for the second format. Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. | | | string | [getReverseMatchingRegExp](#method_getReverseMatchingRegExp)(int $length) Returns a reverse matching regular expression of a string generated by format(). | | | array | [extractDateOptions](#method_extractDateOptions)(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. | | | string | [padLeft](#method_padLeft)(string $value, int $length) Pad a string with zeros to the left. | from [Transformer](transformer#method_padLeft "Symfony\Component\Intl\DateFormatter\DateFormat\Transformer") | Details ------- ### string format([DateTime](http://php.net/DateTime) $dateTime, int $length) Format a value using a configured DateTime as date/time source. #### Parameters | | | | | --- | --- | --- | | [DateTime](http://php.net/DateTime) | $dateTime | A DateTime object to be used to generate the formatted value | | int | $length | The formatted value string length | #### Return Value | | | | --- | --- | | string | The formatted value | ### string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). #### Parameters | | | | | --- | --- | --- | | int | $length | The length of the value to be reverse matched | #### Return Value | | | | --- | --- | | string | The reverse matching regular expression | ### array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. #### Parameters | | | | | --- | --- | --- | | string | $matched | The matched value | | int | $length | The length of the Transformer pattern string | #### Return Value | | | | --- | --- | | array | An associative array | ### protected string padLeft(string $value, int $length) Pad a string with zeros to the left. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to be padded | | int | $length | The length to pad | #### Return Value | | | | --- | --- | | string | The padded string | symfony Locale Locale ======= class **Locale** Replacement for PHP's native {@link \Locale} class. The only methods supported in this class are `getDefault` and `canonicalize`. All other methods will throw an exception when used. Constants --------- | | | | --- | --- | | DEFAULT\_LOCALE | | | ACTUAL\_LOCALE | | | VALID\_LOCALE | | | LANG\_TAG | | | EXTLANG\_TAG | | | SCRIPT\_TAG | | | REGION\_TAG | | | VARIANT\_TAG | | | GRANDFATHERED\_LANG\_TAG | | | PRIVATE\_TAG | | Methods ------- | | | | | --- | --- | --- | | static string | [acceptFromHttp](#method_acceptFromHttp)(string $header) Not supported. Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616. | | | static string | [canonicalize](#method_canonicalize)(string $locale) Returns a canonicalized locale string. | | | static string | [composeLocale](#method_composeLocale)(array $subtags) Not supported. Returns a correctly ordered and delimited locale code. | | | static string | [filterMatches](#method_filterMatches)(string $langtag, string $locale, bool $canonicalize = false) Not supported. Checks if a language tag filter matches with locale. | | | static array | [getAllVariants](#method_getAllVariants)(string $locale) Not supported. Returns the variants for the input locale. | | | static string | [getDefault](#method_getDefault)() Returns the default locale. | | | static string | [getDisplayLanguage](#method_getDisplayLanguage)(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale language. | | | static string | [getDisplayName](#method_getDisplayName)(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale. | | | static string | [getDisplayRegion](#method_getDisplayRegion)(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale region. | | | static string | [getDisplayScript](#method_getDisplayScript)(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale script. | | | static string | [getDisplayVariant](#method_getDisplayVariant)(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale variant. | | | static array | [getKeywords](#method_getKeywords)(string $locale) Not supported. Returns the keywords for the locale. | | | static string|null | [getPrimaryLanguage](#method_getPrimaryLanguage)(string $locale) Not supported. Returns the primary language for the locale. | | | static string|null | [getRegion](#method_getRegion)(string $locale) Not supported. Returns the region for the locale. | | | static string|null | [getScript](#method_getScript)(string $locale) Not supported. Returns the script for the locale. | | | static | [lookup](#method_lookup)(array $langtag, string $locale, bool $canonicalize = false, string $default = null) Not supported. Returns the closest language tag for the locale. | | | static array | [parseLocale](#method_parseLocale)(string $locale) Not supported. Returns an associative array of locale identifier subtags. | | | static bool | [setDefault](#method_setDefault)(string $locale) Not supported. Sets the default runtime locale. | | Details ------- ### static string acceptFromHttp(string $header) Not supported. Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616. #### Parameters | | | | | --- | --- | --- | | string | $header | The string containing the "Accept-Language" header value | #### Return Value | | | | --- | --- | | string | The corresponding locale code | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.acceptfromhttp.php> | | ### static string canonicalize(string $locale) Returns a canonicalized locale string. This polyfill doesn't implement the full-spec algorithm. It only canonicalizes locale strings handled by the `LocaleBundle` class. #### Parameters | | | | | --- | --- | --- | | string | $locale | | #### Return Value | | | | --- | --- | | string | | ### static string composeLocale(array $subtags) Not supported. Returns a correctly ordered and delimited locale code. #### Parameters | | | | | --- | --- | --- | | array | $subtags | A keyed array where the keys identify the particular locale code subtag | #### Return Value | | | | --- | --- | | string | The corresponding locale code | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.composelocale.php> | | ### static string filterMatches(string $langtag, string $locale, bool $canonicalize = false) Not supported. Checks if a language tag filter matches with locale. #### Parameters | | | | | --- | --- | --- | | string | $langtag | The language tag to check | | string | $locale | The language range to check against | | bool | $canonicalize | | #### Return Value | | | | --- | --- | | string | The corresponding locale code | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.filtermatches.php> | | ### static array getAllVariants(string $locale) Not supported. Returns the variants for the input locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale to extract the variants from | #### Return Value | | | | --- | --- | | array | The locale variants | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getallvariants.php> | | ### static string getDefault() Returns the default locale. #### Return Value | | | | --- | --- | | string | The default locale code. Always returns 'en' | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getdefault.php> | | ### static string getDisplayLanguage(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale language. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to return the display language from | | string | $inLocale | Optional format locale code to use to display the language name | #### Return Value | | | | --- | --- | | string | The localized language display name | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getdisplaylanguage.php> | | ### static string getDisplayName(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to return the display locale name from | | string | $inLocale | Optional format locale code to use to display the locale name | #### Return Value | | | | --- | --- | | string | The localized locale display name | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getdisplayname.php> | | ### static string getDisplayRegion(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale region. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to return the display region from | | string | $inLocale | Optional format locale code to use to display the region name | #### Return Value | | | | --- | --- | | string | The localized region display name | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getdisplayregion.php> | | ### static string getDisplayScript(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale script. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to return the display script from | | string | $inLocale | Optional format locale code to use to display the script name | #### Return Value | | | | --- | --- | | string | The localized script display name | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getdisplayscript.php> | | ### static string getDisplayVariant(string $locale, string $inLocale = null) Not supported. Returns the localized display name for the locale variant. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to return the display variant from | | string | $inLocale | Optional format locale code to use to display the variant name | #### Return Value | | | | --- | --- | | string | The localized variant display name | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getdisplayvariant.php> | | ### static array getKeywords(string $locale) Not supported. Returns the keywords for the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to extract the keywords from | #### Return Value | | | | --- | --- | | array | Associative array with the extracted variants | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getkeywords.php> | | ### static string|null getPrimaryLanguage(string $locale) Not supported. Returns the primary language for the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to extract the language code from | #### Return Value | | | | --- | --- | | string|null | The extracted language code or null in case of error | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getprimarylanguage.php> | | ### static string|null getRegion(string $locale) Not supported. Returns the region for the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to extract the region code from | #### Return Value | | | | --- | --- | | string|null | The extracted region code or null if not present | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getregion.php> | | ### static string|null getScript(string $locale) Not supported. Returns the script for the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to extract the script code from | #### Return Value | | | | --- | --- | | string|null | The extracted script code or null if not present | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.getscript.php> | | ### static lookup(array $langtag, string $locale, bool $canonicalize = false, string $default = null) Not supported. Returns the closest language tag for the locale. #### Parameters | | | | | --- | --- | --- | | array | $langtag | A list of the language tags to compare to locale | | string | $locale | The locale to use as the language range when matching | | bool | $canonicalize | If true, the arguments will be converted to canonical form before matching | | string | $default | The locale to use if no match is found | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.lookup.php> | | ### static array parseLocale(string $locale) Not supported. Returns an associative array of locale identifier subtags. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code to extract the subtag array from | #### Return Value | | | | --- | --- | | array | Associative array with the extracted subtags | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.parselocale.php> | | ### static bool setDefault(string $locale) Not supported. Sets the default runtime locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/locale.setdefault.php> | |
programming_docs
symfony GitRepository GitRepository ============== class **GitRepository** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path) | | | static [GitRepository](gitrepository "Symfony\Component\Intl\Util\GitRepository") | [download](#method_download)(string $remote, string $targetDir) | | | | [getPath](#method_getPath)() | | | | [getUrl](#method_getUrl)() | | | | [getLastCommitHash](#method_getLastCommitHash)() | | | | [getLastAuthor](#method_getLastAuthor)() | | | | [getLastAuthoredDate](#method_getLastAuthoredDate)() | | | | [getLastTag](#method_getLastTag)(callable $filter = null) | | | | [checkout](#method_checkout)($branch) | | Details ------- ### \_\_construct(string $path) #### Parameters | | | | | --- | --- | --- | | string | $path | | ### static [GitRepository](gitrepository "Symfony\Component\Intl\Util\GitRepository") download(string $remote, string $targetDir) #### Parameters | | | | | --- | --- | --- | | string | $remote | | | string | $targetDir | | #### Return Value | | | | --- | --- | | [GitRepository](gitrepository "Symfony\Component\Intl\Util\GitRepository") | | ### getPath() ### getUrl() ### getLastCommitHash() ### getLastAuthor() ### getLastAuthoredDate() ### getLastTag(callable $filter = null) #### Parameters | | | | | --- | --- | --- | | callable | $filter | | ### checkout($branch) #### Parameters | | | | | --- | --- | --- | | | $branch | | symfony IcuVersion IcuVersion =========== class **IcuVersion** Facilitates the comparison of ICU version strings. Methods ------- | | | | | --- | --- | --- | | static bool | [compare](#method_compare)(string $version1, string $version2, string $operator, int|null $precision = null) Compares two ICU versions with an operator. | | | static string|null | [normalize](#method_normalize)(string $version, int|null $precision) Normalizes a version string to the number of components given in the parameter $precision. | | Details ------- ### static bool compare(string $version1, string $version2, string $operator, int|null $precision = null) Compares two ICU versions with an operator. This method is identical to {@link version\_compare()}, except that you can pass the number of regarded version components in the last argument $precision. Also, a single digit release version and a single digit major version are contracted to a two digit release version. If no major version is given, it is substituted by zero. Examples: ``` IcuVersion::compare('1.2.3', '1.2.4', '==') // => false IcuVersion::compare('1.2.3', '1.2.4', '==', 2) // => true IcuVersion::compare('1.2.3', '12.3', '==') // => true IcuVersion::compare('1', '10', '==') // => true ``` #### Parameters | | | | | --- | --- | --- | | string | $version1 | A version string | | string | $version2 | A version string to compare | | string | $operator | The comparison operator | | int|null | $precision | The number of components to compare. Pass NULL to compare the versions unchanged. | #### Return Value | | | | --- | --- | | bool | Whether the comparison succeeded | #### See also | | | | --- | --- | | normalize() | | ### static string|null normalize(string $version, int|null $precision) Normalizes a version string to the number of components given in the parameter $precision. A single digit release version and a single digit major version are contracted to a two digit release version. If no major version is given, it is substituted by zero. Examples: ``` IcuVersion::normalize('1.2.3.4'); // => '12.3.4' IcuVersion::normalize('1.2.3.4', 1); // => '12' IcuVersion::normalize('1.2.3.4', 2); // => '12.3' ``` #### Parameters | | | | | --- | --- | --- | | string | $version | An ICU version string | | int|null | $precision | The number of components to include. Pass NULL to return the version unchanged. | #### Return Value | | | | --- | --- | | string|null | the normalized ICU version or NULL if it couldn't be normalized | symfony IntlTestHelper IntlTestHelper =============== class **IntlTestHelper** Helper class for preparing test cases that rely on the Intl component. Any test that tests functionality relying on either the intl classes or the resource bundle data should call either of the methods {@link requireIntl()} or {@link requireFullIntl()}. Calling {@link requireFullIntl()} is only necessary if you use functionality in the test that is not provided by the stub intl implementation. Methods ------- | | | | | --- | --- | --- | | static | [requireIntl](#method_requireIntl)(TestCase $testCase, $minimumIcuVersion = null) Should be called before tests that work fine with the stub implementation. | | | static | [requireFullIntl](#method_requireFullIntl)(TestCase $testCase, $minimumIcuVersion = null) Should be called before tests that require a feature-complete intl implementation. | | | static | [require32Bit](#method_require32Bit)(TestCase $testCase) Skips the test unless the current system has a 32bit architecture. | | | static | [require64Bit](#method_require64Bit)(TestCase $testCase) Skips the test unless the current system has a 64bit architecture. | | Details ------- ### static requireIntl(TestCase $testCase, $minimumIcuVersion = null) Should be called before tests that work fine with the stub implementation. #### Parameters | | | | | --- | --- | --- | | TestCase | $testCase | | | | $minimumIcuVersion | | ### static requireFullIntl(TestCase $testCase, $minimumIcuVersion = null) Should be called before tests that require a feature-complete intl implementation. #### Parameters | | | | | --- | --- | --- | | TestCase | $testCase | | | | $minimumIcuVersion | | ### static require32Bit(TestCase $testCase) Skips the test unless the current system has a 32bit architecture. #### Parameters | | | | | --- | --- | --- | | TestCase | $testCase | | ### static require64Bit(TestCase $testCase) Skips the test unless the current system has a 64bit architecture. #### Parameters | | | | | --- | --- | --- | | TestCase | $testCase | | symfony Version Version ======== class **Version** Facilitates the comparison of version strings. Methods ------- | | | | | --- | --- | --- | | static bool | [compare](#method_compare)(string $version1, string $version2, string $operator, int|null $precision = null) Compares two versions with an operator. | | | static string|null | [normalize](#method_normalize)(string $version, int|null $precision) Normalizes a version string to the number of components given in the parameter $precision. | | Details ------- ### static bool compare(string $version1, string $version2, string $operator, int|null $precision = null) Compares two versions with an operator. This method is identical to {@link version\_compare()}, except that you can pass the number of regarded version components in the last argument $precision. Examples: ``` Version::compare('1.2.3', '1.2.4', '==') // => false Version::compare('1.2.3', '1.2.4', '==', 2) // => true ``` #### Parameters | | | | | --- | --- | --- | | string | $version1 | A version string | | string | $version2 | A version string to compare | | string | $operator | The comparison operator | | int|null | $precision | The number of components to compare. Pass NULL to compare the versions unchanged. | #### Return Value | | | | --- | --- | | bool | Whether the comparison succeeded | #### See also | | | | --- | --- | | normalize() | | ### static string|null normalize(string $version, int|null $precision) Normalizes a version string to the number of components given in the parameter $precision. Examples: ``` Version::normalize('1.2.3', 1); // => '1' Version::normalize('1.2.3', 2); // => '1.2' ``` #### Parameters | | | | | --- | --- | --- | | string | $version | A version string | | int|null | $precision | The number of components to include. Pass NULL to return the version unchanged. | #### Return Value | | | | --- | --- | | string|null | the normalized version or NULL if it couldn't be normalized | symfony LocaleBundleInterface LocaleBundleInterface ====================== interface **LocaleBundleInterface** implements [ResourceBundleInterface](resourcebundleinterface "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") Gives access to locale-related ICU data. Methods ------- | | | | | --- | --- | --- | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | from [ResourceBundleInterface](resourcebundleinterface#method_getLocales "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") | | string|null | [getLocaleName](#method_getLocaleName)(string $locale, string $displayLocale = null) Returns the name of a locale. | | | string[] | [getLocaleNames](#method_getLocaleNames)(string $displayLocale = null) Returns the names of all known locales. | | Details ------- ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | ### string|null getLocaleName(string $locale, string $displayLocale = null) Returns the name of a locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale to return the name of (e.g. "de\_AT") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the locale or NULL if not found | ### string[] getLocaleNames(string $displayLocale = null) Returns the names of all known locales. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of locale names indexed by locale codes | symfony CurrencyBundleInterface CurrencyBundleInterface ======================== interface **CurrencyBundleInterface** implements [ResourceBundleInterface](resourcebundleinterface "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") Gives access to currency-related ICU data. Methods ------- | | | | | --- | --- | --- | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | from [ResourceBundleInterface](resourcebundleinterface#method_getLocales "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") | | string|null | [getCurrencySymbol](#method_getCurrencySymbol)(string $currency, string $displayLocale = null) Returns the symbol used for a currency. | | | string|null | [getCurrencyName](#method_getCurrencyName)(string $currency, string $displayLocale = null) Returns the name of a currency. | | | string[] | [getCurrencyNames](#method_getCurrencyNames)(string $displayLocale = null) Returns the names of all known currencies. | | | int|null | [getFractionDigits](#method_getFractionDigits)(string $currency) Returns the number of digits after the comma of a currency. | | | float|int|null | [getRoundingIncrement](#method_getRoundingIncrement)(string $currency) Returns the rounding increment of a currency. | | Details ------- ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | ### string|null getCurrencySymbol(string $currency, string $displayLocale = null) Returns the symbol used for a currency. #### Parameters | | | | | --- | --- | --- | | string | $currency | A currency code (e.g. "EUR") | | string | $displayLocale | Optional. The locale to return the result in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The currency symbol or NULL if not found | ### string|null getCurrencyName(string $currency, string $displayLocale = null) Returns the name of a currency. #### Parameters | | | | | --- | --- | --- | | string | $currency | A currency code (e.g. "EUR") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the currency or NULL if not found | ### string[] getCurrencyNames(string $displayLocale = null) Returns the names of all known currencies. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of currency names indexed by currency codes | ### int|null getFractionDigits(string $currency) Returns the number of digits after the comma of a currency. #### Parameters | | | | | --- | --- | --- | | string | $currency | A currency code (e.g. "EUR") | #### Return Value | | | | --- | --- | | int|null | The number of digits after the comma or NULL if not found | ### float|int|null getRoundingIncrement(string $currency) Returns the rounding increment of a currency. The rounding increment indicates to which number a currency is rounded. For example, 1230 rounded to the nearest 50 is 1250. 1.234 rounded to the nearest 0.65 is 1.3. #### Parameters | | | | | --- | --- | --- | | string | $currency | A currency code (e.g. "EUR") | #### Return Value | | | | --- | --- | | float|int|null | The rounding increment or NULL if not found | symfony CurrencyBundle CurrencyBundle =============== class **CurrencyBundle** extends [CurrencyDataProvider](../data/provider/currencydataprovider "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") implements [CurrencyBundleInterface](currencybundleinterface "Symfony\Component\Intl\ResourceBundle\CurrencyBundleInterface") Default implementation of {@link CurrencyBundleInterface}. Constants --------- | | | | --- | --- | | INDEX\_SYMBOL | | | INDEX\_NAME | | | INDEX\_FRACTION\_DIGITS | | | INDEX\_ROUNDING\_INCREMENT | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader, [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") $localeProvider) Creates a data provider that reads currency-related data from a resource bundle. | | | | [getCurrencies](#method_getCurrencies)() | from [CurrencyDataProvider](../data/provider/currencydataprovider#method_getCurrencies "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | | | [getSymbol](#method_getSymbol)($currency, $displayLocale = null) | from [CurrencyDataProvider](../data/provider/currencydataprovider#method_getSymbol "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | | | [getName](#method_getName)($currency, $displayLocale = null) | from [CurrencyDataProvider](../data/provider/currencydataprovider#method_getName "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | | | [getNames](#method_getNames)($displayLocale = null) | from [CurrencyDataProvider](../data/provider/currencydataprovider#method_getNames "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | | | [getFractionDigits](#method_getFractionDigits)($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getFractionDigits()}. | | | | [getRoundingIncrement](#method_getRoundingIncrement)($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getRoundingIncrement()}. | | | | [getNumericCode](#method_getNumericCode)($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getNumericCode()}. | from [CurrencyDataProvider](../data/provider/currencydataprovider#method_getNumericCode "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | | | [forNumericCode](#method_forNumericCode)($numericCode) Data provider for {@link \Symfony\Component\Intl\Currency::forNumericCode()}. | from [CurrencyDataProvider](../data/provider/currencydataprovider#method_forNumericCode "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | | string|null | [getCurrencySymbol](#method_getCurrencySymbol)(string $currency, string $displayLocale = null) Returns the symbol used for a currency. | | | string|null | [getCurrencyName](#method_getCurrencyName)(string $currency, string $displayLocale = null) Returns the name of a currency. | | | string[] | [getCurrencyNames](#method_getCurrencyNames)(string $displayLocale = null) Returns the names of all known currencies. | | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader, [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") $localeProvider) Creates a data provider that reads currency-related data from a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the resource bundle | | [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | $localeProvider | | ### getCurrencies() ### getSymbol($currency, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $currency | | | | $displayLocale | | ### getName($currency, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $currency | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | ### getFractionDigits($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getFractionDigits()}. #### Parameters | | | | | --- | --- | --- | | | $currency | | ### getRoundingIncrement($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getRoundingIncrement()}. #### Parameters | | | | | --- | --- | --- | | | $currency | | ### getNumericCode($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getNumericCode()}. #### Parameters | | | | | --- | --- | --- | | | $currency | | ### forNumericCode($numericCode) Data provider for {@link \Symfony\Component\Intl\Currency::forNumericCode()}. #### Parameters | | | | | --- | --- | --- | | | $numericCode | | ### string|null getCurrencySymbol(string $currency, string $displayLocale = null) Returns the symbol used for a currency. #### Parameters | | | | | --- | --- | --- | | string | $currency | A currency code (e.g. "EUR") | | string | $displayLocale | Optional. The locale to return the result in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The currency symbol or NULL if not found | ### string|null getCurrencyName(string $currency, string $displayLocale = null) Returns the name of a currency. #### Parameters | | | | | --- | --- | --- | | string | $currency | A currency code (e.g. "EUR") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the currency or NULL if not found | ### string[] getCurrencyNames(string $displayLocale = null) Returns the names of all known currencies. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of currency names indexed by currency codes | ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes |
programming_docs
symfony LocaleBundle LocaleBundle ============= class **LocaleBundle** extends [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") implements [LocaleBundleInterface](localebundleinterface "Symfony\Component\Intl\ResourceBundle\LocaleBundleInterface") Default implementation of {@link LocaleBundleInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. | from [LocaleDataProvider](../data/provider/localedataprovider#method___construct "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | | | [getLocales](#method_getLocales)() | | | | [getAliases](#method_getAliases)() | from [LocaleDataProvider](../data/provider/localedataprovider#method_getAliases "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | | | [getName](#method_getName)($locale, $displayLocale = null) | from [LocaleDataProvider](../data/provider/localedataprovider#method_getName "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | | | [getNames](#method_getNames)($displayLocale = null) | from [LocaleDataProvider](../data/provider/localedataprovider#method_getNames "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | | string|null | [getLocaleName](#method_getLocaleName)(string $locale, string $displayLocale = null) Returns the name of a locale. | | | string[] | [getLocaleNames](#method_getLocaleNames)(string $displayLocale = null) Returns the names of all known locales. | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | ### getLocales() ### getAliases() ### getName($locale, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $locale | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | ### string|null getLocaleName(string $locale, string $displayLocale = null) Returns the name of a locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale to return the name of (e.g. "de\_AT") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the locale or NULL if not found | ### string[] getLocaleNames(string $displayLocale = null) Returns the names of all known locales. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of locale names indexed by locale codes | symfony RegionBundle RegionBundle ============= class **RegionBundle** extends [RegionDataProvider](../data/provider/regiondataprovider "Symfony\Component\Intl\Data\Provider\RegionDataProvider") implements [RegionBundleInterface](regionbundleinterface "Symfony\Component\Intl\ResourceBundle\RegionBundleInterface") Default implementation of {@link RegionBundleInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader, [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") $localeProvider) Creates a data provider that reads locale-related data from .res files. | | | | [getRegions](#method_getRegions)() | from [RegionDataProvider](../data/provider/regiondataprovider#method_getRegions "Symfony\Component\Intl\Data\Provider\RegionDataProvider") | | | [getName](#method_getName)($region, $displayLocale = null) | from [RegionDataProvider](../data/provider/regiondataprovider#method_getName "Symfony\Component\Intl\Data\Provider\RegionDataProvider") | | | [getNames](#method_getNames)($displayLocale = null) | from [RegionDataProvider](../data/provider/regiondataprovider#method_getNames "Symfony\Component\Intl\Data\Provider\RegionDataProvider") | | string|null | [getCountryName](#method_getCountryName)(string $country, string $displayLocale = null) Returns the name of a country. | | | string[] | [getCountryNames](#method_getCountryNames)(string $displayLocale = null) Returns the names of all known countries. | | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader, [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") $localeProvider) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | | [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | $localeProvider | | ### getRegions() ### getName($region, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $region | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | ### string|null getCountryName(string $country, string $displayLocale = null) Returns the name of a country. #### Parameters | | | | | --- | --- | --- | | string | $country | A country code (e.g. "US") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the country or NULL if not found | ### string[] getCountryNames(string $displayLocale = null) Returns the names of all known countries. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of country names indexed by country codes | ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | symfony LanguageBundle LanguageBundle =============== class **LanguageBundle** extends [LanguageDataProvider](../data/provider/languagedataprovider "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") implements [LanguageBundleInterface](languagebundleinterface "Symfony\Component\Intl\ResourceBundle\LanguageBundleInterface") Default implementation of {@link LanguageBundleInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader, [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") $localeProvider, [ScriptDataProvider](../data/provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") $scriptProvider) Creates a data provider that reads locale-related data from .res files. | | | | [getLanguages](#method_getLanguages)() | from [LanguageDataProvider](../data/provider/languagedataprovider#method_getLanguages "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | | | [getAliases](#method_getAliases)() | from [LanguageDataProvider](../data/provider/languagedataprovider#method_getAliases "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | | | [getName](#method_getName)($language, $displayLocale = null) | from [LanguageDataProvider](../data/provider/languagedataprovider#method_getName "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | | | [getNames](#method_getNames)($displayLocale = null) | from [LanguageDataProvider](../data/provider/languagedataprovider#method_getNames "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | | | [getAlpha3Code](#method_getAlpha3Code)($language) | from [LanguageDataProvider](../data/provider/languagedataprovider#method_getAlpha3Code "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | | string|null | [getLanguageName](#method_getLanguageName)(string $language, string|null $region = null, string $displayLocale = null) Returns the name of a language. | | | string[] | [getLanguageNames](#method_getLanguageNames)(string $displayLocale = null) Returns the names of all known languages. | | | string|null | [getScriptName](#method_getScriptName)(string $script, string $language = null, string $displayLocale = null) Returns the name of a script. | | | string[] | [getScriptNames](#method_getScriptNames)(string $displayLocale = null) Returns the names of all known scripts. | | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader, [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") $localeProvider, [ScriptDataProvider](../data/provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") $scriptProvider) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../data/bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | | [LocaleDataProvider](../data/provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | $localeProvider | | | [ScriptDataProvider](../data/provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") | $scriptProvider | | ### getLanguages() ### getAliases() ### getName($language, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $language | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | ### getAlpha3Code($language) #### Parameters | | | | | --- | --- | --- | | | $language | | ### string|null getLanguageName(string $language, string|null $region = null, string $displayLocale = null) Returns the name of a language. #### Parameters | | | | | --- | --- | --- | | string | $language | A language code (e.g. "en") | | string|null | $region | Optional. A region code (e.g. "US") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the language or NULL if not found | ### string[] getLanguageNames(string $displayLocale = null) Returns the names of all known languages. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of language names indexed by language codes | ### string|null getScriptName(string $script, string $language = null, string $displayLocale = null) Returns the name of a script. #### Parameters | | | | | --- | --- | --- | | string | $script | A script code (e.g. "Hans") | | string | $language | Optional. A language code (e.g. "zh") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the script or NULL if not found | ### string[] getScriptNames(string $displayLocale = null) Returns the names of all known scripts. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of script names indexed by script codes | ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | symfony ResourceBundleInterface ResourceBundleInterface ======================== interface **ResourceBundleInterface** Gives access to ICU data. Methods ------- | | | | | --- | --- | --- | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | | Details ------- ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | symfony LanguageBundleInterface LanguageBundleInterface ======================== interface **LanguageBundleInterface** implements [ResourceBundleInterface](resourcebundleinterface "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") Gives access to language-related ICU data. Methods ------- | | | | | --- | --- | --- | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | from [ResourceBundleInterface](resourcebundleinterface#method_getLocales "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") | | string|null | [getLanguageName](#method_getLanguageName)(string $language, string|null $region = null, string $displayLocale = null) Returns the name of a language. | | | string[] | [getLanguageNames](#method_getLanguageNames)(string $displayLocale = null) Returns the names of all known languages. | | | string|null | [getScriptName](#method_getScriptName)(string $script, string $language = null, string $displayLocale = null) Returns the name of a script. | | | string[] | [getScriptNames](#method_getScriptNames)(string $displayLocale = null) Returns the names of all known scripts. | | Details ------- ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | ### string|null getLanguageName(string $language, string|null $region = null, string $displayLocale = null) Returns the name of a language. #### Parameters | | | | | --- | --- | --- | | string | $language | A language code (e.g. "en") | | string|null | $region | Optional. A region code (e.g. "US") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the language or NULL if not found | ### string[] getLanguageNames(string $displayLocale = null) Returns the names of all known languages. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of language names indexed by language codes | ### string|null getScriptName(string $script, string $language = null, string $displayLocale = null) Returns the name of a script. #### Parameters | | | | | --- | --- | --- | | string | $script | A script code (e.g. "Hans") | | string | $language | Optional. A language code (e.g. "zh") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the script or NULL if not found | ### string[] getScriptNames(string $displayLocale = null) Returns the names of all known scripts. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of script names indexed by script codes | symfony RegionBundleInterface RegionBundleInterface ====================== interface **RegionBundleInterface** implements [ResourceBundleInterface](resourcebundleinterface "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") Gives access to region-related ICU data. Methods ------- | | | | | --- | --- | --- | | string[] | [getLocales](#method_getLocales)() Returns the list of locales that this bundle supports. | from [ResourceBundleInterface](resourcebundleinterface#method_getLocales "Symfony\Component\Intl\ResourceBundle\ResourceBundleInterface") | | string|null | [getCountryName](#method_getCountryName)(string $country, string $displayLocale = null) Returns the name of a country. | | | string[] | [getCountryNames](#method_getCountryNames)(string $displayLocale = null) Returns the names of all known countries. | | Details ------- ### string[] getLocales() Returns the list of locales that this bundle supports. #### Return Value | | | | --- | --- | | string[] | A list of locale codes | ### string|null getCountryName(string $country, string $displayLocale = null) Returns the name of a country. #### Parameters | | | | | --- | --- | --- | | string | $country | A country code (e.g. "US") | | string | $displayLocale | Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string|null | The name of the country or NULL if not found | ### string[] getCountryNames(string $displayLocale = null) Returns the names of all known countries. #### Parameters | | | | | --- | --- | --- | | string | $displayLocale | Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}. | #### Return Value | | | | --- | --- | | string[] | A list of country names indexed by country codes | symfony NumberFormatter NumberFormatter ================ class **NumberFormatter** Replacement for PHP's native {@link \NumberFormatter} class. The only methods currently supported in this class are: * {@link \_\_construct} * {@link create} * {@link formatCurrency} * {@link format} * {@link getAttribute} * {@link getErrorCode} * {@link getErrorMessage} * {@link getLocale} * {@link parse} * {@link setAttribute} Constants --------- | | | | --- | --- | | PATTERN\_DECIMAL | | | DECIMAL | | | CURRENCY | | | PERCENT | | | SCIENTIFIC | | | SPELLOUT | | | ORDINAL | | | DURATION | | | PATTERN\_RULEBASED | | | IGNORE | | | DEFAULT\_STYLE | | | TYPE\_DEFAULT | | | TYPE\_INT32 | | | TYPE\_INT64 | | | TYPE\_DOUBLE | | | TYPE\_CURRENCY | | | PARSE\_INT\_ONLY | | | GROUPING\_USED | | | DECIMAL\_ALWAYS\_SHOWN | | | MAX\_INTEGER\_DIGITS | | | MIN\_INTEGER\_DIGITS | | | INTEGER\_DIGITS | | | MAX\_FRACTION\_DIGITS | | | MIN\_FRACTION\_DIGITS | | | FRACTION\_DIGITS | | | MULTIPLIER | | | GROUPING\_SIZE | | | ROUNDING\_MODE | | | ROUNDING\_INCREMENT | | | FORMAT\_WIDTH | | | PADDING\_POSITION | | | SECONDARY\_GROUPING\_SIZE | | | SIGNIFICANT\_DIGITS\_USED | | | MIN\_SIGNIFICANT\_DIGITS | | | MAX\_SIGNIFICANT\_DIGITS | | | LENIENT\_PARSE | | | POSITIVE\_PREFIX | | | POSITIVE\_SUFFIX | | | NEGATIVE\_PREFIX | | | NEGATIVE\_SUFFIX | | | PADDING\_CHARACTER | | | CURRENCY\_CODE | | | DEFAULT\_RULESET | | | PUBLIC\_RULESETS | | | DECIMAL\_SEPARATOR\_SYMBOL | | | GROUPING\_SEPARATOR\_SYMBOL | | | PATTERN\_SEPARATOR\_SYMBOL | | | PERCENT\_SYMBOL | | | ZERO\_DIGIT\_SYMBOL | | | DIGIT\_SYMBOL | | | MINUS\_SIGN\_SYMBOL | | | PLUS\_SIGN\_SYMBOL | | | CURRENCY\_SYMBOL | | | INTL\_CURRENCY\_SYMBOL | | | MONETARY\_SEPARATOR\_SYMBOL | | | EXPONENTIAL\_SYMBOL | | | PERMILL\_SYMBOL | | | PAD\_ESCAPE\_SYMBOL | | | INFINITY\_SYMBOL | | | NAN\_SYMBOL | | | SIGNIFICANT\_DIGIT\_SYMBOL | | | MONETARY\_GROUPING\_SEPARATOR\_SYMBOL | | | ROUND\_CEILING | | | ROUND\_FLOOR | | | ROUND\_DOWN | | | ROUND\_UP | | | ROUND\_HALFEVEN | | | ROUND\_HALFDOWN | | | ROUND\_HALFUP | | | PAD\_BEFORE\_PREFIX | | | PAD\_AFTER\_PREFIX | | | PAD\_BEFORE\_SUFFIX | | | PAD\_AFTER\_SUFFIX | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected int | $errorCode | The error code from the last operation. | | | protected string | $errorMessage | The error message from the last operation. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $locale = 'en', int $style = null, string $pattern = null) | | | static [NumberFormatter](numberformatter "Symfony\Component\Intl\NumberFormatter\NumberFormatter") | [create](#method_create)(string $locale = 'en', int $style = null, string $pattern = null) Static constructor. | | | string | [formatCurrency](#method_formatCurrency)(float $value, string $currency) Format a currency value. | | | bool|string | [format](#method_format)(int|float $value, int $type = self::TYPE\_DEFAULT) Format a number. | | | bool|int | [getAttribute](#method_getAttribute)(int $attr) Returns an attribute value. | | | int | [getErrorCode](#method_getErrorCode)() Returns formatter's last error code. Always returns the U\_ZERO\_ERROR class constant value. | | | string | [getErrorMessage](#method_getErrorMessage)() Returns formatter's last error message. Always returns the U\_ZERO\_ERROR\_MESSAGE class constant value. | | | string | [getLocale](#method_getLocale)(int $type = Locale::ACTUAL\_LOCALE) Returns the formatter's locale. | | | bool|string | [getPattern](#method_getPattern)() Not supported. Returns the formatter's pattern. | | | bool|string | [getSymbol](#method_getSymbol)(int $attr) Not supported. Returns a formatter symbol value. | | | bool|string | [getTextAttribute](#method_getTextAttribute)(int $attr) Not supported. Returns a formatter text attribute value. | | | bool|string | [parseCurrency](#method_parseCurrency)(string $value, string $currency, int $position = null) Not supported. Parse a currency number. | | | int|float|false | [parse](#method_parse)(string $value, int $type = self::TYPE\_DOUBLE, int $position = 0) Parse a number. | | | bool | [setAttribute](#method_setAttribute)(int $attr, int $value) Set an attribute. | | | bool | [setPattern](#method_setPattern)(string $pattern) Not supported. Set the formatter's pattern. | | | bool | [setSymbol](#method_setSymbol)(int $attr, string $value) Not supported. Set the formatter's symbol. | | | bool | [setTextAttribute](#method_setTextAttribute)(int $attr, int $value) Not supported. Set a text attribute. | | | | [resetError](#method_resetError)() Set the error to the default U\_ZERO\_ERROR. | | Details ------- ### \_\_construct(string|null $locale = 'en', int $style = null, string $pattern = null) #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en") | | int | $style | Style of the formatting, one of the format style constants. The only supported styles are NumberFormatter::DECIMAL and NumberFormatter::CURRENCY. | | string | $pattern | Not supported. A pattern string in case $style is NumberFormat::PATTERN\_DECIMAL or NumberFormat::PATTERN\_RULEBASED. It must conform to the syntax described in the ICU DecimalFormat or ICU RuleBasedNumberFormat documentation | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $locale different than "en" or null is passed | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When the $style is not supported | | [MethodArgumentNotImplementedException](../exception/methodargumentnotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException") | When the pattern value is different than null | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.create.php> | | | <http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details> | | | <http://www.icu-project.org/apiref/icu4c/classRuleBasedNumberFormat.html#_details> | | ### static [NumberFormatter](numberformatter "Symfony\Component\Intl\NumberFormatter\NumberFormatter") create(string $locale = 'en', int $style = null, string $pattern = null) Static constructor. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code. The only supported locale is "en" (or null using the default locale, i.e. "en") | | int | $style | Style of the formatting, one of the format style constants. The only currently supported styles are NumberFormatter::DECIMAL and NumberFormatter::CURRENCY. | | string | $pattern | Not supported. A pattern string in case $style is NumberFormat::PATTERN\_DECIMAL or NumberFormat::PATTERN\_RULEBASED. It must conform to the syntax described in the ICU DecimalFormat or ICU RuleBasedNumberFormat documentation | #### Return Value | | | | --- | --- | | [NumberFormatter](numberformatter "Symfony\Component\Intl\NumberFormatter\NumberFormatter") | | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $locale different than "en" or null is passed | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When the $style is not supported | | [MethodArgumentNotImplementedException](../exception/methodargumentnotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException") | When the pattern value is different than null | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.create.php> | | | <http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details> | | | <http://www.icu-project.org/apiref/icu4c/classRuleBasedNumberFormat.html#_details> | | ### string formatCurrency(float $value, string $currency) Format a currency value. #### Parameters | | | | | --- | --- | --- | | float | $value | The numeric currency value | | string | $currency | The 3-letter ISO 4217 currency code indicating the currency to use | #### Return Value | | | | --- | --- | | string | The formatted currency value | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.formatcurrency.php> | | | <https://en.wikipedia.org/wiki/ISO_4217#Active_codes> | | ### bool|string format(int|float $value, int $type = self::TYPE\_DEFAULT) Format a number. #### Parameters | | | | | --- | --- | --- | | int|float | $value | The value to format | | int | $type | Type of the formatting, one of the format type constants. Only type NumberFormatter::TYPE\_DEFAULT is currently supported. | #### Return Value | | | | --- | --- | | bool|string | The formatted value or false on error | #### Exceptions | | | | --- | --- | | [NotImplementedException](../exception/notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") | If the method is called with the class $style 'CURRENCY' | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | If the $type is different than TYPE\_DEFAULT | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.format.php> | | ### bool|int getAttribute(int $attr) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | int | $attr | An attribute specifier, one of the numeric attribute constants | #### Return Value | | | | --- | --- | | bool|int | The attribute value on success or false on error | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.getattribute.php> | | ### int getErrorCode() Returns formatter's last error code. Always returns the U\_ZERO\_ERROR class constant value. #### Return Value | | | | --- | --- | | int | The error code from last formatter call | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.geterrorcode.php> | | ### string getErrorMessage() Returns formatter's last error message. Always returns the U\_ZERO\_ERROR\_MESSAGE class constant value. #### Return Value | | | | --- | --- | | string | The error message from last formatter call | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.geterrormessage.php> | | ### string getLocale(int $type = Locale::ACTUAL\_LOCALE) Returns the formatter's locale. The parameter $type is currently ignored. #### Parameters | | | | | --- | --- | --- | | int | $type | Not supported. The locale name type to return (Locale::VALID\_LOCALE or Locale::ACTUAL\_LOCALE) | #### Return Value | | | | --- | --- | | string | The locale used to create the formatter. Currently always returns "en". | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.getlocale.php> | | ### bool|string getPattern() Not supported. Returns the formatter's pattern. #### Return Value | | | | --- | --- | | bool|string | The pattern string used by the formatter or false on error | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.getpattern.php> | | ### bool|string getSymbol(int $attr) Not supported. Returns a formatter symbol value. #### Parameters | | | | | --- | --- | --- | | int | $attr | A symbol specifier, one of the format symbol constants | #### Return Value | | | | --- | --- | | bool|string | The symbol value or false on error | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.getsymbol.php> | | ### bool|string getTextAttribute(int $attr) Not supported. Returns a formatter text attribute value. #### Parameters | | | | | --- | --- | --- | | int | $attr | An attribute specifier, one of the text attribute constants | #### Return Value | | | | --- | --- | | bool|string | The attribute value or false on error | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.gettextattribute.php> | | ### bool|string parseCurrency(string $value, string $currency, int $position = null) Not supported. Parse a currency number. #### Parameters | | | | | --- | --- | --- | | string | $value | The value to parse | | string | $currency | Parameter to receive the currency name (reference) | | int | $position | Offset to begin the parsing on return this value will hold the offset at which the parsing ended | #### Return Value | | | | --- | --- | | bool|string | The parsed numeric value of false on error | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.parsecurrency.php> | | ### int|float|false parse(string $value, int $type = self::TYPE\_DOUBLE, int $position = 0) Parse a number. #### Parameters | | | | | --- | --- | --- | | string | $value | The value to parse | | int | $type | Type of the formatting, one of the format type constants. NumberFormatter::TYPE\_DOUBLE by default. | | int | $position | Offset to begin the parsing on return this value will hold the offset at which the parsing ended | #### Return Value | | | | --- | --- | | int|float|false | The parsed value of false on error | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.parse.php> | | ### bool setAttribute(int $attr, int $value) Set an attribute. #### Parameters | | | | | --- | --- | --- | | int | $attr | An attribute specifier, one of the numeric attribute constants. The only currently supported attributes are NumberFormatter::FRACTION\_DIGITS, NumberFormatter::GROUPING\_USED and NumberFormatter::ROUNDING\_MODE. | | int | $value | The attribute value | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When the $attr is not supported | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When the $value is not supported | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.setattribute.php> | | ### bool setPattern(string $pattern) Not supported. Set the formatter's pattern. #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern string in conformance with the ICU DecimalFormat documentation | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.setpattern.php> | | | <http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details> | | ### bool setSymbol(int $attr, string $value) Not supported. Set the formatter's symbol. #### Parameters | | | | | --- | --- | --- | | int | $attr | A symbol specifier, one of the format symbol constants | | string | $value | The value for the symbol | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.setsymbol.php> | | ### bool setTextAttribute(int $attr, int $value) Not supported. Set a text attribute. #### Parameters | | | | | --- | --- | --- | | int | $attr | An attribute specifier, one of the text attribute constants | | int | $value | The attribute value | #### Return Value | | | | --- | --- | | bool | true on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/numberformatter.settextattribute.php> | | ### protected resetError() Set the error to the default U\_ZERO\_ERROR.
programming_docs
symfony Collator Collator ========= class **Collator** Replacement for PHP's native {@link \Collator} class. The only methods currently supported in this class are: * {@link \_\_construct} * {@link create} * {@link asort} * {@link getErrorCode} * {@link getErrorMessage} * {@link getLocale} Constants --------- | | | | --- | --- | | FRENCH\_COLLATION | | | ALTERNATE\_HANDLING | | | CASE\_FIRST | | | CASE\_LEVEL | | | NORMALIZATION\_MODE | | | STRENGTH | | | HIRAGANA\_QUATERNARY\_MODE | | | NUMERIC\_COLLATION | | | DEFAULT\_VALUE | | | PRIMARY | | | SECONDARY | | | TERTIARY | | | DEFAULT\_STRENGTH | | | QUATERNARY | | | IDENTICAL | | | OFF | | | ON | | | SHIFTED | | | NON\_IGNORABLE | | | LOWER\_FIRST | | | UPPER\_FIRST | | | SORT\_REGULAR | | | SORT\_NUMERIC | | | SORT\_STRING | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $locale) | | | static [Collator](collator "Symfony\Component\Intl\Collator\Collator") | [create](#method_create)(string $locale) Static constructor. | | | bool | [asort](#method_asort)(array $array, int $sortFlag = self::SORT\_REGULAR) Sort array maintaining index association. | | | bool|int | [compare](#method_compare)(string $str1, string $str2) Not supported. Compare two Unicode strings. | | | bool|int | [getAttribute](#method_getAttribute)(int $attr) Not supported. Get a value of an integer collator attribute. | | | int | [getErrorCode](#method_getErrorCode)() Returns collator's last error code. Always returns the U\_ZERO\_ERROR class constant value. | | | string | [getErrorMessage](#method_getErrorMessage)() Returns collator's last error message. Always returns the U\_ZERO\_ERROR\_MESSAGE class constant value. | | | string | [getLocale](#method_getLocale)(int $type = Locale::ACTUAL\_LOCALE) Returns the collator's locale. | | | string | [getSortKey](#method_getSortKey)(string $string) Not supported. Get sorting key for a string. | | | bool|int | [getStrength](#method_getStrength)() Not supported. Get current collator's strength. | | | bool | [setAttribute](#method_setAttribute)(int $attr, int $val) Not supported. Set a collator's attribute. | | | bool | [setStrength](#method_setStrength)(int $strength) Not supported. Set the collator's strength. | | | bool | [sortWithSortKeys](#method_sortWithSortKeys)(array $arr) Not supported. Sort array using specified collator and sort keys. | | | bool | [sort](#method_sort)(array $arr, int $sortFlag = self::SORT\_REGULAR) Not supported. Sort array using specified collator. | | Details ------- ### \_\_construct(string|null $locale) #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en") | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $locale different than "en" or null is passed | ### static [Collator](collator "Symfony\Component\Intl\Collator\Collator") create(string $locale) Static constructor. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en") | #### Return Value | | | | --- | --- | | [Collator](collator "Symfony\Component\Intl\Collator\Collator") | | #### Exceptions | | | | --- | --- | | [MethodArgumentValueNotImplementedException](../exception/methodargumentvaluenotimplementedexception "Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException") | When $locale different than "en" or null is passed | ### bool asort(array $array, int $sortFlag = self::SORT\_REGULAR) Sort array maintaining index association. #### Parameters | | | | | --- | --- | --- | | array | $array | &$array Input array | | int | $sortFlag | Flags for sorting, can be one of the following: Collator::SORT\_REGULAR - compare items normally (don't change types) Collator::SORT\_NUMERIC - compare items numerically Collator::SORT\_STRING - compare items as strings | #### Return Value | | | | --- | --- | | bool | True on success or false on failure | ### bool|int compare(string $str1, string $str2) Not supported. Compare two Unicode strings. #### Parameters | | | | | --- | --- | --- | | string | $str1 | The first string to compare | | string | $str2 | The second string to compare | #### Return Value | | | | --- | --- | | bool|int | Return the comparison result or false on failure: 1 if $str1 is greater than $str2 0 if $str1 is equal than $str2 -1 if $str1 is less than $str2 | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.compare.php> | | ### bool|int getAttribute(int $attr) Not supported. Get a value of an integer collator attribute. #### Parameters | | | | | --- | --- | --- | | int | $attr | An attribute specifier, one of the attribute constants | #### Return Value | | | | --- | --- | | bool|int | The attribute value on success or false on error | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.getattribute.php> | | ### int getErrorCode() Returns collator's last error code. Always returns the U\_ZERO\_ERROR class constant value. #### Return Value | | | | --- | --- | | int | The error code from last collator call | ### string getErrorMessage() Returns collator's last error message. Always returns the U\_ZERO\_ERROR\_MESSAGE class constant value. #### Return Value | | | | --- | --- | | string | The error message from last collator call | ### string getLocale(int $type = Locale::ACTUAL\_LOCALE) Returns the collator's locale. #### Parameters | | | | | --- | --- | --- | | int | $type | Not supported. The locale name type to return (Locale::VALID\_LOCALE or Locale::ACTUAL\_LOCALE) | #### Return Value | | | | --- | --- | | string | The locale used to create the collator. Currently always returns "en". | ### string getSortKey(string $string) Not supported. Get sorting key for a string. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to produce the key from | #### Return Value | | | | --- | --- | | string | The collation key for $string | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.getsortkey.php> | | ### bool|int getStrength() Not supported. Get current collator's strength. #### Return Value | | | | --- | --- | | bool|int | The current collator's strength or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.getstrength.php> | | ### bool setAttribute(int $attr, int $val) Not supported. Set a collator's attribute. #### Parameters | | | | | --- | --- | --- | | int | $attr | An attribute specifier, one of the attribute constants | | int | $val | The attribute value, one of the attribute value constants | #### Return Value | | | | --- | --- | | bool | True on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.setattribute.php> | | ### bool setStrength(int $strength) Not supported. Set the collator's strength. #### Parameters | | | | | --- | --- | --- | | int | $strength | Strength to set, possible values: Collator::PRIMARY Collator::SECONDARY Collator::TERTIARY Collator::QUATERNARY Collator::IDENTICAL Collator::DEFAULT | #### Return Value | | | | --- | --- | | bool | True on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.setstrength.php> | | ### bool sortWithSortKeys(array $arr) Not supported. Sort array using specified collator and sort keys. #### Parameters | | | | | --- | --- | --- | | array | $arr | &$arr Array of strings to sort | #### Return Value | | | | --- | --- | | bool | True on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.sortwithsortkeys.php> | | ### bool sort(array $arr, int $sortFlag = self::SORT\_REGULAR) Not supported. Sort array using specified collator. #### Parameters | | | | | --- | --- | --- | | array | $arr | &$arr Array of string to sort | | int | $sortFlag | Optional sorting type, one of the following: Collator::SORT\_REGULAR Collator::SORT\_NUMERIC Collator::SORT\_STRING | #### Return Value | | | | --- | --- | | bool | True on success or false on failure | #### Exceptions | | | | --- | --- | | [MethodNotImplementedException](../exception/methodnotimplementedexception "Symfony\Component\Intl\Exception\MethodNotImplementedException") | | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/collator.sort.php> | | symfony Symfony\Component\Intl\Data\Util Symfony\Component\Intl\Data\Util ================================ Classes ------- | | | | --- | --- | | [ArrayAccessibleResourceBundle](util/arrayaccessibleresourcebundle "Symfony\Component\Intl\Data\Util\ArrayAccessibleResourceBundle") | Work-around for a bug in PHP's \ResourceBundle implementation. | | [LocaleScanner](util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") | Scans a directory with data files for locales. | | [RecursiveArrayAccess](util/recursivearrayaccess "Symfony\Component\Intl\Data\Util\RecursiveArrayAccess") | | | [RingBuffer](util/ringbuffer "Symfony\Component\Intl\Data\Util\RingBuffer") | Implements a ring buffer. | symfony Symfony\Component\Intl\Data\Provider Symfony\Component\Intl\Data\Provider ==================================== Classes ------- | | | | --- | --- | | [CurrencyDataProvider](provider/currencydataprovider "Symfony\Component\Intl\Data\Provider\CurrencyDataProvider") | Data provider for currency-related data. | | [LanguageDataProvider](provider/languagedataprovider "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | Data provider for language-related ICU data. | | [LocaleDataProvider](provider/localedataprovider "Symfony\Component\Intl\Data\Provider\LocaleDataProvider") | Data provider for locale-related ICU data. | | [RegionDataProvider](provider/regiondataprovider "Symfony\Component\Intl\Data\Provider\RegionDataProvider") | Data provider for region-related ICU data. | | [ScriptDataProvider](provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") | Data provider for script-related ICU data. | symfony Symfony\Component\Intl\Data\Bundle Symfony\Component\Intl\Data\Bundle ================================== Namespaces ---------- [Symfony\Component\Intl\Data\Bundle\Compiler](bundle/compiler)[Symfony\Component\Intl\Data\Bundle\Reader](bundle/reader)[Symfony\Component\Intl\Data\Bundle\Writer](bundle/writer) symfony Symfony\Component\Intl\Data\Generator Symfony\Component\Intl\Data\Generator ===================================== Classes ------- | | | | --- | --- | | [AbstractDataGenerator](generator/abstractdatagenerator "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | The rule for compiling the currency bundle. | | [CurrencyDataGenerator](generator/currencydatagenerator "Symfony\Component\Intl\Data\Generator\CurrencyDataGenerator") | The rule for compiling the currency bundle. | | [GeneratorConfig](generator/generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | Stores contextual information for resource bundle generation. | | [LanguageDataGenerator](generator/languagedatagenerator "Symfony\Component\Intl\Data\Generator\LanguageDataGenerator") | The rule for compiling the language bundle. | | [LocaleDataGenerator](generator/localedatagenerator "Symfony\Component\Intl\Data\Generator\LocaleDataGenerator") | The rule for compiling the locale bundle. | | [RegionDataGenerator](generator/regiondatagenerator "Symfony\Component\Intl\Data\Generator\RegionDataGenerator") | The rule for compiling the region bundle. | | [ScriptDataGenerator](generator/scriptdatagenerator "Symfony\Component\Intl\Data\Generator\ScriptDataGenerator") | The rule for compiling the script bundle. | symfony RecursiveArrayAccess RecursiveArrayAccess ===================== class **RecursiveArrayAccess** Methods ------- | | | | | --- | --- | --- | | static | [get](#method_get)($array, array $indices) | | Details ------- ### static get($array, array $indices) #### Parameters | | | | | --- | --- | --- | | | $array | | | array | $indices | | symfony LocaleScanner LocaleScanner ============== class **LocaleScanner** Scans a directory with data files for locales. The name of each file with the extension ".txt" is considered, if it "looks" like a locale: * the name must start with two letters; * the two letters may optionally be followed by an underscore and any sequence of other symbols. For example, "de" and "de\_DE" are considered to be locales. "root" and "meta" are not. Methods ------- | | | | | --- | --- | --- | | array | [scanLocales](#method_scanLocales)(string $sourceDir) Returns all locales found in the given directory. | | | array | [scanAliases](#method_scanAliases)(string $sourceDir) Returns all locale aliases found in the given directory. | | Details ------- ### array scanLocales(string $sourceDir) Returns all locales found in the given directory. #### Parameters | | | | | --- | --- | --- | | string | $sourceDir | The directory with ICU files | #### Return Value | | | | --- | --- | | array | An array of locales. The result also contains locales that are in fact just aliases for other locales. Use {@link scanAliases()} to determine which of the locales are aliases | ### array scanAliases(string $sourceDir) Returns all locale aliases found in the given directory. #### Parameters | | | | | --- | --- | --- | | string | $sourceDir | The directory with ICU files | #### Return Value | | | | --- | --- | | array | An array with the locale aliases as keys and the aliased locales as values | symfony ArrayAccessibleResourceBundle ArrayAccessibleResourceBundle ============================== class **ArrayAccessibleResourceBundle** implements [ArrayAccess](http://php.net/ArrayAccess), [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) Work-around for a bug in PHP's \ResourceBundle implementation. More information can be found on https://bugs.php.net/bug.php?id=64356. This class can be removed once that bug is fixed. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ResourceBundle](http://php.net/ResourceBundle) $bundleImpl) | | | | [get](#method_get)($offset) | | | | [offsetExists](#method_offsetExists)($offset) | | | | [offsetGet](#method_offsetGet)($offset) | | | | [offsetSet](#method_offsetSet)($offset, $value) | | | | [offsetUnset](#method_offsetUnset)($offset) | | | | [getIterator](#method_getIterator)() | | | | [count](#method_count)() | | | | [getErrorCode](#method_getErrorCode)() | | | | [getErrorMessage](#method_getErrorMessage)() | | Details ------- ### \_\_construct([ResourceBundle](http://php.net/ResourceBundle) $bundleImpl) #### Parameters | | | | | --- | --- | --- | | [ResourceBundle](http://php.net/ResourceBundle) | $bundleImpl | | ### get($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | ### offsetExists($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | ### offsetGet($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | ### offsetSet($offset, $value) #### Parameters | | | | | --- | --- | --- | | | $offset | | | | $value | | ### offsetUnset($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | ### getIterator() ### count() ### getErrorCode() ### getErrorMessage() symfony RingBuffer RingBuffer =========== class **RingBuffer** implements [ArrayAccess](http://php.net/ArrayAccess) Implements a ring buffer. A ring buffer is an array-like structure with a fixed size. If the buffer is full, the next written element overwrites the first bucket in the buffer, then the second and so on. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int $size) | | | | [offsetExists](#method_offsetExists)($key) {@inheritdoc} | | | | [offsetGet](#method_offsetGet)($key) {@inheritdoc} | | | | [offsetSet](#method_offsetSet)($key, $value) {@inheritdoc} | | | | [offsetUnset](#method_offsetUnset)($key) {@inheritdoc} | | Details ------- ### \_\_construct(int $size) #### Parameters | | | | | --- | --- | --- | | int | $size | | ### offsetExists($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### offsetGet($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | ### offsetSet($key, $value) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### offsetUnset($key) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $key | | symfony CurrencyDataProvider CurrencyDataProvider ===================== class **CurrencyDataProvider** Data provider for currency-related data. Constants --------- | | | | --- | --- | | INDEX\_SYMBOL | | | INDEX\_NAME | | | INDEX\_FRACTION\_DIGITS | | | INDEX\_ROUNDING\_INCREMENT | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads currency-related data from a resource bundle. | | | | [getCurrencies](#method_getCurrencies)() | | | | [getSymbol](#method_getSymbol)($currency, $displayLocale = null) | | | | [getName](#method_getName)($currency, $displayLocale = null) | | | | [getNames](#method_getNames)($displayLocale = null) | | | | [getFractionDigits](#method_getFractionDigits)($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getFractionDigits()}. | | | | [getRoundingIncrement](#method_getRoundingIncrement)($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getRoundingIncrement()}. | | | | [getNumericCode](#method_getNumericCode)($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getNumericCode()}. | | | | [forNumericCode](#method_forNumericCode)($numericCode) Data provider for {@link \Symfony\Component\Intl\Currency::forNumericCode()}. | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads currency-related data from a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the resource bundle | ### getCurrencies() ### getSymbol($currency, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $currency | | | | $displayLocale | | ### getName($currency, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $currency | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | ### getFractionDigits($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getFractionDigits()}. #### Parameters | | | | | --- | --- | --- | | | $currency | | ### getRoundingIncrement($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getRoundingIncrement()}. #### Parameters | | | | | --- | --- | --- | | | $currency | | ### getNumericCode($currency) Data provider for {@link \Symfony\Component\Intl\Currency::getNumericCode()}. #### Parameters | | | | | --- | --- | --- | | | $currency | | ### forNumericCode($numericCode) Data provider for {@link \Symfony\Component\Intl\Currency::forNumericCode()}. #### Parameters | | | | | --- | --- | --- | | | $numericCode | |
programming_docs
symfony LanguageDataProvider LanguageDataProvider ===================== class **LanguageDataProvider** Data provider for language-related ICU data. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. | | | | [getLanguages](#method_getLanguages)() | | | | [getAliases](#method_getAliases)() | | | | [getName](#method_getName)($language, $displayLocale = null) | | | | [getNames](#method_getNames)($displayLocale = null) | | | | [getAlpha3Code](#method_getAlpha3Code)($language) | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | ### getLanguages() ### getAliases() ### getName($language, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $language | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | ### getAlpha3Code($language) #### Parameters | | | | | --- | --- | --- | | | $language | | symfony LocaleDataProvider LocaleDataProvider =================== class **LocaleDataProvider** Data provider for locale-related ICU data. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. | | | | [getLocales](#method_getLocales)() | | | | [getAliases](#method_getAliases)() | | | | [getName](#method_getName)($locale, $displayLocale = null) | | | | [getNames](#method_getNames)($displayLocale = null) | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | ### getLocales() ### getAliases() ### getName($locale, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $locale | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | symfony RegionDataProvider RegionDataProvider =================== class **RegionDataProvider** Data provider for region-related ICU data. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. | | | | [getRegions](#method_getRegions)() | | | | [getName](#method_getName)($region, $displayLocale = null) | | | | [getNames](#method_getNames)($displayLocale = null) | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | ### getRegions() ### getName($region, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $region | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | symfony ScriptDataProvider ScriptDataProvider =================== class **ScriptDataProvider** Data provider for script-related ICU data. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. | | | | [getScripts](#method_getScripts)() | | | | [getName](#method_getName)($script, $displayLocale = null) | | | | [getNames](#method_getNames)($displayLocale = null) | | Details ------- ### \_\_construct(string $path, [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") $reader) Creates a data provider that reads locale-related data from .res files. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the directory containing the .res files | | [BundleEntryReaderInterface](../bundle/reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") | $reader | The reader for reading the .res files | ### getScripts() ### getName($script, $displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $script | | | | $displayLocale | | ### getNames($displayLocale = null) #### Parameters | | | | | --- | --- | --- | | | $displayLocale | | symfony Symfony\Component\Intl\Data\Bundle\Writer Symfony\Component\Intl\Data\Bundle\Writer ========================================= Classes ------- | | | | --- | --- | | [JsonBundleWriter](writer/jsonbundlewriter "Symfony\Component\Intl\Data\Bundle\Writer\JsonBundleWriter") | Writes .json resource bundles. | | [PhpBundleWriter](writer/phpbundlewriter "Symfony\Component\Intl\Data\Bundle\Writer\PhpBundleWriter") | Writes .php resource bundles. | | [TextBundleWriter](writer/textbundlewriter "Symfony\Component\Intl\Data\Bundle\Writer\TextBundleWriter") | Writes .txt resource bundles. | Interfaces ---------- | | | | --- | --- | | *[BundleWriterInterface](writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface")* | Writes resource bundle files. | symfony Symfony\Component\Intl\Data\Bundle\Reader Symfony\Component\Intl\Data\Bundle\Reader ========================================= Classes ------- | | | | --- | --- | | [BufferedBundleReader](reader/bufferedbundlereader "Symfony\Component\Intl\Data\Bundle\Reader\BufferedBundleReader") | | | [BundleEntryReader](reader/bundleentryreader "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReader") | Default implementation of {@link BundleEntryReaderInterface}. | | [IntlBundleReader](reader/intlbundlereader "Symfony\Component\Intl\Data\Bundle\Reader\IntlBundleReader") | Reads binary .res resource bundles. | | [JsonBundleReader](reader/jsonbundlereader "Symfony\Component\Intl\Data\Bundle\Reader\JsonBundleReader") | Reads .json resource bundles. | | [PhpBundleReader](reader/phpbundlereader "Symfony\Component\Intl\Data\Bundle\Reader\PhpBundleReader") | Reads .php resource bundles. | Interfaces ---------- | | | | --- | --- | | *[BundleEntryReaderInterface](reader/bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface")* | Reads individual entries of a resource file. | | *[BundleReaderInterface](reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface")* | Reads resource bundle files. | symfony Symfony\Component\Intl\Data\Bundle\Compiler Symfony\Component\Intl\Data\Bundle\Compiler =========================================== Classes ------- | | | | --- | --- | | [GenrbCompiler](compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | Compiles .txt resource bundles to binary .res files. | Interfaces ---------- | | | | --- | --- | | *[BundleCompilerInterface](compiler/bundlecompilerinterface "Symfony\Component\Intl\Data\Bundle\Compiler\BundleCompilerInterface")* | Compiles a resource bundle. | symfony BundleEntryReader BundleEntryReader ================== class **BundleEntryReader** implements [BundleEntryReaderInterface](bundleentryreaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface") Default implementation of {@link BundleEntryReaderInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader) Creates an entry reader based on the given resource bundle reader. | | | | [setLocaleAliases](#method_setLocaleAliases)(array $localeAliases) Stores a mapping of locale aliases to locales. | | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | | | mixed | [readEntry](#method_readEntry)(string $path, string $locale, array $indices, bool $fallback = true) Reads an entry from a resource bundle. | | Details ------- ### \_\_construct([BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader) Creates an entry reader based on the given resource bundle reader. #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | ### setLocaleAliases(array $localeAliases) Stores a mapping of locale aliases to locales. This mapping is used when reading entries and merging them with their fallback locales. If an entry is read for a locale alias (e.g. "mo") that points to a locale with a fallback locale ("ro\_MD"), the reader can continue at the correct fallback locale ("ro"). #### Parameters | | | | | --- | --- | --- | | array | $localeAliases | A mapping of locale aliases to locales | ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | ### mixed readEntry(string $path, string $locale, array $indices, bool $fallback = true) Reads an entry from a resource bundle. An entry can be selected from the resource bundle by passing the path to that entry in the bundle. For example, if the bundle is structured like this: ``` TopLevel NestedLevel Entry: Value ``` Then the value can be read by calling: ``` $reader->readEntry('...', 'en', array('TopLevel', 'NestedLevel', 'Entry')); ``` #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | | array | $indices | The indices to read from the bundle | | bool | $fallback | Whether to merge the value with the value from the fallback locale (e.g. "en" for "en\_GB"). Only applicable if the result is multivalued (i.e. array or \ArrayAccess) or cannot be found in the requested locale. | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data and a scalar value for simple data | #### Exceptions | | | | --- | --- | | [MissingResourceException](../../../exception/missingresourceexception "Symfony\Component\Intl\Exception\MissingResourceException") | If the indices cannot be accessed | symfony BundleEntryReaderInterface BundleEntryReaderInterface =========================== interface **BundleEntryReaderInterface** implements [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") Reads individual entries of a resource file. Methods ------- | | | | | --- | --- | --- | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | from [BundleReaderInterface](bundlereaderinterface#method_read "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | | mixed | [readEntry](#method_readEntry)(string $path, string $locale, array $indices, bool $fallback = true) Reads an entry from a resource bundle. | | Details ------- ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | ### mixed readEntry(string $path, string $locale, array $indices, bool $fallback = true) Reads an entry from a resource bundle. An entry can be selected from the resource bundle by passing the path to that entry in the bundle. For example, if the bundle is structured like this: ``` TopLevel NestedLevel Entry: Value ``` Then the value can be read by calling: ``` $reader->readEntry('...', 'en', array('TopLevel', 'NestedLevel', 'Entry')); ``` #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | | array | $indices | The indices to read from the bundle | | bool | $fallback | Whether to merge the value with the value from the fallback locale (e.g. "en" for "en\_GB"). Only applicable if the result is multivalued (i.e. array or \ArrayAccess) or cannot be found in the requested locale. | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data and a scalar value for simple data | #### Exceptions | | | | --- | --- | | [MissingResourceException](../../../exception/missingresourceexception "Symfony\Component\Intl\Exception\MissingResourceException") | If the indices cannot be accessed | symfony PhpBundleReader PhpBundleReader ================ class **PhpBundleReader** implements [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") Reads .php resource bundles. Methods ------- | | | | | --- | --- | --- | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | | Details ------- ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | symfony BufferedBundleReader BufferedBundleReader ===================== class **BufferedBundleReader** implements [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, int $bufferSize) Buffers a given reader. | | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | | Details ------- ### \_\_construct([BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, int $bufferSize) Buffers a given reader. #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | The reader to buffer | | int | $bufferSize | The number of entries to store in the buffer | ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | symfony BundleReaderInterface BundleReaderInterface ====================== interface **BundleReaderInterface** Reads resource bundle files. Methods ------- | | | | | --- | --- | --- | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | | Details ------- ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | symfony JsonBundleReader JsonBundleReader ================= class **JsonBundleReader** implements [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") Reads .json resource bundles. Methods ------- | | | | | --- | --- | --- | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | | Details ------- ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | symfony IntlBundleReader IntlBundleReader ================= class **IntlBundleReader** implements [BundleReaderInterface](bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") Reads binary .res resource bundles. Methods ------- | | | | | --- | --- | --- | | mixed | [read](#method_read)(string $path, string $locale) Reads a resource bundle. | | Details ------- ### mixed read(string $path, string $locale) Reads a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to read | #### Return Value | | | | --- | --- | | mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise | symfony BundleWriterInterface BundleWriterInterface ====================== interface **BundleWriterInterface** Writes resource bundle files. Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)(string $path, string $locale, mixed $data) Writes data to a resource bundle. | | Details ------- ### write(string $path, string $locale, mixed $data) Writes data to a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to (over-)write | | mixed | $data | The data to write |
programming_docs
symfony PhpBundleWriter PhpBundleWriter ================ class **PhpBundleWriter** implements [BundleWriterInterface](bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface") Writes .php resource bundles. Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)(string $path, string $locale, mixed $data) Writes data to a resource bundle. | | Details ------- ### write(string $path, string $locale, mixed $data) Writes data to a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to (over-)write | | mixed | $data | The data to write | symfony JsonBundleWriter JsonBundleWriter ================= class **JsonBundleWriter** implements [BundleWriterInterface](bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface") Writes .json resource bundles. Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)(string $path, string $locale, mixed $data) Writes data to a resource bundle. | | Details ------- ### write(string $path, string $locale, mixed $data) Writes data to a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to (over-)write | | mixed | $data | The data to write | symfony TextBundleWriter TextBundleWriter ================= class **TextBundleWriter** implements [BundleWriterInterface](bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface") Writes .txt resource bundles. The resulting files can be converted to binary .res files using a {@link \Symfony\Component\Intl\ResourceBundle\Compiler\BundleCompilerInterface} implementation. Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)(string $path, string $locale, mixed $data, $fallback = true) Writes data to a resource bundle. | | Details ------- ### write(string $path, string $locale, mixed $data, $fallback = true) Writes data to a resource bundle. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the resource bundle | | string | $locale | The locale to (over-)write | | mixed | $data | The data to write | | | $fallback | | symfony GenrbCompiler GenrbCompiler ============== class **GenrbCompiler** implements [BundleCompilerInterface](bundlecompilerinterface "Symfony\Component\Intl\Data\Bundle\Compiler\BundleCompilerInterface") Compiles .txt resource bundles to binary .res files. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $genrb = 'genrb', string $envVars = '') Creates a new compiler based on the "genrb" executable. | | | | [compile](#method_compile)(string $sourcePath, string $targetDir) Compiles a resource bundle at the given source to the given target directory. | | Details ------- ### \_\_construct(string $genrb = 'genrb', string $envVars = '') Creates a new compiler based on the "genrb" executable. #### Parameters | | | | | --- | --- | --- | | string | $genrb | Optional. The path to the "genrb" executable | | string | $envVars | Optional. Environment variables to be loaded when running "genrb". | #### Exceptions | | | | --- | --- | | [RuntimeException](../../../exception/runtimeexception "Symfony\Component\Intl\Exception\RuntimeException") | if the "genrb" cannot be found | ### compile(string $sourcePath, string $targetDir) Compiles a resource bundle at the given source to the given target directory. #### Parameters | | | | | --- | --- | --- | | string | $sourcePath | | | string | $targetDir | | symfony BundleCompilerInterface BundleCompilerInterface ======================== interface **BundleCompilerInterface** Compiles a resource bundle. Methods ------- | | | | | --- | --- | --- | | | [compile](#method_compile)(string $sourcePath, string $targetDir) Compiles a resource bundle at the given source to the given target directory. | | Details ------- ### compile(string $sourcePath, string $targetDir) Compiles a resource bundle at the given source to the given target directory. #### Parameters | | | | | --- | --- | --- | | string | $sourcePath | | | string | $targetDir | | symfony CurrencyDataGenerator CurrencyDataGenerator ====================== class **CurrencyDataGenerator** extends [AbstractDataGenerator](abstractdatagenerator "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") The rule for compiling the currency bundle. Constants --------- | | | | --- | --- | | UNKNOWN\_CURRENCY\_ID | | | EUROPEAN\_COMPOSITE\_UNIT\_ID | | | EUROPEAN\_MONETARY\_UNIT\_ID | | | EUROPEAN\_UNIT\_OF\_ACCOUNT\_XBC\_ID | | | EUROPEAN\_UNIT\_OF\_ACCOUNT\_XBD\_ID | | | TESTING\_CURRENCY\_CODE\_ID | | | ADB\_UNIT\_OF\_ACCOUNT\_ID | | | GOLD\_ID | | | SILVER\_ID | | | PLATINUM\_ID | | | PALLADIUM\_ID | | | SUCRE\_ID | | | SPECIAL\_DRAWING\_RIGHTS\_ID | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) | from [AbstractDataGenerator](abstractdatagenerator#method___construct "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | | [generateData](#method_generateData)([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) | from [AbstractDataGenerator](abstractdatagenerator#method_generateData "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | string[] | [scanLocales](#method_scanLocales)([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) | | | | [compileTemporaryBundles](#method_compileTemporaryBundles)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) | | | | [preGenerate](#method_preGenerate)() | | | array|null | [generateDataForLocale](#method_generateDataForLocale)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) | | | array|null | [generateDataForRoot](#method_generateDataForRoot)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | | array|null | [generateDataForMeta](#method_generateDataForMeta)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | Details ------- ### \_\_construct([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $dirName | | ### generateData([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) #### Parameters | | | | | --- | --- | --- | | [GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | $config | | ### protected string[] scanLocales([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) #### Parameters | | | | | --- | --- | --- | | [LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") | $scanner | | | string | $sourceDir | | #### Return Value | | | | --- | --- | | string[] | | ### protected compileTemporaryBundles([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $sourceDir | | | string | $tempDir | | ### protected preGenerate() ### protected array|null generateDataForLocale([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | | string | $displayLocale | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForRoot([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForMeta([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | symfony LanguageDataGenerator LanguageDataGenerator ====================== class **LanguageDataGenerator** extends [AbstractDataGenerator](abstractdatagenerator "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") The rule for compiling the language bundle. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) | from [AbstractDataGenerator](abstractdatagenerator#method___construct "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | | [generateData](#method_generateData)([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) | from [AbstractDataGenerator](abstractdatagenerator#method_generateData "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | string[] | [scanLocales](#method_scanLocales)([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) | | | | [compileTemporaryBundles](#method_compileTemporaryBundles)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) | | | | [preGenerate](#method_preGenerate)() | | | array|null | [generateDataForLocale](#method_generateDataForLocale)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) | | | array|null | [generateDataForRoot](#method_generateDataForRoot)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | | array|null | [generateDataForMeta](#method_generateDataForMeta)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | Details ------- ### \_\_construct([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $dirName | | ### generateData([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) #### Parameters | | | | | --- | --- | --- | | [GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | $config | | ### protected string[] scanLocales([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) #### Parameters | | | | | --- | --- | --- | | [LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") | $scanner | | | string | $sourceDir | | #### Return Value | | | | --- | --- | | string[] | | ### protected compileTemporaryBundles([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $sourceDir | | | string | $tempDir | | ### protected preGenerate() ### protected array|null generateDataForLocale([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | | string | $displayLocale | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForRoot([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForMeta([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | symfony RegionDataGenerator RegionDataGenerator ==================== class **RegionDataGenerator** extends [AbstractDataGenerator](abstractdatagenerator "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") The rule for compiling the region bundle. Constants --------- | | | | --- | --- | | UNKNOWN\_REGION\_ID | | | OUTLYING\_OCEANIA\_REGION\_ID | | | EUROPEAN\_UNION\_ID | | | NETHERLANDS\_ANTILLES\_ID | | | BOUVET\_ISLAND\_ID | | | HEARD\_MCDONALD\_ISLANDS\_ID | | | CLIPPERTON\_ISLAND\_ID | | | EUROZONE\_ID | | | UNITED\_NATIONS\_ID | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) | from [AbstractDataGenerator](abstractdatagenerator#method___construct "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | | [generateData](#method_generateData)([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) | from [AbstractDataGenerator](abstractdatagenerator#method_generateData "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | string[] | [scanLocales](#method_scanLocales)([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) | | | | [compileTemporaryBundles](#method_compileTemporaryBundles)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) | | | | [preGenerate](#method_preGenerate)() | | | array|null | [generateDataForLocale](#method_generateDataForLocale)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) | | | array|null | [generateDataForRoot](#method_generateDataForRoot)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | | array|null | [generateDataForMeta](#method_generateDataForMeta)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | | array | [generateRegionNames](#method_generateRegionNames)([ArrayAccessibleResourceBundle](../util/arrayaccessibleresourcebundle "Symfony\Component\Intl\Data\Util\ArrayAccessibleResourceBundle") $localeBundle) | | Details ------- ### \_\_construct([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $dirName | | ### generateData([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) #### Parameters | | | | | --- | --- | --- | | [GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | $config | | ### protected string[] scanLocales([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) #### Parameters | | | | | --- | --- | --- | | [LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") | $scanner | | | string | $sourceDir | | #### Return Value | | | | --- | --- | | string[] | | ### protected compileTemporaryBundles([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $sourceDir | | | string | $tempDir | | ### protected preGenerate() ### protected array|null generateDataForLocale([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | | string | $displayLocale | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForRoot([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForMeta([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | ### protected array generateRegionNames([ArrayAccessibleResourceBundle](../util/arrayaccessibleresourcebundle "Symfony\Component\Intl\Data\Util\ArrayAccessibleResourceBundle") $localeBundle) #### Parameters | | | | | --- | --- | --- | | [ArrayAccessibleResourceBundle](../util/arrayaccessibleresourcebundle "Symfony\Component\Intl\Data\Util\ArrayAccessibleResourceBundle") | $localeBundle | | #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony LocaleDataGenerator LocaleDataGenerator ==================== class **LocaleDataGenerator** The rule for compiling the locale bundle. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $dirName, [LanguageDataProvider](../provider/languagedataprovider "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") $languageDataProvider, [ScriptDataProvider](../provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") $scriptDataProvider, [RegionDataProvider](../provider/regiondataprovider "Symfony\Component\Intl\Data\Provider\RegionDataProvider") $regionDataProvider) | | | | [generateData](#method_generateData)([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) | | Details ------- ### \_\_construct(string $dirName, [LanguageDataProvider](../provider/languagedataprovider "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") $languageDataProvider, [ScriptDataProvider](../provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") $scriptDataProvider, [RegionDataProvider](../provider/regiondataprovider "Symfony\Component\Intl\Data\Provider\RegionDataProvider") $regionDataProvider) #### Parameters | | | | | --- | --- | --- | | string | $dirName | | | [LanguageDataProvider](../provider/languagedataprovider "Symfony\Component\Intl\Data\Provider\LanguageDataProvider") | $languageDataProvider | | | [ScriptDataProvider](../provider/scriptdataprovider "Symfony\Component\Intl\Data\Provider\ScriptDataProvider") | $scriptDataProvider | | | [RegionDataProvider](../provider/regiondataprovider "Symfony\Component\Intl\Data\Provider\RegionDataProvider") | $regionDataProvider | | ### generateData([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) #### Parameters | | | | | --- | --- | --- | | [GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | $config | | symfony ScriptDataGenerator ScriptDataGenerator ==================== class **ScriptDataGenerator** extends [AbstractDataGenerator](abstractdatagenerator "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") The rule for compiling the script bundle. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) | from [AbstractDataGenerator](abstractdatagenerator#method___construct "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | | [generateData](#method_generateData)([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) | from [AbstractDataGenerator](abstractdatagenerator#method_generateData "Symfony\Component\Intl\Data\Generator\AbstractDataGenerator") | | string[] | [scanLocales](#method_scanLocales)([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) | | | | [compileTemporaryBundles](#method_compileTemporaryBundles)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) | | | | [preGenerate](#method_preGenerate)() | | | array|null | [generateDataForLocale](#method_generateDataForLocale)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) | | | array|null | [generateDataForRoot](#method_generateDataForRoot)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | | array|null | [generateDataForMeta](#method_generateDataForMeta)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | Details ------- ### \_\_construct([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $dirName | | ### generateData([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) #### Parameters | | | | | --- | --- | --- | | [GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | $config | | ### protected string[] scanLocales([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) #### Parameters | | | | | --- | --- | --- | | [LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") | $scanner | | | string | $sourceDir | | #### Return Value | | | | --- | --- | | string[] | | ### protected compileTemporaryBundles([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $sourceDir | | | string | $tempDir | | ### protected preGenerate() ### protected array|null generateDataForLocale([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | | string | $displayLocale | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForRoot([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | ### protected array|null generateDataForMeta([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | symfony AbstractDataGenerator AbstractDataGenerator ====================== abstract class **AbstractDataGenerator** The rule for compiling the currency bundle. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) | | | | [generateData](#method_generateData)([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) | | | string[] | [scanLocales](#method_scanLocales)([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) | | | | [compileTemporaryBundles](#method_compileTemporaryBundles)([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) | | | | [preGenerate](#method_preGenerate)() | | | array|null | [generateDataForLocale](#method_generateDataForLocale)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) | | | array|null | [generateDataForRoot](#method_generateDataForRoot)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | | array|null | [generateDataForMeta](#method_generateDataForMeta)([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) | | Details ------- ### \_\_construct([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $dirName) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $dirName | | ### generateData([GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") $config) #### Parameters | | | | | --- | --- | --- | | [GeneratorConfig](generatorconfig "Symfony\Component\Intl\Data\Generator\GeneratorConfig") | $config | | ### abstract protected string[] scanLocales([LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") $scanner, string $sourceDir) #### Parameters | | | | | --- | --- | --- | | [LocaleScanner](../util/localescanner "Symfony\Component\Intl\Data\Util\LocaleScanner") | $scanner | | | string | $sourceDir | | #### Return Value | | | | --- | --- | | string[] | | ### abstract protected compileTemporaryBundles([GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") $compiler, string $sourceDir, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [GenrbCompiler](../bundle/compiler/genrbcompiler "Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler") | $compiler | | | string | $sourceDir | | | string | $tempDir | | ### abstract protected preGenerate() ### abstract protected array|null generateDataForLocale([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir, string $displayLocale) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | | string | $displayLocale | | #### Return Value | | | | --- | --- | | array|null | | ### abstract protected array|null generateDataForRoot([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | ### abstract protected array|null generateDataForMeta([BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") $reader, string $tempDir) #### Parameters | | | | | --- | --- | --- | | [BundleReaderInterface](../bundle/reader/bundlereaderinterface "Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface") | $reader | | | string | $tempDir | | #### Return Value | | | | --- | --- | | array|null | | symfony GeneratorConfig GeneratorConfig ================ class **GeneratorConfig** Stores contextual information for resource bundle generation. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $sourceDir, string $icuVersion) | | | | [addBundleWriter](#method_addBundleWriter)(string $targetDir, [BundleWriterInterface](../bundle/writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface") $writer) Adds a writer to be used during the data conversion. | | | [BundleWriterInterface](../bundle/writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface")[] | [getBundleWriters](#method_getBundleWriters)() Returns the writers indexed by their output directories. | | | string | [getSourceDir](#method_getSourceDir)() Returns the directory where the source versions of the resource bundles are stored. | | | string | [getIcuVersion](#method_getIcuVersion)() Returns the ICU version of the bundles being converted. | | Details ------- ### \_\_construct(string $sourceDir, string $icuVersion) #### Parameters | | | | | --- | --- | --- | | string | $sourceDir | | | string | $icuVersion | | ### addBundleWriter(string $targetDir, [BundleWriterInterface](../bundle/writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface") $writer) Adds a writer to be used during the data conversion. #### Parameters | | | | | --- | --- | --- | | string | $targetDir | The output directory | | [BundleWriterInterface](../bundle/writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface") | $writer | The writer instance | ### [BundleWriterInterface](../bundle/writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface")[] getBundleWriters() Returns the writers indexed by their output directories. #### Return Value | | | | --- | --- | | [BundleWriterInterface](../bundle/writer/bundlewriterinterface "Symfony\Component\Intl\Data\Bundle\Writer\BundleWriterInterface")[] | | ### string getSourceDir() Returns the directory where the source versions of the resource bundles are stored. #### Return Value | | | | --- | --- | | string | An absolute path to a directory | ### string getIcuVersion() Returns the ICU version of the bundles being converted. #### Return Value | | | | --- | --- | | string | The ICU version string | symfony MissingResourceException MissingResourceException ========================= class **MissingResourceException** extends [RuntimeException](runtimeexception "Symfony\Component\Intl\Exception\RuntimeException") Thrown when an invalid entry of a resource bundle was requested. symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Intl\Exception\ExceptionInterface") InvalidArgumentException for the Intl component. symfony MethodArgumentNotImplementedException MethodArgumentNotImplementedException ====================================== class **MethodArgumentNotImplementedException** extends [NotImplementedException](notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") Constants --------- | | | | --- | --- | | INTL\_INSTALL\_MESSAGE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $methodName, string $argName) | | Details ------- ### \_\_construct(string $methodName, string $argName) #### Parameters | | | | | --- | --- | --- | | string | $methodName | The method name that raised the exception | | string | $argName | The argument name that is not implemented | symfony MethodNotImplementedException MethodNotImplementedException ============================== class **MethodNotImplementedException** extends [NotImplementedException](notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") Constants --------- | | | | --- | --- | | INTL\_INSTALL\_MESSAGE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $methodName) | | Details ------- ### \_\_construct(string $methodName) #### Parameters | | | | | --- | --- | --- | | string | $methodName | The name of the method | symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Base ExceptionInterface for the Intl component. symfony MethodArgumentValueNotImplementedException MethodArgumentValueNotImplementedException =========================================== class **MethodArgumentValueNotImplementedException** extends [NotImplementedException](notimplementedexception "Symfony\Component\Intl\Exception\NotImplementedException") Constants --------- | | | | --- | --- | | INTL\_INSTALL\_MESSAGE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $methodName, string $argName, mixed $argValue, string $additionalMessage = '') | | Details ------- ### \_\_construct(string $methodName, string $argName, mixed $argValue, string $additionalMessage = '') #### Parameters | | | | | --- | --- | --- | | string | $methodName | The method name that raised the exception | | string | $argName | The argument name | | mixed | $argValue | The argument value that is not implemented | | string | $additionalMessage | An optional additional message to append to the exception message | symfony ResourceBundleNotFoundException ResourceBundleNotFoundException ================================ class **ResourceBundleNotFoundException** extends [RuntimeException](runtimeexception "Symfony\Component\Intl\Exception\RuntimeException") symfony NotImplementedException NotImplementedException ======================== class **NotImplementedException** extends [RuntimeException](runtimeexception "Symfony\Component\Intl\Exception\RuntimeException") Base exception class for not implemented behaviors of the intl extension in the Locale component. Constants --------- | | | | --- | --- | | INTL\_INSTALL\_MESSAGE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message) | | Details ------- ### \_\_construct(string $message) #### Parameters | | | | | --- | --- | --- | | string | $message | The exception message. A note to install the intl extension is appended to this string | symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Intl\Exception\ExceptionInterface") RuntimeException for the Intl component. symfony OutOfBoundsException OutOfBoundsException ===================== class **OutOfBoundsException** extends [OutOfBoundsException](http://php.net/OutOfBoundsException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Intl\Exception\ExceptionInterface") Base OutOfBoundsException for the Intl component. symfony BadMethodCallException BadMethodCallException ======================= class **BadMethodCallException** extends [BadMethodCallException](http://php.net/BadMethodCallException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Intl\Exception\ExceptionInterface") Base BadMethodCallException for the Intl component. symfony UnexpectedTypeException UnexpectedTypeException ======================== class **UnexpectedTypeException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\Intl\Exception\InvalidArgumentException") Thrown when a method argument had an unexpected type. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($value, string $expectedType) | | Details ------- ### \_\_construct($value, string $expectedType) #### Parameters | | | | | --- | --- | --- | | | $value | | | string | $expectedType | |
programming_docs
symfony DataCollectorTranslator DataCollectorTranslator ======================== class **DataCollectorTranslator** implements [TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface"), [TranslatorBagInterface](translatorbaginterface "Symfony\Component\Translation\TranslatorBagInterface") Constants --------- | | | | --- | --- | | MESSAGE\_DEFINED | | | MESSAGE\_MISSING | | | MESSAGE\_EQUALS\_FALLBACK | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") $translator) | | | string | [trans](#method_trans)(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. | | | string | [transChoice](#method_transChoice)(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. | | | | [setLocale](#method_setLocale)(string $locale) Sets the current locale. | | | string | [getLocale](#method_getLocale)() Returns the current locale. | | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getCatalogue](#method_getCatalogue)(string|null $locale = null) Gets the catalogue by locale. | | | array | [getFallbackLocales](#method_getFallbackLocales)() Gets the fallback locales. | | | | [\_\_call](#method___call)($method, $args) Passes through all unknown calls onto the translator object. | | | array | [getCollectedMessages](#method_getCollectedMessages)() | | Details ------- ### \_\_construct([TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") $translator) #### Parameters | | | | | --- | --- | --- | | [TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") | $translator | The translator must implement TranslatorBagInterface | ### string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string transChoice(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### setLocale(string $locale) Sets the current locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string getLocale() Returns the current locale. #### Return Value | | | | --- | --- | | string | The locale | ### [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getCatalogue(string|null $locale = null) Gets the catalogue by locale. #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### array getFallbackLocales() Gets the fallback locales. #### Return Value | | | | --- | --- | | array | $locales The fallback locales | ### \_\_call($method, $args) Passes through all unknown calls onto the translator object. #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### array getCollectedMessages() #### Return Value | | | | --- | --- | | array | | symfony MessageCatalogue MessageCatalogue ================= class **MessageCatalogue** implements [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface"), [MetadataAwareInterface](metadataawareinterface "Symfony\Component\Translation\MetadataAwareInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $locale, array $messages = array()) | | | string | [getLocale](#method_getLocale)() Gets the catalogue locale. | | | array | [getDomains](#method_getDomains)() Gets the domains. | | | array | [all](#method_all)(string $domain = null) Gets the messages within a given domain. | | | | [set](#method_set)(string $id, string $translation, string $domain = 'messages') Sets a message translation. | | | bool | [has](#method_has)(string $id, string $domain = 'messages') Checks if a message has a translation. | | | bool | [defines](#method_defines)(string $id, string $domain = 'messages') Checks if a message has a translation (it does not take into account the fallback mechanism). | | | string | [get](#method_get)(string $id, string $domain = 'messages') Gets a message translation. | | | | [replace](#method_replace)(array $messages, string $domain = 'messages') Sets translations for a given domain. | | | | [add](#method_add)(array $messages, string $domain = 'messages') Adds translations for a given domain. | | | | [addCatalogue](#method_addCatalogue)([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one. | | | | [addFallbackCatalogue](#method_addFallbackCatalogue)([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one only when the translation does not exist. | | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")|null | [getFallbackCatalogue](#method_getFallbackCatalogue)() Gets the fallback catalogue. | | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | [getResources](#method_getResources)() Returns an array of resources loaded to build this collection. | | | | [addResource](#method_addResource)([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) Adds a resource for this collection. | | | mixed | [getMetadata](#method_getMetadata)(string $key = '', string $domain = 'messages') Gets metadata for the given domain and key. | | | | [setMetadata](#method_setMetadata)(string $key, mixed $value, string $domain = 'messages') Adds metadata to a message domain. | | | | [deleteMetadata](#method_deleteMetadata)(string $key = '', string $domain = 'messages') Deletes metadata for the given key and domain. | | Details ------- ### \_\_construct(string|null $locale, array $messages = array()) #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale | | array | $messages | An array of messages classified by domain | ### string getLocale() Gets the catalogue locale. #### Return Value | | | | --- | --- | | string | The locale | ### array getDomains() Gets the domains. #### Return Value | | | | --- | --- | | array | An array of domains | ### array all(string $domain = null) Gets the messages within a given domain. If $domain is null, it returns all messages. #### Parameters | | | | | --- | --- | --- | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | array | An array of messages | ### set(string $id, string $translation, string $domain = 'messages') Sets a message translation. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $translation | The messages translation | | string | $domain | The domain name | ### bool has(string $id, string $domain = 'messages') Checks if a message has a translation. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | bool | true if the message has a translation, false otherwise | ### bool defines(string $id, string $domain = 'messages') Checks if a message has a translation (it does not take into account the fallback mechanism). #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | bool | true if the message has a translation, false otherwise | ### string get(string $id, string $domain = 'messages') Gets a message translation. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | string | The message translation | ### replace(array $messages, string $domain = 'messages') Sets translations for a given domain. #### Parameters | | | | | --- | --- | --- | | array | $messages | An array of translations | | string | $domain | The domain name | ### add(array $messages, string $domain = 'messages') Adds translations for a given domain. #### Parameters | | | | | --- | --- | --- | | array | $messages | An array of translations | | string | $domain | The domain name | ### addCatalogue([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one. The two catalogues must have the same locale. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $catalogue | | ### addFallbackCatalogue([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one only when the translation does not exist. This is used to provide default translations when they do not exist for the current locale. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $catalogue | | ### [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")|null getFallbackCatalogue() Gets the fallback catalogue. #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")|null | A MessageCatalogueInterface instance or null when no fallback has been set | ### [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] getResources() Returns an array of resources loaded to build this collection. #### Return Value | | | | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | An array of resources | ### addResource([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) Adds a resource for this collection. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | | ### mixed getMetadata(string $key = '', string $domain = 'messages') Gets metadata for the given domain and key. Passing an empty domain will return an array with all metadata indexed by domain and then by key. Passing an empty key will return an array with all metadata for the given domain. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | mixed | The value that was set or an array with the domains/keys or null | ### setMetadata(string $key, mixed $value, string $domain = 'messages') Adds metadata to a message domain. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $value | The value | | string | $domain | The domain name | ### deleteMetadata(string $key = '', string $domain = 'messages') Deletes metadata for the given key and domain. Passing an empty domain will delete all metadata. Passing an empty key will delete all metadata for the given domain. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string | $domain | The domain name | symfony MetadataAwareInterface MetadataAwareInterface ======================= interface **MetadataAwareInterface** MetadataAwareInterface. Methods ------- | | | | | --- | --- | --- | | mixed | [getMetadata](#method_getMetadata)(string $key = '', string $domain = 'messages') Gets metadata for the given domain and key. | | | | [setMetadata](#method_setMetadata)(string $key, mixed $value, string $domain = 'messages') Adds metadata to a message domain. | | | | [deleteMetadata](#method_deleteMetadata)(string $key = '', string $domain = 'messages') Deletes metadata for the given key and domain. | | Details ------- ### mixed getMetadata(string $key = '', string $domain = 'messages') Gets metadata for the given domain and key. Passing an empty domain will return an array with all metadata indexed by domain and then by key. Passing an empty key will return an array with all metadata for the given domain. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | mixed | The value that was set or an array with the domains/keys or null | ### setMetadata(string $key, mixed $value, string $domain = 'messages') Adds metadata to a message domain. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $value | The value | | string | $domain | The domain name | ### deleteMetadata(string $key = '', string $domain = 'messages') Deletes metadata for the given key and domain. Passing an empty domain will delete all metadata. Passing an empty key will delete all metadata for the given domain. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string | $domain | The domain name | symfony TranslatorInterface TranslatorInterface ==================== interface **TranslatorInterface** TranslatorInterface. Methods ------- | | | | | --- | --- | --- | | string | [trans](#method_trans)(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. | | | string | [transChoice](#method_transChoice)(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. | | | | [setLocale](#method_setLocale)(string $locale) Sets the current locale. | | | string | [getLocale](#method_getLocale)() Returns the current locale. | | Details ------- ### string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string transChoice(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### setLocale(string $locale) Sets the current locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string getLocale() Returns the current locale. #### Return Value | | | | --- | --- | | string | The locale | symfony MessageCatalogueInterface MessageCatalogueInterface ========================== interface **MessageCatalogueInterface** MessageCatalogueInterface. Methods ------- | | | | | --- | --- | --- | | string | [getLocale](#method_getLocale)() Gets the catalogue locale. | | | array | [getDomains](#method_getDomains)() Gets the domains. | | | array | [all](#method_all)(string $domain = null) Gets the messages within a given domain. | | | | [set](#method_set)(string $id, string $translation, string $domain = 'messages') Sets a message translation. | | | bool | [has](#method_has)(string $id, string $domain = 'messages') Checks if a message has a translation. | | | bool | [defines](#method_defines)(string $id, string $domain = 'messages') Checks if a message has a translation (it does not take into account the fallback mechanism). | | | string | [get](#method_get)(string $id, string $domain = 'messages') Gets a message translation. | | | | [replace](#method_replace)(array $messages, string $domain = 'messages') Sets translations for a given domain. | | | | [add](#method_add)(array $messages, string $domain = 'messages') Adds translations for a given domain. | | | | [addCatalogue](#method_addCatalogue)([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one. | | | | [addFallbackCatalogue](#method_addFallbackCatalogue)([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one only when the translation does not exist. | | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")|null | [getFallbackCatalogue](#method_getFallbackCatalogue)() Gets the fallback catalogue. | | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | [getResources](#method_getResources)() Returns an array of resources loaded to build this collection. | | | | [addResource](#method_addResource)([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) Adds a resource for this collection. | | Details ------- ### string getLocale() Gets the catalogue locale. #### Return Value | | | | --- | --- | | string | The locale | ### array getDomains() Gets the domains. #### Return Value | | | | --- | --- | | array | An array of domains | ### array all(string $domain = null) Gets the messages within a given domain. If $domain is null, it returns all messages. #### Parameters | | | | | --- | --- | --- | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | array | An array of messages | ### set(string $id, string $translation, string $domain = 'messages') Sets a message translation. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $translation | The messages translation | | string | $domain | The domain name | ### bool has(string $id, string $domain = 'messages') Checks if a message has a translation. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | bool | true if the message has a translation, false otherwise | ### bool defines(string $id, string $domain = 'messages') Checks if a message has a translation (it does not take into account the fallback mechanism). #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | bool | true if the message has a translation, false otherwise | ### string get(string $id, string $domain = 'messages') Gets a message translation. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id | | string | $domain | The domain name | #### Return Value | | | | --- | --- | | string | The message translation | ### replace(array $messages, string $domain = 'messages') Sets translations for a given domain. #### Parameters | | | | | --- | --- | --- | | array | $messages | An array of translations | | string | $domain | The domain name | ### add(array $messages, string $domain = 'messages') Adds translations for a given domain. #### Parameters | | | | | --- | --- | --- | | array | $messages | An array of translations | | string | $domain | The domain name | ### addCatalogue([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one. The two catalogues must have the same locale. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $catalogue | | ### addFallbackCatalogue([MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $catalogue) Merges translations from the given Catalogue into the current one only when the translation does not exist. This is used to provide default translations when they do not exist for the current locale. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $catalogue | | ### [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")|null getFallbackCatalogue() Gets the fallback catalogue. #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")|null | A MessageCatalogueInterface instance or null when no fallback has been set | ### [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] getResources() Returns an array of resources loaded to build this collection. #### Return Value | | | | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | An array of resources | ### addResource([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) Adds a resource for this collection. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | |
programming_docs
symfony Symfony\Component\Translation\Util Symfony\Component\Translation\Util ================================== Classes ------- | | | | --- | --- | | [ArrayConverter](util/arrayconverter "Symfony\Component\Translation\Util\ArrayConverter") | ArrayConverter generates tree like structure from a message catalogue. | symfony Interval Interval ========= class **Interval** Tests if a given number belongs to a given math interval. An interval can represent a finite set of numbers: {1,2,3,4} An interval can represent numbers between two numbers: [1, +Inf] ]-1,2[ The left delimiter can be [ (inclusive) or ] (exclusive). The right delimiter can be [ (exclusive) or ] (inclusive). Beside numbers, you can use -Inf and +Inf for the infinite. Methods ------- | | | | | --- | --- | --- | | static bool | [test](#method_test)(int $number, string $interval) Tests if the given number is in the math interval. | | | static string | [getIntervalRegexp](#method_getIntervalRegexp)() Returns a Regexp that matches valid intervals. | | Details ------- ### static bool test(int $number, string $interval) Tests if the given number is in the math interval. #### Parameters | | | | | --- | --- | --- | | int | $number | A number | | string | $interval | An interval | #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | | ### static string getIntervalRegexp() Returns a Regexp that matches valid intervals. #### Return Value | | | | --- | --- | | string | A Regexp (without the delimiters) | symfony Symfony\Component\Translation\Exception Symfony\Component\Translation\Exception ======================================= Classes ------- | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | Base InvalidArgumentException for the Translation component. | | [InvalidResourceException](exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | Thrown when a resource cannot be loaded. | | [LogicException](exception/logicexception "Symfony\Component\Translation\Exception\LogicException") | Base LogicException for Translation component. | | [NotFoundResourceException](exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | Thrown when a resource does not exist. | | [RuntimeException](exception/runtimeexception "Symfony\Component\Translation\Exception\RuntimeException") | Base RuntimeException for the Translation component. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Translation\Exception\ExceptionInterface")* | Exception interface for all exceptions thrown by the component. | symfony MessageSelector MessageSelector ================ class **MessageSelector** MessageSelector. Methods ------- | | | | | --- | --- | --- | | string | [choose](#method_choose)(string $message, int $number, string $locale) Given a message with different plural translations separated by a pipe (|), this method returns the correct portion of the message based on the given number, locale and the pluralization rules in the message itself. | | Details ------- ### string choose(string $message, int $number, string $locale) Given a message with different plural translations separated by a pipe (|), this method returns the correct portion of the message based on the given number, locale and the pluralization rules in the message itself. The message supports two different types of pluralization rules: interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples indexed: There is one apple|There are %count% apples The indexed solution can also contain labels (e.g. one: There is one apple). This is purely for making the translations more clear - it does not affect the functionality. The two methods can also be mixed: {0} There are no apples|one: There is one apple|more: There are %count% apples #### Parameters | | | | | --- | --- | --- | | string | $message | The message being translated | | int | $number | The number of items represented for the message | | string | $locale | The locale to use for choosing | #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | | symfony LoggingTranslator LoggingTranslator ================== class **LoggingTranslator** implements [TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface"), [TranslatorBagInterface](translatorbaginterface "Symfony\Component\Translation\TranslatorBagInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") $translator, LoggerInterface $logger) | | | string | [trans](#method_trans)(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. | | | string | [transChoice](#method_transChoice)(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. | | | | [setLocale](#method_setLocale)(string $locale) Sets the current locale. | | | string | [getLocale](#method_getLocale)() Returns the current locale. | | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getCatalogue](#method_getCatalogue)(string|null $locale = null) Gets the catalogue by locale. | | | array | [getFallbackLocales](#method_getFallbackLocales)() Gets the fallback locales. | | | | [\_\_call](#method___call)($method, $args) Passes through all unknown calls onto the translator object. | | Details ------- ### \_\_construct([TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") $translator, LoggerInterface $logger) #### Parameters | | | | | --- | --- | --- | | [TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") | $translator | The translator must implement TranslatorBagInterface | | LoggerInterface | $logger | | ### string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string transChoice(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### setLocale(string $locale) Sets the current locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string getLocale() Returns the current locale. #### Return Value | | | | --- | --- | | string | The locale | ### [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getCatalogue(string|null $locale = null) Gets the catalogue by locale. #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### array getFallbackLocales() Gets the fallback locales. #### Return Value | | | | --- | --- | | array | $locales The fallback locales | ### \_\_call($method, $args) Passes through all unknown calls onto the translator object. #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | symfony Symfony\Component\Translation\DataCollector Symfony\Component\Translation\DataCollector =========================================== Classes ------- | | | | --- | --- | | [TranslationDataCollector](datacollector/translationdatacollector "Symfony\Component\Translation\DataCollector\TranslationDataCollector") | | symfony Symfony\Component\Translation\Writer Symfony\Component\Translation\Writer ==================================== Classes ------- | | | | --- | --- | | [TranslationWriter](writer/translationwriter "Symfony\Component\Translation\Writer\TranslationWriter") | TranslationWriter writes translation messages. | Interfaces ---------- | | | | --- | --- | | *[TranslationWriterInterface](writer/translationwriterinterface "Symfony\Component\Translation\Writer\TranslationWriterInterface")* | TranslationWriter writes translation messages. | symfony Symfony\Component\Translation\Loader Symfony\Component\Translation\Loader ==================================== Classes ------- | | | | --- | --- | | [ArrayLoader](loader/arrayloader "Symfony\Component\Translation\Loader\ArrayLoader") | ArrayLoader loads translations from a PHP array. | | [CsvFileLoader](loader/csvfileloader "Symfony\Component\Translation\Loader\CsvFileLoader") | CsvFileLoader loads translations from CSV files. | | [FileLoader](loader/fileloader "Symfony\Component\Translation\Loader\FileLoader") | | | [IcuDatFileLoader](loader/icudatfileloader "Symfony\Component\Translation\Loader\IcuDatFileLoader") | IcuResFileLoader loads translations from a resource bundle. | | [IcuResFileLoader](loader/icuresfileloader "Symfony\Component\Translation\Loader\IcuResFileLoader") | IcuResFileLoader loads translations from a resource bundle. | | [IniFileLoader](loader/inifileloader "Symfony\Component\Translation\Loader\IniFileLoader") | IniFileLoader loads translations from an ini file. | | [JsonFileLoader](loader/jsonfileloader "Symfony\Component\Translation\Loader\JsonFileLoader") | JsonFileLoader loads translations from an json file. | | [MoFileLoader](loader/mofileloader "Symfony\Component\Translation\Loader\MoFileLoader") | | | [PhpFileLoader](loader/phpfileloader "Symfony\Component\Translation\Loader\PhpFileLoader") | PhpFileLoader loads translations from PHP files returning an array of translations. | | [PoFileLoader](loader/pofileloader "Symfony\Component\Translation\Loader\PoFileLoader") | | | [QtFileLoader](loader/qtfileloader "Symfony\Component\Translation\Loader\QtFileLoader") | QtFileLoader loads translations from QT Translations XML files. | | [XliffFileLoader](loader/xlifffileloader "Symfony\Component\Translation\Loader\XliffFileLoader") | XliffFileLoader loads translations from XLIFF files. | | [YamlFileLoader](loader/yamlfileloader "Symfony\Component\Translation\Loader\YamlFileLoader") | YamlFileLoader loads translations from Yaml files. | Interfaces ---------- | | | | --- | --- | | *[LoaderInterface](loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface")* | LoaderInterface is the interface implemented by all translation loaders. | symfony Symfony\Component\Translation\Command Symfony\Component\Translation\Command ===================================== Classes ------- | | | | --- | --- | | [XliffLintCommand](command/xlifflintcommand "Symfony\Component\Translation\Command\XliffLintCommand") | Validates XLIFF files syntax and outputs encountered errors. | symfony Symfony\Component\Translation\Catalogue Symfony\Component\Translation\Catalogue ======================================= Classes ------- | | | | --- | --- | | [AbstractOperation](catalogue/abstractoperation "Symfony\Component\Translation\Catalogue\AbstractOperation") | Base catalogues binary operation class. | | [MergeOperation](catalogue/mergeoperation "Symfony\Component\Translation\Catalogue\MergeOperation") | Merge operation between two catalogues as follows: all = source ∪ target = {x: x ∈ source ∨ x ∈ target} new = all ∖ source = {x: x ∈ target ∧ x ∉ source} obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅ Basically, the result contains messages from both catalogues. | | [TargetOperation](catalogue/targetoperation "Symfony\Component\Translation\Catalogue\TargetOperation") | Target operation between two catalogues: intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target} all = intersection ∪ (target ∖ intersection) = target new = all ∖ source = {x: x ∈ target ∧ x ∉ source} obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} Basically, the result contains messages from the target catalogue. | Interfaces ---------- | | | | --- | --- | | *[OperationInterface](catalogue/operationinterface "Symfony\Component\Translation\Catalogue\OperationInterface")* | Represents an operation on catalogue(s). | symfony Symfony\Component\Translation\Reader Symfony\Component\Translation\Reader ==================================== Classes ------- | | | | --- | --- | | [TranslationReader](reader/translationreader "Symfony\Component\Translation\Reader\TranslationReader") | TranslationReader reads translation messages from translation files. | Interfaces ---------- | | | | --- | --- | | *[TranslationReaderInterface](reader/translationreaderinterface "Symfony\Component\Translation\Reader\TranslationReaderInterface")* | TranslationReader reads translation messages from translation files. | symfony Translator Translator =========== class **Translator** implements [TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface"), [TranslatorBagInterface](translatorbaginterface "Symfony\Component\Translation\TranslatorBagInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface")[] | $catalogues | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $locale, [MessageFormatterInterface](formatter/messageformatterinterface "Symfony\Component\Translation\Formatter\MessageFormatterInterface") $formatter = null, string $cacheDir = null, bool $debug = false) | | | | [setConfigCacheFactory](#method_setConfigCacheFactory)([ConfigCacheFactoryInterface](../config/configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") $configCacheFactory) | | | | [addLoader](#method_addLoader)(string $format, [LoaderInterface](loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") $loader) Adds a Loader. | | | | [addResource](#method_addResource)(string $format, mixed $resource, string $locale, string $domain = null) Adds a Resource. | | | | [setLocale](#method_setLocale)(string $locale) Sets the current locale. | | | string | [getLocale](#method_getLocale)() Returns the current locale. | | | | [setFallbackLocales](#method_setFallbackLocales)(array $locales) Sets the fallback locales. | | | array | [getFallbackLocales](#method_getFallbackLocales)() Gets the fallback locales. | | | string | [trans](#method_trans)(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. | | | string | [transChoice](#method_transChoice)(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. | | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getCatalogue](#method_getCatalogue)(string|null $locale = null) Gets the catalogue by locale. | | | array | [getLoaders](#method_getLoaders)() Gets the loaders. | | | | [loadCatalogue](#method_loadCatalogue)(string $locale) | | | | [initializeCatalogue](#method_initializeCatalogue)(string $locale) | | | | [computeFallbackLocales](#method_computeFallbackLocales)($locale) | | | | [assertValidLocale](#method_assertValidLocale)(string $locale) Asserts that the locale is valid, throws an Exception if not. | | Details ------- ### \_\_construct(string|null $locale, [MessageFormatterInterface](formatter/messageformatterinterface "Symfony\Component\Translation\Formatter\MessageFormatterInterface") $formatter = null, string $cacheDir = null, bool $debug = false) #### Parameters | | | | | --- | --- | --- | | string|null | $locale | | | [MessageFormatterInterface](formatter/messageformatterinterface "Symfony\Component\Translation\Formatter\MessageFormatterInterface") | $formatter | | | string | $cacheDir | | | bool | $debug | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If a locale contains invalid characters | ### setConfigCacheFactory([ConfigCacheFactoryInterface](../config/configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") $configCacheFactory) #### Parameters | | | | | --- | --- | --- | | [ConfigCacheFactoryInterface](../config/configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") | $configCacheFactory | | ### addLoader(string $format, [LoaderInterface](loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") $loader) Adds a Loader. #### Parameters | | | | | --- | --- | --- | | string | $format | The name of the loader (see addResource()) | | [LoaderInterface](loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") | $loader | A LoaderInterface instance | ### addResource(string $format, mixed $resource, string $locale, string $domain = null) Adds a Resource. #### Parameters | | | | | --- | --- | --- | | string | $format | The name of the loader (see addLoader()) | | mixed | $resource | The resource name | | string | $locale | The locale | | string | $domain | The domain | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### setLocale(string $locale) Sets the current locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string getLocale() Returns the current locale. #### Return Value | | | | --- | --- | | string | The locale | ### setFallbackLocales(array $locales) Sets the fallback locales. #### Parameters | | | | | --- | --- | --- | | array | $locales | The fallback locales | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If a locale contains invalid characters | ### array getFallbackLocales() Gets the fallback locales. #### Return Value | | | | --- | --- | | array | $locales The fallback locales | ### string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string transChoice(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getCatalogue(string|null $locale = null) Gets the catalogue by locale. #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### protected array getLoaders() Gets the loaders. #### Return Value | | | | --- | --- | | array | LoaderInterface[] | ### protected loadCatalogue(string $locale) #### Parameters | | | | | --- | --- | --- | | string | $locale | | ### protected initializeCatalogue(string $locale) #### Parameters | | | | | --- | --- | --- | | string | $locale | | ### protected computeFallbackLocales($locale) #### Parameters | | | | | --- | --- | --- | | | $locale | | ### protected assertValidLocale(string $locale) Asserts that the locale is valid, throws an Exception if not. #### Parameters | | | | | --- | --- | --- | | string | $locale | Locale to tests | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters |
programming_docs
symfony Symfony\Component\Translation\Formatter Symfony\Component\Translation\Formatter ======================================= Classes ------- | | | | --- | --- | | [MessageFormatter](formatter/messageformatter "Symfony\Component\Translation\Formatter\MessageFormatter") | | Interfaces ---------- | | | | --- | --- | | *[ChoiceMessageFormatterInterface](formatter/choicemessageformatterinterface "Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface")* | | | *[MessageFormatterInterface](formatter/messageformatterinterface "Symfony\Component\Translation\Formatter\MessageFormatterInterface")* | | symfony Symfony\Component\Translation\Dumper Symfony\Component\Translation\Dumper ==================================== Classes ------- | | | | --- | --- | | [CsvFileDumper](dumper/csvfiledumper "Symfony\Component\Translation\Dumper\CsvFileDumper") | CsvFileDumper generates a csv formatted string representation of a message catalogue. | | [FileDumper](dumper/filedumper "Symfony\Component\Translation\Dumper\FileDumper") | FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). | | [IcuResFileDumper](dumper/icuresfiledumper "Symfony\Component\Translation\Dumper\IcuResFileDumper") | IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. | | [IniFileDumper](dumper/inifiledumper "Symfony\Component\Translation\Dumper\IniFileDumper") | IniFileDumper generates an ini formatted string representation of a message catalogue. | | [JsonFileDumper](dumper/jsonfiledumper "Symfony\Component\Translation\Dumper\JsonFileDumper") | JsonFileDumper generates an json formatted string representation of a message catalogue. | | [MoFileDumper](dumper/mofiledumper "Symfony\Component\Translation\Dumper\MoFileDumper") | MoFileDumper generates a gettext formatted string representation of a message catalogue. | | [PhpFileDumper](dumper/phpfiledumper "Symfony\Component\Translation\Dumper\PhpFileDumper") | PhpFileDumper generates PHP files from a message catalogue. | | [PoFileDumper](dumper/pofiledumper "Symfony\Component\Translation\Dumper\PoFileDumper") | PoFileDumper generates a gettext formatted string representation of a message catalogue. | | [QtFileDumper](dumper/qtfiledumper "Symfony\Component\Translation\Dumper\QtFileDumper") | QtFileDumper generates ts files from a message catalogue. | | [XliffFileDumper](dumper/xlifffiledumper "Symfony\Component\Translation\Dumper\XliffFileDumper") | XliffFileDumper generates xliff files from a message catalogue. | | [YamlFileDumper](dumper/yamlfiledumper "Symfony\Component\Translation\Dumper\YamlFileDumper") | YamlFileDumper generates yaml files from a message catalogue. | Interfaces ---------- | | | | --- | --- | | *[DumperInterface](dumper/dumperinterface "Symfony\Component\Translation\Dumper\DumperInterface")* | DumperInterface is the interface implemented by all translation dumpers. | symfony Symfony\Component\Translation\DependencyInjection Symfony\Component\Translation\DependencyInjection ================================================= Classes ------- | | | | --- | --- | | [TranslationDumperPass](dependencyinjection/translationdumperpass "Symfony\Component\Translation\DependencyInjection\TranslationDumperPass") | Adds tagged translation.formatter services to translation writer. | | [TranslationExtractorPass](dependencyinjection/translationextractorpass "Symfony\Component\Translation\DependencyInjection\TranslationExtractorPass") | Adds tagged translation.extractor services to translation extractor. | | [TranslatorPass](dependencyinjection/translatorpass "Symfony\Component\Translation\DependencyInjection\TranslatorPass") | | symfony PluralizationRules PluralizationRules =================== class **PluralizationRules** Returns the plural rules for a given locale. Methods ------- | | | | | --- | --- | --- | | static int | [get](#method_get)(int $number, string $locale) Returns the plural position to use for the given locale and number. | | | static | [set](#method_set)(callable $rule, string $locale) Overrides the default plural rule for a given locale. | | Details ------- ### static int get(int $number, string $locale) Returns the plural position to use for the given locale and number. #### Parameters | | | | | --- | --- | --- | | int | $number | The number | | string | $locale | The locale | #### Return Value | | | | --- | --- | | int | The plural position | ### static set(callable $rule, string $locale) Overrides the default plural rule for a given locale. #### Parameters | | | | | --- | --- | --- | | callable | $rule | A PHP callable | | string | $locale | The locale | symfony TranslatorBagInterface TranslatorBagInterface ======================= interface **TranslatorBagInterface** TranslatorBagInterface. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getCatalogue](#method_getCatalogue)(string|null $locale = null) Gets the catalogue by locale. | | Details ------- ### [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getCatalogue(string|null $locale = null) Gets the catalogue by locale. #### Parameters | | | | | --- | --- | --- | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | symfony IdentityTranslator IdentityTranslator =================== class **IdentityTranslator** implements [TranslatorInterface](translatorinterface "Symfony\Component\Translation\TranslatorInterface") IdentityTranslator does not translate anything. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([MessageSelector](messageselector "Symfony\Component\Translation\MessageSelector") $selector = null) | | | | [setLocale](#method_setLocale)(string $locale) Sets the current locale. | | | string | [getLocale](#method_getLocale)() Returns the current locale. | | | string | [trans](#method_trans)(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. | | | string | [transChoice](#method_transChoice)(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. | | Details ------- ### \_\_construct([MessageSelector](messageselector "Symfony\Component\Translation\MessageSelector") $selector = null) #### Parameters | | | | | --- | --- | --- | | [MessageSelector](messageselector "Symfony\Component\Translation\MessageSelector") | $selector | The message selector for pluralization | ### setLocale(string $locale) Sets the current locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | The locale | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string getLocale() Returns the current locale. #### Return Value | | | | --- | --- | | string | The locale | ### string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given message. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | ### string transChoice(string $id, int $number, array $parameters = array(), string|null $domain = null, string|null $locale = null) Translates the given choice message by choosing a translation according to a number. #### Parameters | | | | | --- | --- | --- | | string | $id | The message id (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | array | $parameters | An array of parameters for the message | | string|null | $domain | The domain for the message or null to use the default | | string|null | $locale | The locale or null to use the default | #### Return Value | | | | --- | --- | | string | The translated string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | If the locale contains invalid characters | symfony Symfony\Component\Translation\Extractor Symfony\Component\Translation\Extractor ======================================= Classes ------- | | | | --- | --- | | [AbstractFileExtractor](extractor/abstractfileextractor "Symfony\Component\Translation\Extractor\AbstractFileExtractor") | Base class used by classes that extract translation messages from files. | | [ChainExtractor](extractor/chainextractor "Symfony\Component\Translation\Extractor\ChainExtractor") | ChainExtractor extracts translation messages from template files. | | [PhpExtractor](extractor/phpextractor "Symfony\Component\Translation\Extractor\PhpExtractor") | PhpExtractor extracts translation messages from a PHP template. | | [PhpStringTokenParser](extractor/phpstringtokenparser "Symfony\Component\Translation\Extractor\PhpStringTokenParser") | | Interfaces ---------- | | | | --- | --- | | *[ExtractorInterface](extractor/extractorinterface "Symfony\Component\Translation\Extractor\ExtractorInterface")* | Extracts translation messages from a directory or files to the catalogue. | symfony TranslationReader TranslationReader ================== class **TranslationReader** implements [TranslationReaderInterface](translationreaderinterface "Symfony\Component\Translation\Reader\TranslationReaderInterface") TranslationReader reads translation messages from translation files. Methods ------- | | | | | --- | --- | --- | | | [addLoader](#method_addLoader)(string $format, [LoaderInterface](../loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") $loader) Adds a loader to the translation extractor. | | | | [read](#method_read)(string $directory, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Reads translation messages from a directory to the catalogue. | | Details ------- ### addLoader(string $format, [LoaderInterface](../loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") $loader) Adds a loader to the translation extractor. #### Parameters | | | | | --- | --- | --- | | string | $format | The format of the loader | | [LoaderInterface](../loader/loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") | $loader | | ### read(string $directory, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Reads translation messages from a directory to the catalogue. #### Parameters | | | | | --- | --- | --- | | string | $directory | | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalogue | | symfony TranslationReaderInterface TranslationReaderInterface =========================== interface **TranslationReaderInterface** TranslationReader reads translation messages from translation files. Methods ------- | | | | | --- | --- | --- | | | [read](#method_read)(string $directory, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Reads translation messages from a directory to the catalogue. | | Details ------- ### read(string $directory, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Reads translation messages from a directory to the catalogue. #### Parameters | | | | | --- | --- | --- | | string | $directory | | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalogue | | symfony TranslationDataCollector TranslationDataCollector ========================= class **TranslationDataCollector** extends [DataCollector](../../httpkernel/datacollector/datacollector "Symfony\Component\HttpKernel\DataCollector\DataCollector") implements [LateDataCollectorInterface](../../httpkernel/datacollector/latedatacollectorinterface "Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $data | | from [DataCollector](../../httpkernel/datacollector/datacollector#property_data "Symfony\Component\HttpKernel\DataCollector\DataCollector") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [DataCollector](../../httpkernel/datacollector/datacollector#method_serialize "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | | [unserialize](#method_unserialize)($data) | from [DataCollector](../../httpkernel/datacollector/datacollector#method_unserialize "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | [Data](../../vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | [cloneVar](#method_cloneVar)(mixed $var) Converts the variable into a serializable Data instance. | from [DataCollector](../../httpkernel/datacollector/datacollector#method_cloneVar "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | callable[] | [getCasters](#method_getCasters)() | from [DataCollector](../../httpkernel/datacollector/datacollector#method_getCasters "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | | [\_\_construct](#method___construct)([DataCollectorTranslator](../datacollectortranslator "Symfony\Component\Translation\DataCollectorTranslator") $translator) | | | | [lateCollect](#method_lateCollect)() Collects data as late as possible. | | | | [collect](#method_collect)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [Exception](http://php.net/Exception) $exception = null) Collects data for the given Request and Response. | | | | [reset](#method_reset)() Resets this data collector to its initial state. | | | array | [getMessages](#method_getMessages)() | | | int | [getCountMissings](#method_getCountMissings)() | | | int | [getCountFallbacks](#method_getCountFallbacks)() | | | int | [getCountDefines](#method_getCountDefines)() | | | | [getLocale](#method_getLocale)() | | | | [getFallbackLocales](#method_getFallbackLocales)() | | | string | [getName](#method_getName)() Returns the name of the collector. | | Details ------- ### serialize() ### unserialize($data) #### Parameters | | | | | --- | --- | --- | | | $data | | ### protected [Data](../../vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") cloneVar(mixed $var) Converts the variable into a serializable Data instance. This array can be displayed in the template using the VarDumper component. #### Parameters | | | | | --- | --- | --- | | mixed | $var | | #### Return Value | | | | --- | --- | | [Data](../../vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | | ### protected callable[] getCasters() #### Return Value | | | | --- | --- | | callable[] | The casters to add to the cloner | ### \_\_construct([DataCollectorTranslator](../datacollectortranslator "Symfony\Component\Translation\DataCollectorTranslator") $translator) #### Parameters | | | | | --- | --- | --- | | [DataCollectorTranslator](../datacollectortranslator "Symfony\Component\Translation\DataCollectorTranslator") | $translator | | ### lateCollect() Collects data as late as possible. ### collect([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [Exception](http://php.net/Exception) $exception = null) Collects data for the given Request and Response. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [Exception](http://php.net/Exception) | $exception | | ### reset() Resets this data collector to its initial state. ### array getMessages() #### Return Value | | | | --- | --- | | array | | ### int getCountMissings() #### Return Value | | | | --- | --- | | int | | ### int getCountFallbacks() #### Return Value | | | | --- | --- | | int | | ### int getCountDefines() #### Return Value | | | | --- | --- | | int | | ### getLocale() ### getFallbackLocales() ### string getName() Returns the name of the collector. #### Return Value | | | | --- | --- | | string | The collector name | symfony ArrayConverter ArrayConverter =============== class **ArrayConverter** ArrayConverter generates tree like structure from a message catalogue. e.g. this 'foo.bar1' => 'test1', 'foo.bar2' => 'test2' converts to follows: foo: bar1: test1 bar2: test2. Methods ------- | | | | | --- | --- | --- | | static array | [expandToTree](#method_expandToTree)(array $messages) Converts linear messages array to tree-like array. | | Details ------- ### static array expandToTree(array $messages) Converts linear messages array to tree-like array. For example this rray('foo.bar' => 'value') will be converted to array('foo' => array('bar' => 'value')). #### Parameters | | | | | --- | --- | --- | | array | $messages | Linear messages array | #### Return Value | | | | --- | --- | | array | Tree-like messages array | symfony ExtractorInterface ExtractorInterface =================== interface **ExtractorInterface** Extracts translation messages from a directory or files to the catalogue. New found messages are injected to the catalogue using the prefix. Methods ------- | | | | | --- | --- | --- | | | [extract](#method_extract)(string|array $resource, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Extracts translation messages from files, a file or a directory to the catalogue. | | | | [setPrefix](#method_setPrefix)(string $prefix) Sets the prefix that should be used for new found messages. | | Details ------- ### extract(string|array $resource, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Extracts translation messages from files, a file or a directory to the catalogue. #### Parameters | | | | | --- | --- | --- | | string|array | $resource | Files, a file or a directory | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalogue | The catalogue | ### setPrefix(string $prefix) Sets the prefix that should be used for new found messages. #### Parameters | | | | | --- | --- | --- | | string | $prefix | The prefix |
programming_docs
symfony PhpExtractor PhpExtractor ============= class **PhpExtractor** extends [AbstractFileExtractor](abstractfileextractor "Symfony\Component\Translation\Extractor\AbstractFileExtractor") implements [ExtractorInterface](extractorinterface "Symfony\Component\Translation\Extractor\ExtractorInterface") PhpExtractor extracts translation messages from a PHP template. Constants --------- | | | | --- | --- | | MESSAGE\_TOKEN | | | METHOD\_ARGUMENTS\_TOKEN | | | DOMAIN\_TOKEN | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected array | $sequences | The sequence that captures translation messages. | | Methods ------- | | | | | --- | --- | --- | | array | [extractFiles](#method_extractFiles)(string|array $resource) | from [AbstractFileExtractor](abstractfileextractor#method_extractFiles "Symfony\Component\Translation\Extractor\AbstractFileExtractor") | | bool | [isFile](#method_isFile)(string $file) | from [AbstractFileExtractor](abstractfileextractor#method_isFile "Symfony\Component\Translation\Extractor\AbstractFileExtractor") | | bool | [canBeExtracted](#method_canBeExtracted)(string $file) | | | array | [extractFromDirectory](#method_extractFromDirectory)(string|array $directory) | | | | [extract](#method_extract)(string|array $resource, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalog) Extracts translation messages from files, a file or a directory to the catalogue. | | | | [setPrefix](#method_setPrefix)(string $prefix) Sets the prefix that should be used for new found messages. | | | string | [normalizeToken](#method_normalizeToken)(mixed $token) Normalizes a token. | | | | [parseTokens](#method_parseTokens)(array $tokens, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalog) Extracts trans message from PHP tokens. | | Details ------- ### protected array extractFiles(string|array $resource) #### Parameters | | | | | --- | --- | --- | | string|array | $resource | Files, a file or a directory | #### Return Value | | | | --- | --- | | array | | ### protected bool isFile(string $file) #### Parameters | | | | | --- | --- | --- | | string | $file | | #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | | ### protected bool canBeExtracted(string $file) #### Parameters | | | | | --- | --- | --- | | string | $file | | #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected array extractFromDirectory(string|array $directory) #### Parameters | | | | | --- | --- | --- | | string|array | $directory | | #### Return Value | | | | --- | --- | | array | files to be extracted | ### extract(string|array $resource, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalog) Extracts translation messages from files, a file or a directory to the catalogue. #### Parameters | | | | | --- | --- | --- | | string|array | $resource | Files, a file or a directory | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalog | | ### setPrefix(string $prefix) Sets the prefix that should be used for new found messages. #### Parameters | | | | | --- | --- | --- | | string | $prefix | The prefix | ### protected string normalizeToken(mixed $token) Normalizes a token. #### Parameters | | | | | --- | --- | --- | | mixed | $token | | #### Return Value | | | | --- | --- | | string | | ### protected parseTokens(array $tokens, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalog) Extracts trans message from PHP tokens. #### Parameters | | | | | --- | --- | --- | | array | $tokens | | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalog | | symfony AbstractFileExtractor AbstractFileExtractor ====================== abstract class **AbstractFileExtractor** Base class used by classes that extract translation messages from files. Methods ------- | | | | | --- | --- | --- | | array | [extractFiles](#method_extractFiles)(string|array $resource) | | | bool | [isFile](#method_isFile)(string $file) | | | bool | [canBeExtracted](#method_canBeExtracted)(string $file) | | | array | [extractFromDirectory](#method_extractFromDirectory)(string|array $resource) | | Details ------- ### protected array extractFiles(string|array $resource) #### Parameters | | | | | --- | --- | --- | | string|array | $resource | Files, a file or a directory | #### Return Value | | | | --- | --- | | array | | ### protected bool isFile(string $file) #### Parameters | | | | | --- | --- | --- | | string | $file | | #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | | ### abstract protected bool canBeExtracted(string $file) #### Parameters | | | | | --- | --- | --- | | string | $file | | #### Return Value | | | | --- | --- | | bool | | ### abstract protected array extractFromDirectory(string|array $resource) #### Parameters | | | | | --- | --- | --- | | string|array | $resource | Files, a file or a directory | #### Return Value | | | | --- | --- | | array | files to be extracted | symfony PhpStringTokenParser PhpStringTokenParser ===================== class **PhpStringTokenParser** Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $replacements | | | Methods ------- | | | | | --- | --- | --- | | static string | [parse](#method_parse)(string $str) Parses a string token. | | | static string | [parseEscapeSequences](#method_parseEscapeSequences)(string $str, string|null $quote) Parses escape sequences in strings (all string types apart from single quoted). | | | static string | [parseDocString](#method_parseDocString)(string $startToken, string $str) Parses a constant doc string. | | Details ------- ### static string parse(string $str) Parses a string token. #### Parameters | | | | | --- | --- | --- | | string | $str | String token content | #### Return Value | | | | --- | --- | | string | The parsed string | ### static string parseEscapeSequences(string $str, string|null $quote) Parses escape sequences in strings (all string types apart from single quoted). #### Parameters | | | | | --- | --- | --- | | string | $str | String without quotes | | string|null | $quote | Quote type | #### Return Value | | | | --- | --- | | string | String with escape sequences parsed | ### static string parseDocString(string $startToken, string $str) Parses a constant doc string. #### Parameters | | | | | --- | --- | --- | | string | $startToken | Doc string start token content (<<<SMTHG) | | string | $str | String token content | #### Return Value | | | | --- | --- | | string | Parsed string | symfony ChainExtractor ChainExtractor =============== class **ChainExtractor** implements [ExtractorInterface](extractorinterface "Symfony\Component\Translation\Extractor\ExtractorInterface") ChainExtractor extracts translation messages from template files. Methods ------- | | | | | --- | --- | --- | | | [addExtractor](#method_addExtractor)(string $format, [ExtractorInterface](extractorinterface "Symfony\Component\Translation\Extractor\ExtractorInterface") $extractor) Adds a loader to the translation extractor. | | | | [setPrefix](#method_setPrefix)(string $prefix) Sets the prefix that should be used for new found messages. | | | | [extract](#method_extract)($directory, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Extracts translation messages from files, a file or a directory to the catalogue. | | Details ------- ### addExtractor(string $format, [ExtractorInterface](extractorinterface "Symfony\Component\Translation\Extractor\ExtractorInterface") $extractor) Adds a loader to the translation extractor. #### Parameters | | | | | --- | --- | --- | | string | $format | The format of the loader | | [ExtractorInterface](extractorinterface "Symfony\Component\Translation\Extractor\ExtractorInterface") | $extractor | The loader | ### setPrefix(string $prefix) Sets the prefix that should be used for new found messages. #### Parameters | | | | | --- | --- | --- | | string | $prefix | The prefix | ### extract($directory, [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue) Extracts translation messages from files, a file or a directory to the catalogue. #### Parameters | | | | | --- | --- | --- | | | $directory | | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalogue | The catalogue | symfony ChoiceMessageFormatterInterface ChoiceMessageFormatterInterface ================================ interface **ChoiceMessageFormatterInterface** Methods ------- | | | | | --- | --- | --- | | string | [choiceFormat](#method_choiceFormat)(string $message, int $number, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. | | Details ------- ### string choiceFormat(string $message, int $number, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. #### Parameters | | | | | --- | --- | --- | | string | $message | The message (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | string | $locale | The message locale | | array | $parameters | An array of parameters for the message | #### Return Value | | | | --- | --- | | string | | symfony MessageFormatterInterface MessageFormatterInterface ========================== interface **MessageFormatterInterface** Methods ------- | | | | | --- | --- | --- | | string | [format](#method_format)(string $message, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. | | Details ------- ### string format(string $message, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. #### Parameters | | | | | --- | --- | --- | | string | $message | The message (may also be an object that can be cast to string) | | string | $locale | The message locale | | array | $parameters | An array of parameters for the message | #### Return Value | | | | --- | --- | | string | | symfony MessageFormatter MessageFormatter ================= class **MessageFormatter** implements [MessageFormatterInterface](messageformatterinterface "Symfony\Component\Translation\Formatter\MessageFormatterInterface"), [ChoiceMessageFormatterInterface](choicemessageformatterinterface "Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([MessageSelector](../messageselector "Symfony\Component\Translation\MessageSelector") $selector = null) | | | string | [format](#method_format)(string $message, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. | | | string | [choiceFormat](#method_choiceFormat)(string $message, int $number, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. | | Details ------- ### \_\_construct([MessageSelector](../messageselector "Symfony\Component\Translation\MessageSelector") $selector = null) #### Parameters | | | | | --- | --- | --- | | [MessageSelector](../messageselector "Symfony\Component\Translation\MessageSelector") | $selector | The message selector for pluralization | ### string format(string $message, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. #### Parameters | | | | | --- | --- | --- | | string | $message | The message (may also be an object that can be cast to string) | | string | $locale | The message locale | | array | $parameters | An array of parameters for the message | #### Return Value | | | | --- | --- | | string | | ### string choiceFormat(string $message, int $number, string $locale, array $parameters = array()) Formats a localized message pattern with given arguments. #### Parameters | | | | | --- | --- | --- | | string | $message | The message (may also be an object that can be cast to string) | | int | $number | The number to use to find the indice of the message | | string | $locale | The message locale | | array | $parameters | An array of parameters for the message | #### Return Value | | | | --- | --- | | string | | symfony TranslationWriterInterface TranslationWriterInterface =========================== interface **TranslationWriterInterface** TranslationWriter writes translation messages. Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue, string $format, array $options = array()) Writes translation from the catalogue according to the selected format. | | Details ------- ### write([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue, string $format, array $options = array()) Writes translation from the catalogue according to the selected format. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalogue | The message catalogue to write | | string | $format | The format to use to dump the messages | | array | $options | Options that are passed to the dumper | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | | symfony TranslationWriter TranslationWriter ================== class **TranslationWriter** implements [TranslationWriterInterface](translationwriterinterface "Symfony\Component\Translation\Writer\TranslationWriterInterface") TranslationWriter writes translation messages. Methods ------- | | | | | --- | --- | --- | | | [addDumper](#method_addDumper)(string $format, [DumperInterface](../dumper/dumperinterface "Symfony\Component\Translation\Dumper\DumperInterface") $dumper) Adds a dumper to the writer. | | | | [disableBackup](#method_disableBackup)() deprecated Disables dumper backup. | | | array | [getFormats](#method_getFormats)() Obtains the list of supported formats. | | | | [write](#method_write)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue, string $format, array $options = array()) Writes translation from the catalogue according to the selected format. | | Details ------- ### addDumper(string $format, [DumperInterface](../dumper/dumperinterface "Symfony\Component\Translation\Dumper\DumperInterface") $dumper) Adds a dumper to the writer. #### Parameters | | | | | --- | --- | --- | | string | $format | The format of the dumper | | [DumperInterface](../dumper/dumperinterface "Symfony\Component\Translation\Dumper\DumperInterface") | $dumper | The dumper | ### disableBackup() deprecated deprecated | since | Symfony 4.1 | Disables dumper backup. ### array getFormats() Obtains the list of supported formats. #### Return Value | | | | --- | --- | | array | | ### write([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $catalogue, string $format, array $options = array()) Writes translation from the catalogue according to the selected format. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $catalogue | The message catalogue to write | | string | $format | The format to use to dump the messages | | array | $options | Options that are passed to the dumper | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Translation\Exception\InvalidArgumentException") | | symfony JsonFileLoader JsonFileLoader =============== class **JsonFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") JsonFileLoader loads translations from an json file. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | if stream content has an invalid format | symfony XliffFileLoader XliffFileLoader ================ class **XliffFileLoader** implements [LoaderInterface](loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") XliffFileLoader loads translations from XLIFF files. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded |
programming_docs
symfony QtFileLoader QtFileLoader ============= class **QtFileLoader** implements [LoaderInterface](loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") QtFileLoader loads translations from QT Translations XML files. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | symfony PhpFileLoader PhpFileLoader ============== class **PhpFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") PhpFileLoader loads translations from PHP files returning an array of translations. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | if stream content has an invalid format | symfony FileLoader FileLoader =========== abstract class **FileLoader** extends [ArrayLoader](arrayloader "Symfony\Component\Translation\Loader\ArrayLoader") Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | | array | [loadResource](#method_loadResource)(string $resource) | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### abstract protected array loadResource(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | if stream content has an invalid format | symfony IcuResFileLoader IcuResFileLoader ================= class **IcuResFileLoader** implements [LoaderInterface](loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") IcuResFileLoader loads translations from a resource bundle. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | | array | [flatten](#method_flatten)([ResourceBundle](http://php.net/ResourceBundle) $rb, array $messages = array(), string $path = null) Flattens an ResourceBundle. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array flatten([ResourceBundle](http://php.net/ResourceBundle) $rb, array $messages = array(), string $path = null) Flattens an ResourceBundle. The scheme used is: key { key2 { key3 { "value" } } } Becomes: 'key.key2.key3' => 'value' This function takes an array by reference and will modify it #### Parameters | | | | | --- | --- | --- | | [ResourceBundle](http://php.net/ResourceBundle) | $rb | The ResourceBundle that will be flattened | | array | $messages | Used internally for recursive calls | | string | $path | Current path being parsed, used internally for recursive calls | #### Return Value | | | | --- | --- | | array | the flattened ResourceBundle | symfony IcuDatFileLoader IcuDatFileLoader ================= class **IcuDatFileLoader** extends [IcuResFileLoader](icuresfileloader "Symfony\Component\Translation\Loader\IcuResFileLoader") IcuResFileLoader loads translations from a resource bundle. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | | array | [flatten](#method_flatten)([ResourceBundle](http://php.net/ResourceBundle) $rb, array $messages = array(), string $path = null) Flattens an ResourceBundle. | from [IcuResFileLoader](icuresfileloader#method_flatten "Symfony\Component\Translation\Loader\IcuResFileLoader") | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array flatten([ResourceBundle](http://php.net/ResourceBundle) $rb, array $messages = array(), string $path = null) Flattens an ResourceBundle. The scheme used is: key { key2 { key3 { "value" } } } Becomes: 'key.key2.key3' => 'value' This function takes an array by reference and will modify it #### Parameters | | | | | --- | --- | --- | | [ResourceBundle](http://php.net/ResourceBundle) | $rb | The ResourceBundle that will be flattened | | array | $messages | Used internally for recursive calls | | string | $path | Current path being parsed, used internally for recursive calls | #### Return Value | | | | --- | --- | | array | the flattened ResourceBundle | symfony IniFileLoader IniFileLoader ============== class **IniFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") IniFileLoader loads translations from an ini file. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | if stream content has an invalid format | symfony PoFileLoader PoFileLoader ============= class **PoFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) Parses portable object (PO) format. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) Parses portable object (PO) format. From http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files we should be able to parse files having: white-space translator-comments =================== . extracted-comments ==================== : reference... ============== , flag... ========= | msgid previous-untranslated-string ==================================== msgid untranslated-string msgstr translated-string extra or different lines are: | msgctxt previous-context ========================== | msgid previous-untranslated-string ==================================== msgctxt context | msgid previous-untranslated-string-singular ============================================= | msgid\_plural previous-untranslated-string-plural =================================================== msgid untranslated-string-singular msgid\_plural untranslated-string-plural msgstr[0] translated-string-case-0 ... msgstr[N] translated-string-case-n The definition states: - white-space and comments are optional. - msgid "" that an empty singleline defines a header. This parser sacrifices some features of the reference implementation the differences to that implementation are as follows. - No support for comments spanning multiple lines. - Translator and extracted comments are treated as being the same type. - Message IDs are allowed to have other encodings as just US-ASCII. Items with an empty id are ignored. {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | symfony CsvFileLoader CsvFileLoader ============== class **CsvFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") CsvFileLoader loads translations from CSV files. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) | | | | [setCsvControl](#method_setCsvControl)(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') Sets the delimiter, enclosure, and escape character for CSV. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | if stream content has an invalid format | ### setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') Sets the delimiter, enclosure, and escape character for CSV. #### Parameters | | | | | --- | --- | --- | | string | $delimiter | Delimiter character | | string | $enclosure | Enclosure character | | string | $escape | Escape character | symfony MoFileLoader MoFileLoader ============= class **MoFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") Constants --------- | | | | --- | --- | | MO\_LITTLE\_ENDIAN\_MAGIC | *Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was little endian.* | | MO\_BIG\_ENDIAN\_MAGIC | *Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was big endian.* | | MO\_HEADER\_SIZE | *The size of the header of a MO file in bytes.* | Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) Parses machine object (MO) format, independent of the machine's endian it was created on. Both 32bit and 64bit systems are supported. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) Parses machine object (MO) format, independent of the machine's endian it was created on. Both 32bit and 64bit systems are supported. {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony YamlFileLoader YamlFileLoader =============== class **YamlFileLoader** extends [FileLoader](fileloader "Symfony\Component\Translation\Loader\FileLoader") YamlFileLoader loads translations from Yaml files. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | from [FileLoader](fileloader#method_load "Symfony\Component\Translation\Loader\FileLoader") | | array | [loadResource](#method_loadResource)(string $resource) | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | ### protected array loadResource(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | if stream content has an invalid format | symfony LoaderInterface LoaderInterface ================ interface **LoaderInterface** LoaderInterface is the interface implemented by all translation loaders. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | symfony ArrayLoader ArrayLoader ============ class **ArrayLoader** implements [LoaderInterface](loaderinterface "Symfony\Component\Translation\Loader\LoaderInterface") ArrayLoader loads translations from a PHP array. Methods ------- | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | [load](#method_load)(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. | | Details ------- ### [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string | $locale | A locale | | string | $domain | The domain | #### Return Value | | | | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | A MessageCatalogue instance | #### Exceptions | | | | --- | --- | | [NotFoundResourceException](../exception/notfoundresourceexception "Symfony\Component\Translation\Exception\NotFoundResourceException") | when the resource cannot be found | | [InvalidResourceException](../exception/invalidresourceexception "Symfony\Component\Translation\Exception\InvalidResourceException") | when the resource cannot be loaded | symfony XliffLintCommand XliffLintCommand ================= class **XliffLintCommand** extends [Command](../../console/command/command "Symfony\Component\Console\Command\Command") Validates XLIFF files syntax and outputs encountered errors. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](../../console/command/command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](../../console/command/command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../../console/application "Symfony\Component\Console\Application") $application = null) | from [Command](../../console/command/command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](../../console/command/command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](../../console/command/command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../../console/application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](../../console/command/command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](../../console/command/command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](../../console/command/command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](../../console/command/command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](../../console/command/command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](../../console/command/command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](../../console/command/command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](../../console/command/command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](../../console/command/command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](../../console/command/command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](../../console/command/command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](../../console/command/command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](../../console/command/command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](../../console/command/command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](../../console/command/command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](../../console/command/command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](../../console/command/command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](../../console/command/command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](../../console/command/command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](../../console/command/command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](../../console/command/command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](../../console/command/command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](../../console/command/command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](../../console/command/command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](../../console/command/command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](../../console/command/command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](../../console/command/command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](../../console/command/command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the command; passing null means it must be set in configure() | | callable | $directoryIteratorProvider | | | callable | $isReadableProvider | | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../../console/application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../../console/application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../../console/input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../../console/input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](../../console/command/command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony OperationInterface OperationInterface =================== interface **OperationInterface** Represents an operation on catalogue(s). An instance of this interface performs an operation on one or more catalogues and stores intermediate and final results of the operation. The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and the following results are stored: Messages: also called 'all', are valid messages for the given domain after the operation is performed. New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}). Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}). Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'. Methods ------- | | | | | --- | --- | --- | | array | [getDomains](#method_getDomains)() Returns domains affected by operation. | | | array | [getMessages](#method_getMessages)(string $domain) Returns all valid messages ('all') after operation. | | | array | [getNewMessages](#method_getNewMessages)(string $domain) Returns new messages ('new') after operation. | | | array | [getObsoleteMessages](#method_getObsoleteMessages)(string $domain) Returns obsolete messages ('obsolete') after operation. | | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getResult](#method_getResult)() Returns resulting catalogue ('result'). | | Details ------- ### array getDomains() Returns domains affected by operation. #### Return Value | | | | --- | --- | | array | | ### array getMessages(string $domain) Returns all valid messages ('all') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getNewMessages(string $domain) Returns new messages ('new') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getObsoleteMessages(string $domain) Returns obsolete messages ('obsolete') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getResult() Returns resulting catalogue ('result'). #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | symfony TargetOperation TargetOperation ================ class **TargetOperation** extends [AbstractOperation](abstractoperation "Symfony\Component\Translation\Catalogue\AbstractOperation") Target operation between two catalogues: intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target} all = intersection ∪ (target ∖ intersection) = target new = all ∖ source = {x: x ∈ target ∧ x ∉ source} obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} Basically, the result contains messages from the target catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $source | | from [AbstractOperation](abstractoperation#property_source "Symfony\Component\Translation\Catalogue\AbstractOperation") | | protected | $target | | from [AbstractOperation](abstractoperation#property_target "Symfony\Component\Translation\Catalogue\AbstractOperation") | | protected | $result | | from [AbstractOperation](abstractoperation#property_result "Symfony\Component\Translation\Catalogue\AbstractOperation") | | protected array | $messages | This array stores 'all', 'new' and 'obsolete' messages for all valid domains. | from [AbstractOperation](abstractoperation#property_messages "Symfony\Component\Translation\Catalogue\AbstractOperation") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $source, [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $target) | from [AbstractOperation](abstractoperation#method___construct "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getDomains](#method_getDomains)() Returns domains affected by operation. | from [AbstractOperation](abstractoperation#method_getDomains "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getMessages](#method_getMessages)(string $domain) Returns all valid messages ('all') after operation. | from [AbstractOperation](abstractoperation#method_getMessages "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getNewMessages](#method_getNewMessages)(string $domain) Returns new messages ('new') after operation. | from [AbstractOperation](abstractoperation#method_getNewMessages "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getObsoleteMessages](#method_getObsoleteMessages)(string $domain) Returns obsolete messages ('obsolete') after operation. | from [AbstractOperation](abstractoperation#method_getObsoleteMessages "Symfony\Component\Translation\Catalogue\AbstractOperation") | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getResult](#method_getResult)() Returns resulting catalogue ('result'). | from [AbstractOperation](abstractoperation#method_getResult "Symfony\Component\Translation\Catalogue\AbstractOperation") | | | [processDomain](#method_processDomain)(string $domain) Performs operation on source and target catalogues for the given domain and stores the results. | | Details ------- ### \_\_construct([MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $source, [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $target) #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $source | | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $target | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Translation\Exception\LogicException") | | ### array getDomains() Returns domains affected by operation. #### Return Value | | | | --- | --- | | array | | ### array getMessages(string $domain) Returns all valid messages ('all') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getNewMessages(string $domain) Returns new messages ('new') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getObsoleteMessages(string $domain) Returns obsolete messages ('obsolete') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getResult() Returns resulting catalogue ('result'). #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | ### protected processDomain(string $domain) Performs operation on source and target catalogues for the given domain and stores the results. #### Parameters | | | | | --- | --- | --- | | string | $domain | The domain which the operation will be performed for | symfony MergeOperation MergeOperation =============== class **MergeOperation** extends [AbstractOperation](abstractoperation "Symfony\Component\Translation\Catalogue\AbstractOperation") Merge operation between two catalogues as follows: all = source ∪ target = {x: x ∈ source ∨ x ∈ target} new = all ∖ source = {x: x ∈ target ∧ x ∉ source} obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅ Basically, the result contains messages from both catalogues. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $source | | from [AbstractOperation](abstractoperation#property_source "Symfony\Component\Translation\Catalogue\AbstractOperation") | | protected | $target | | from [AbstractOperation](abstractoperation#property_target "Symfony\Component\Translation\Catalogue\AbstractOperation") | | protected | $result | | from [AbstractOperation](abstractoperation#property_result "Symfony\Component\Translation\Catalogue\AbstractOperation") | | protected array | $messages | This array stores 'all', 'new' and 'obsolete' messages for all valid domains. | from [AbstractOperation](abstractoperation#property_messages "Symfony\Component\Translation\Catalogue\AbstractOperation") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $source, [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $target) | from [AbstractOperation](abstractoperation#method___construct "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getDomains](#method_getDomains)() Returns domains affected by operation. | from [AbstractOperation](abstractoperation#method_getDomains "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getMessages](#method_getMessages)(string $domain) Returns all valid messages ('all') after operation. | from [AbstractOperation](abstractoperation#method_getMessages "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getNewMessages](#method_getNewMessages)(string $domain) Returns new messages ('new') after operation. | from [AbstractOperation](abstractoperation#method_getNewMessages "Symfony\Component\Translation\Catalogue\AbstractOperation") | | array | [getObsoleteMessages](#method_getObsoleteMessages)(string $domain) Returns obsolete messages ('obsolete') after operation. | from [AbstractOperation](abstractoperation#method_getObsoleteMessages "Symfony\Component\Translation\Catalogue\AbstractOperation") | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getResult](#method_getResult)() Returns resulting catalogue ('result'). | from [AbstractOperation](abstractoperation#method_getResult "Symfony\Component\Translation\Catalogue\AbstractOperation") | | | [processDomain](#method_processDomain)(string $domain) Performs operation on source and target catalogues for the given domain and stores the results. | | Details ------- ### \_\_construct([MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $source, [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $target) #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $source | | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $target | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Translation\Exception\LogicException") | | ### array getDomains() Returns domains affected by operation. #### Return Value | | | | --- | --- | | array | | ### array getMessages(string $domain) Returns all valid messages ('all') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getNewMessages(string $domain) Returns new messages ('new') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getObsoleteMessages(string $domain) Returns obsolete messages ('obsolete') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getResult() Returns resulting catalogue ('result'). #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | ### protected processDomain(string $domain) Performs operation on source and target catalogues for the given domain and stores the results. #### Parameters | | | | | --- | --- | --- | | string | $domain | The domain which the operation will be performed for | symfony AbstractOperation AbstractOperation ================== abstract class **AbstractOperation** implements [OperationInterface](operationinterface "Symfony\Component\Translation\Catalogue\OperationInterface") Base catalogues binary operation class. A catalogue binary operation performs operation on source (the left argument) and target (the right argument) catalogues. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $source | | | | protected | $target | | | | protected | $result | | | | protected array | $messages | This array stores 'all', 'new' and 'obsolete' messages for all valid domains. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $source, [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $target) | | | array | [getDomains](#method_getDomains)() Returns domains affected by operation. | | | array | [getMessages](#method_getMessages)(string $domain) Returns all valid messages ('all') after operation. | | | array | [getNewMessages](#method_getNewMessages)(string $domain) Returns new messages ('new') after operation. | | | array | [getObsoleteMessages](#method_getObsoleteMessages)(string $domain) Returns obsolete messages ('obsolete') after operation. | | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | [getResult](#method_getResult)() Returns resulting catalogue ('result'). | | | | [processDomain](#method_processDomain)(string $domain) Performs operation on source and target catalogues for the given domain and stores the results. | | Details ------- ### \_\_construct([MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $source, [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") $target) #### Parameters | | | | | --- | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $source | | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | $target | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Translation\Exception\LogicException") | | ### array getDomains() Returns domains affected by operation. #### Return Value | | | | --- | --- | | array | | ### array getMessages(string $domain) Returns all valid messages ('all') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getNewMessages(string $domain) Returns new messages ('new') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### array getObsoleteMessages(string $domain) Returns obsolete messages ('obsolete') after operation. #### Parameters | | | | | --- | --- | --- | | string | $domain | | #### Return Value | | | | --- | --- | | array | | ### [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") getResult() Returns resulting catalogue ('result'). #### Return Value | | | | --- | --- | | [MessageCatalogueInterface](../messagecatalogueinterface "Symfony\Component\Translation\MessageCatalogueInterface") | | ### abstract protected processDomain(string $domain) Performs operation on source and target catalogues for the given domain and stores the results. #### Parameters | | | | | --- | --- | --- | | string | $domain | The domain which the operation will be performed for | symfony TranslationDumperPass TranslationDumperPass ====================== class **TranslationDumperPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Adds tagged translation.formatter services to translation writer. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $writerServiceId = 'translation.writer', string $dumperTag = 'translation.dumper') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $writerServiceId = 'translation.writer', string $dumperTag = 'translation.dumper') #### Parameters | | | | | --- | --- | --- | | string | $writerServiceId | | | string | $dumperTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony TranslationExtractorPass TranslationExtractorPass ========================= class **TranslationExtractorPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Adds tagged translation.extractor services to translation extractor. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $extractorServiceId = 'translation.extractor', string $extractorTag = 'translation.extractor') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $extractorServiceId = 'translation.extractor', string $extractorTag = 'translation.extractor') #### Parameters | | | | | --- | --- | --- | | string | $extractorServiceId | | | string | $extractorTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | |
programming_docs
symfony TranslatorPass TranslatorPass =============== class **TranslatorPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation\_debug', string $updateCommandServiceId = 'console.command.translation\_update') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation\_debug', string $updateCommandServiceId = 'console.command.translation\_update') #### Parameters | | | | | --- | --- | --- | | string | $translatorServiceId | | | string | $readerServiceId | | | string | $loaderTag | | | string | $debugCommandServiceId | | | string | $updateCommandServiceId | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Translation\Exception\ExceptionInterface") Base InvalidArgumentException for the Translation component. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Exception interface for all exceptions thrown by the component. symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Translation\Exception\ExceptionInterface") Base LogicException for Translation component. symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Translation\Exception\ExceptionInterface") Base RuntimeException for the Translation component. symfony NotFoundResourceException NotFoundResourceException ========================== class **NotFoundResourceException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Translation\Exception\ExceptionInterface") Thrown when a resource does not exist. symfony InvalidResourceException InvalidResourceException ========================= class **InvalidResourceException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Translation\Exception\ExceptionInterface") Thrown when a resource cannot be loaded. symfony DumperInterface DumperInterface ================ interface **DumperInterface** DumperInterface is the interface implemented by all translation dumpers. There is no common option. Methods ------- | | | | | --- | --- | --- | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | | Details ------- ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | symfony YamlFileDumper YamlFileDumper =============== class **YamlFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") YamlFileDumper generates yaml files from a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | | | [\_\_construct](#method___construct)(string $extension = 'yml') | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | ### \_\_construct(string $extension = 'yml') #### Parameters | | | | | --- | --- | --- | | string | $extension | | symfony MoFileDumper MoFileDumper ============= class **MoFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") MoFileDumper generates a gettext formatted string representation of a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony CsvFileDumper CsvFileDumper ============== class **CsvFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") CsvFileDumper generates a csv formatted string representation of a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | | | [setCsvControl](#method_setCsvControl)(string $delimiter = ';', string $enclosure = '"') Sets the delimiter and escape character for CSV. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | ### setCsvControl(string $delimiter = ';', string $enclosure = '"') Sets the delimiter and escape character for CSV. #### Parameters | | | | | --- | --- | --- | | string | $delimiter | Delimiter character | | string | $enclosure | Enclosure character | symfony PoFileDumper PoFileDumper ============= class **PoFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") PoFileDumper generates a gettext formatted string representation of a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony IniFileDumper IniFileDumper ============== class **IniFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") IniFileDumper generates an ini formatted string representation of a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension |
programming_docs
symfony FileDumper FileDumper =========== abstract class **FileDumper** implements [DumperInterface](dumperinterface "Symfony\Component\Translation\Dumper\DumperInterface") FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). Options: - path (mandatory): the directory where the files should be saved Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### abstract string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### abstract protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony IcuResFileDumper IcuResFileDumper ================= class **IcuResFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $relativePathTemplate | {@inheritdoc} | | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony PhpFileDumper PhpFileDumper ============== class **PhpFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") PhpFileDumper generates PHP files from a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony QtFileDumper QtFileDumper ============= class **QtFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") QtFileDumper generates ts files from a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony XliffFileDumper XliffFileDumper ================ class **XliffFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") XliffFileDumper generates xliff files from a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony JsonFileDumper JsonFileDumper =============== class **JsonFileDumper** extends [FileDumper](filedumper "Symfony\Component\Translation\Dumper\FileDumper") JsonFileDumper generates an json formatted string representation of a message catalogue. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $relativePathTemplate | A template for the relative paths to files. | from [FileDumper](filedumper#property_relativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | Methods ------- | | | | | --- | --- | --- | | | [setRelativePathTemplate](#method_setRelativePathTemplate)(string $relativePathTemplate) Sets the template for the relative paths to files. | from [FileDumper](filedumper#method_setRelativePathTemplate "Symfony\Component\Translation\Dumper\FileDumper") | | | [setBackup](#method_setBackup)(bool $backup) deprecated Sets backup flag. | from [FileDumper](filedumper#method_setBackup "Symfony\Component\Translation\Dumper\FileDumper") | | | [dump](#method_dump)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. | from [FileDumper](filedumper#method_dump "Symfony\Component\Translation\Dumper\FileDumper") | | string | [formatCatalogue](#method_formatCatalogue)([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. | | | string | [getExtension](#method_getExtension)() Gets the file extension of the dumper. | | Details ------- ### setRelativePathTemplate(string $relativePathTemplate) Sets the template for the relative paths to files. #### Parameters | | | | | --- | --- | --- | | string | $relativePathTemplate | A template for the relative paths to files | ### setBackup(bool $backup) deprecated deprecated | since | Symfony 4.1 | Sets backup flag. #### Parameters | | | | | --- | --- | --- | | bool | $backup | | ### dump([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, array $options = array()) Dumps the message catalogue. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | The message catalogue | | array | $options | Options that are used by the dumper | ### string formatCatalogue([MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") $messages, string $domain, array $options = array()) Transforms a domain of a message catalogue to its string representation. #### Parameters | | | | | --- | --- | --- | | [MessageCatalogue](../messagecatalogue "Symfony\Component\Translation\MessageCatalogue") | $messages | | | string | $domain | | | array | $options | | #### Return Value | | | | --- | --- | | string | representation | ### protected string getExtension() Gets the file extension of the dumper. #### Return Value | | | | --- | --- | | string | file extension | symfony ConfigCacheFactoryInterface ConfigCacheFactoryInterface ============================ interface **ConfigCacheFactoryInterface** Interface for a ConfigCache factory. This factory creates an instance of ConfigCacheInterface and initializes the cache if necessary. Methods ------- | | | | | --- | --- | --- | | [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") | [cache](#method_cache)(string $file, callable $callable) Creates a cache instance and (re-)initializes it if necessary. | | Details ------- ### [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") cache(string $file, callable $callable) Creates a cache instance and (re-)initializes it if necessary. #### Parameters | | | | | --- | --- | --- | | string | $file | The absolute cache file path | | callable | $callable | The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback | #### Return Value | | | | --- | --- | | [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") | $configCache The cache instance |
programming_docs
symfony Symfony\Component\Config\Definition Symfony\Component\Config\Definition =================================== Namespaces ---------- [Symfony\Component\Config\Definition\Builder](definition/builder)[Symfony\Component\Config\Definition\Dumper](definition/dumper)[Symfony\Component\Config\Definition\Exception](definition/exception) Classes ------- | | | | --- | --- | | [ArrayNode](definition/arraynode "Symfony\Component\Config\Definition\ArrayNode") | Represents an Array node in the config tree. | | [BaseNode](definition/basenode "Symfony\Component\Config\Definition\BaseNode") | The base node class. | | [BooleanNode](definition/booleannode "Symfony\Component\Config\Definition\BooleanNode") | This node represents a Boolean value in the config tree. | | [EnumNode](definition/enumnode "Symfony\Component\Config\Definition\EnumNode") | Node which only allows a finite set of values. | | [FloatNode](definition/floatnode "Symfony\Component\Config\Definition\FloatNode") | This node represents a float value in the config tree. | | [IntegerNode](definition/integernode "Symfony\Component\Config\Definition\IntegerNode") | This node represents an integer value in the config tree. | | [NumericNode](definition/numericnode "Symfony\Component\Config\Definition\NumericNode") | This node represents a numeric value in the config tree. | | [Processor](definition/processor "Symfony\Component\Config\Definition\Processor") | This class is the entry point for config normalization/merging/finalization. | | [PrototypedArrayNode](definition/prototypedarraynode "Symfony\Component\Config\Definition\PrototypedArrayNode") | Represents a prototyped Array node in the config tree. | | [ScalarNode](definition/scalarnode "Symfony\Component\Config\Definition\ScalarNode") | This node represents a scalar value in the config tree. | | [VariableNode](definition/variablenode "Symfony\Component\Config\Definition\VariableNode") | This node represents a value of variable type in the config tree. | Interfaces ---------- | | | | --- | --- | | *[ConfigurationInterface](definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")* | Configuration interface. | | *[NodeInterface](definition/nodeinterface "Symfony\Component\Config\Definition\NodeInterface")* | Common Interface among all nodes. | | *[PrototypeNodeInterface](definition/prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface")* | This interface must be implemented by nodes which can be used as prototypes. | symfony Symfony\Component\Config\Util Symfony\Component\Config\Util ============================= Namespaces ---------- [Symfony\Component\Config\Util\Exception](util/exception) Classes ------- | | | | --- | --- | | [XmlUtils](util/xmlutils "Symfony\Component\Config\Util\XmlUtils") | XMLUtils is a bunch of utility methods to XML operations. | symfony ConfigCache ConfigCache ============ class **ConfigCache** extends [ResourceCheckerConfigCache](resourcecheckerconfigcache "Symfony\Component\Config\ResourceCheckerConfigCache") ConfigCache caches arbitrary content in files on disk. When in debug mode, those metadata resources that implement \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will be used to check cache freshness. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $file, bool $debug) | | | string | [getPath](#method_getPath)() Gets the cache file path. | from [ResourceCheckerConfigCache](resourcecheckerconfigcache#method_getPath "Symfony\Component\Config\ResourceCheckerConfigCache") | | bool | [isFresh](#method_isFresh)() Checks if the cache is still fresh. | | | | [write](#method_write)(string $content, array $metadata = null) Writes cache. | from [ResourceCheckerConfigCache](resourcecheckerconfigcache#method_write "Symfony\Component\Config\ResourceCheckerConfigCache") | Details ------- ### \_\_construct(string $file, bool $debug) #### Parameters | | | | | --- | --- | --- | | string | $file | The absolute cache path | | bool | $debug | Whether debugging is enabled or not | ### string getPath() Gets the cache file path. #### Return Value | | | | --- | --- | | string | The cache file path | ### bool isFresh() Checks if the cache is still fresh. This implementation always returns true when debug is off and the cache file exists. #### Return Value | | | | --- | --- | | bool | Whether the cache is still fresh | ### write(string $content, array $metadata = null) Writes cache. #### Parameters | | | | | --- | --- | --- | | string | $content | The content to write into the cache | | array | $metadata | An array of ResourceInterface instances | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When cache file can't be written | symfony Symfony\Component\Config\Exception Symfony\Component\Config\Exception ================================== Classes ------- | | | | --- | --- | | [FileLocatorFileNotFoundException](exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | File locator exception if a file does not exist. | Exceptions ---------- | | | | --- | --- | | [FileLoaderImportCircularReferenceException](exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | Exception class for when a circular reference is detected when importing resources. | | [FileLoaderLoadException](exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | Exception class for when a resource cannot be loaded or imported. | symfony ConfigCacheFactory ConfigCacheFactory =================== class **ConfigCacheFactory** implements [ConfigCacheFactoryInterface](configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") Basic implementation of ConfigCacheFactoryInterface that creates an instance of the default ConfigCache. This factory and/or cache *do not* support cache validation by means of ResourceChecker instances (that is, service-based). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool $debug) | | | [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") | [cache](#method_cache)(string $file, $callback) Creates a cache instance and (re-)initializes it if necessary. | | Details ------- ### \_\_construct(bool $debug) #### Parameters | | | | | --- | --- | --- | | bool | $debug | The debug flag to pass to ConfigCache | ### [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") cache(string $file, $callback) Creates a cache instance and (re-)initializes it if necessary. #### Parameters | | | | | --- | --- | --- | | string | $file | The absolute cache file path | | | $callback | | #### Return Value | | | | --- | --- | | [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") | $configCache The cache instance | symfony Symfony\Component\Config\Loader Symfony\Component\Config\Loader =============================== Classes ------- | | | | --- | --- | | [DelegatingLoader](loader/delegatingloader "Symfony\Component\Config\Loader\DelegatingLoader") | DelegatingLoader delegates loading to other loaders using a loader resolver. | | [FileLoader](loader/fileloader "Symfony\Component\Config\Loader\FileLoader") | FileLoader is the abstract class used by all built-in loaders that are file based. | | [GlobFileLoader](loader/globfileloader "Symfony\Component\Config\Loader\GlobFileLoader") | GlobFileLoader loads files from a glob pattern. | | [Loader](loader/loader "Symfony\Component\Config\Loader\Loader") | Loader is the abstract class used by all built-in loaders. | | [LoaderResolver](loader/loaderresolver "Symfony\Component\Config\Loader\LoaderResolver") | LoaderResolver selects a loader for a given resource. | Interfaces ---------- | | | | --- | --- | | *[LoaderInterface](loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")* | LoaderInterface is the interface implemented by all loader classes. | | *[LoaderResolverInterface](loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface")* | LoaderResolverInterface selects a loader for a given resource. | symfony Symfony\Component\Config\Resource Symfony\Component\Config\Resource ================================= Classes ------- | | | | --- | --- | | [ClassExistenceResource](resource/classexistenceresource "Symfony\Component\Config\Resource\ClassExistenceResource") | ClassExistenceResource represents a class existence. | | [ComposerResource](resource/composerresource "Symfony\Component\Config\Resource\ComposerResource") | ComposerResource tracks the PHP version and Composer dependencies. | | [DirectoryResource](resource/directoryresource "Symfony\Component\Config\Resource\DirectoryResource") | DirectoryResource represents a resources stored in a subdirectory tree. | | [FileExistenceResource](resource/fileexistenceresource "Symfony\Component\Config\Resource\FileExistenceResource") | FileExistenceResource represents a resource stored on the filesystem. | | [FileResource](resource/fileresource "Symfony\Component\Config\Resource\FileResource") | FileResource represents a resource stored on the filesystem. | | [GlobResource](resource/globresource "Symfony\Component\Config\Resource\GlobResource") | GlobResource represents a set of resources stored on the filesystem. | | [ReflectionClassResource](resource/reflectionclassresource "Symfony\Component\Config\Resource\ReflectionClassResource") | | | [SelfCheckingResourceChecker](resource/selfcheckingresourcechecker "Symfony\Component\Config\Resource\SelfCheckingResourceChecker") | Resource checker for instances of SelfCheckingResourceInterface. | Interfaces ---------- | | | | --- | --- | | *[ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")* | ResourceInterface is the interface that must be implemented by all Resource classes. | | *[SelfCheckingResourceInterface](resource/selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface")* | Interface for Resources that can check for freshness autonomously, without special support from external services. | symfony ResourceCheckerInterface ResourceCheckerInterface ========================= interface **ResourceCheckerInterface** Interface for ResourceCheckers. When a ResourceCheckerConfigCache instance is checked for freshness, all its associated metadata resources are passed to ResourceCheckers. The ResourceCheckers can then inspect the resources and decide whether the cache can be considered fresh or not. Methods ------- | | | | | --- | --- | --- | | bool | [supports](#method_supports)([ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $metadata) Queries the ResourceChecker whether it can validate a given resource or not. | | | bool | [isFresh](#method_isFresh)([ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource, int $timestamp) Validates the resource. | | Details ------- ### bool supports([ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $metadata) Queries the ResourceChecker whether it can validate a given resource or not. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $metadata | The resource to be checked for freshness | #### Return Value | | | | --- | --- | | bool | True if the ResourceChecker can handle this resource type, false if not | ### bool isFresh([ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource, int $timestamp) Validates the resource. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | The resource to be validated | | int | $timestamp | The timestamp at which the cache associated with this resource was created | #### Return Value | | | | --- | --- | | bool | True if the resource has not changed since the given timestamp, false otherwise | symfony ResourceCheckerConfigCache ResourceCheckerConfigCache =========================== class **ResourceCheckerConfigCache** implements [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") ResourceCheckerConfigCache uses instances of ResourceCheckerInterface to check whether cached data is still fresh. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $file, iterable $resourceCheckers = array()) | | | string | [getPath](#method_getPath)() Gets the cache file path. | | | bool | [isFresh](#method_isFresh)() Checks if the cache is still fresh. | | | | [write](#method_write)(string $content, array $metadata = null) Writes cache. | | Details ------- ### \_\_construct(string $file, iterable $resourceCheckers = array()) #### Parameters | | | | | --- | --- | --- | | string | $file | The absolute cache path | | iterable | $resourceCheckers | The ResourceCheckers to use for the freshness check | ### string getPath() Gets the cache file path. #### Return Value | | | | --- | --- | | string | The cache file path | ### bool isFresh() Checks if the cache is still fresh. This implementation will make a decision solely based on the ResourceCheckers passed in the constructor. The first ResourceChecker that supports a given resource is considered authoritative. Resources with no matching ResourceChecker will silently be ignored and considered fresh. #### Return Value | | | | --- | --- | | bool | Whether the cache is still fresh | ### write(string $content, array $metadata = null) Writes cache. #### Parameters | | | | | --- | --- | --- | | string | $content | The content to write into the cache | | array | $metadata | An array of ResourceInterface instances | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When cache file can't be written | symfony ConfigCacheInterface ConfigCacheInterface ===================== interface **ConfigCacheInterface** Interface for ConfigCache. Methods ------- | | | | | --- | --- | --- | | string | [getPath](#method_getPath)() Gets the cache file path. | | | bool | [isFresh](#method_isFresh)() Checks if the cache is still fresh. | | | | [write](#method_write)(string $content, array $metadata = null) Writes the given content into the cache file. Metadata will be stored independently and can be used to check cache freshness at a later time. | | Details ------- ### string getPath() Gets the cache file path. #### Return Value | | | | --- | --- | | string | The cache file path | ### bool isFresh() Checks if the cache is still fresh. This check should take the metadata passed to the write() method into consideration. #### Return Value | | | | --- | --- | | bool | Whether the cache is still fresh | ### write(string $content, array $metadata = null) Writes the given content into the cache file. Metadata will be stored independently and can be used to check cache freshness at a later time. #### Parameters | | | | | --- | --- | --- | | string | $content | The content to write into the cache | | array | $metadata | An array of ResourceInterface instances | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the cache file cannot be written | symfony FileLocator FileLocator ============ class **FileLocator** implements [FileLocatorInterface](filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") FileLocator uses an array of pre-defined paths to find files. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $paths | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|string[] $paths = array()) | | | string|array | [locate](#method_locate)(string $name, string|null $currentPath = null, bool $first = true) Returns a full path for a given file name. | | Details ------- ### \_\_construct(string|string[] $paths = array()) #### Parameters | | | | | --- | --- | --- | | string|string[] | $paths | A path or an array of paths where to look for resources | ### string|array locate(string $name, string|null $currentPath = null, bool $first = true) Returns a full path for a given file name. #### Parameters | | | | | --- | --- | --- | | string | $name | The file name to locate | | string|null | $currentPath | The current path | | bool | $first | Whether to return the first occurrence or an array of filenames | #### Return Value | | | | --- | --- | | string|array | The full path to the file or an array of file paths | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If $name is empty | | [FileLocatorFileNotFoundException](exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | If a file is not found | symfony ResourceCheckerConfigCacheFactory ResourceCheckerConfigCacheFactory ================================== class **ResourceCheckerConfigCacheFactory** implements [ConfigCacheFactoryInterface](configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") A ConfigCacheFactory implementation that validates the cache with an arbitrary set of ResourceCheckers. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $resourceCheckers = array()) | | | [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") | [cache](#method_cache)(string $file, $callback) Creates a cache instance and (re-)initializes it if necessary. | | Details ------- ### \_\_construct(iterable $resourceCheckers = array()) #### Parameters | | | | | --- | --- | --- | | iterable | $resourceCheckers | | ### [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") cache(string $file, $callback) Creates a cache instance and (re-)initializes it if necessary. #### Parameters | | | | | --- | --- | --- | | string | $file | The absolute cache file path | | | $callback | | #### Return Value | | | | --- | --- | | [ConfigCacheInterface](configcacheinterface "Symfony\Component\Config\ConfigCacheInterface") | $configCache The cache instance | symfony FileLocatorInterface FileLocatorInterface ===================== interface **FileLocatorInterface** Methods ------- | | | | | --- | --- | --- | | string|array | [locate](#method_locate)(string $name, string|null $currentPath = null, bool $first = true) Returns a full path for a given file name. | | Details ------- ### string|array locate(string $name, string|null $currentPath = null, bool $first = true) Returns a full path for a given file name. #### Parameters | | | | | --- | --- | --- | | string | $name | The file name to locate | | string|null | $currentPath | The current path | | bool | $first | Whether to return the first occurrence or an array of filenames | #### Return Value | | | | --- | --- | | string|array | The full path to the file or an array of file paths | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If $name is empty | | [FileLocatorFileNotFoundException](exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | If a file is not found |
programming_docs
symfony Symfony\Component\Config\Util\Exception Symfony\Component\Config\Util\Exception ======================================= Classes ------- | | | | --- | --- | | [InvalidXmlException](exception/invalidxmlexception "Symfony\Component\Config\Util\Exception\InvalidXmlException") | Exception class for when XML parsing with an XSD schema file path or a callable validator produces errors unrelated to the actual XML parsing. | | [XmlParsingException](exception/xmlparsingexception "Symfony\Component\Config\Util\Exception\XmlParsingException") | Exception class for when XML cannot be parsed properly. | symfony XmlUtils XmlUtils ========= class **XmlUtils** XMLUtils is a bunch of utility methods to XML operations. This class contains static methods only and is not meant to be instantiated. Methods ------- | | | | | --- | --- | --- | | static [DOMDocument](http://php.net/DOMDocument) | [parse](#method_parse)(string $content, string|callable|null $schemaOrCallable = null) Parses an XML string. | | | static [DOMDocument](http://php.net/DOMDocument) | [loadFile](#method_loadFile)(string $file, string|callable|null $schemaOrCallable = null) Loads an XML file. | | | static array | [convertDomElementToArray](#method_convertDomElementToArray)([DOMElement](http://php.net/DOMElement) $element, bool $checkPrefix = true) Converts a \DOMElement object to a PHP array. | | | static mixed | [phpize](#method_phpize)(mixed $value) Converts an xml value to a PHP type. | | | static | [getXmlErrors](#method_getXmlErrors)($internalErrors) | | Details ------- ### static [DOMDocument](http://php.net/DOMDocument) parse(string $content, string|callable|null $schemaOrCallable = null) Parses an XML string. #### Parameters | | | | | --- | --- | --- | | string | $content | An XML string | | string|callable|null | $schemaOrCallable | An XSD schema file path, a callable, or null to disable validation | #### Return Value | | | | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | | #### Exceptions | | | | --- | --- | | [XmlParsingException](exception/xmlparsingexception "Symfony\Component\Config\Util\Exception\XmlParsingException") | When parsing of XML file returns error | | [InvalidXmlException](exception/invalidxmlexception "Symfony\Component\Config\Util\Exception\InvalidXmlException") | When parsing of XML with schema or callable produces any errors unrelated to the XML parsing itself | | [RuntimeException](http://php.net/RuntimeException) | When DOM extension is missing | ### static [DOMDocument](http://php.net/DOMDocument) loadFile(string $file, string|callable|null $schemaOrCallable = null) Loads an XML file. #### Parameters | | | | | --- | --- | --- | | string | $file | An XML file path | | string|callable|null | $schemaOrCallable | An XSD schema file path, a callable, or null to disable validation | #### Return Value | | | | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When loading of XML file returns error | | [XmlParsingException](exception/xmlparsingexception "Symfony\Component\Config\Util\Exception\XmlParsingException") | When XML parsing returns any errors | | [RuntimeException](http://php.net/RuntimeException) | When DOM extension is missing | ### static array convertDomElementToArray([DOMElement](http://php.net/DOMElement) $element, bool $checkPrefix = true) Converts a \DOMElement object to a PHP array. The following rules applies during the conversion: * Each tag is converted to a key value or an array if there is more than one "value" * The content of a tag is set under a "value" key (bar) if the tag also has some nested tags * The attributes are converted to keys () * The nested-tags are converted to keys (bar) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $element | A \DOMElement instance | | bool | $checkPrefix | Check prefix in an element or an attribute name | #### Return Value | | | | --- | --- | | array | A PHP array | ### static mixed phpize(mixed $value) Converts an xml value to a PHP type. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### static protected getXmlErrors($internalErrors) #### Parameters | | | | | --- | --- | --- | | | $internalErrors | | symfony XmlParsingException XmlParsingException ==================== class **XmlParsingException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) Exception class for when XML cannot be parsed properly. symfony InvalidXmlException InvalidXmlException ==================== class **InvalidXmlException** extends [XmlParsingException](xmlparsingexception "Symfony\Component\Config\Util\Exception\XmlParsingException") Exception class for when XML parsing with an XSD schema file path or a callable validator produces errors unrelated to the actual XML parsing. symfony LoaderResolver LoaderResolver =============== class **LoaderResolver** implements [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") LoaderResolver selects a loader for a given resource. A resource can be anything (e.g. a full path to a config file or a Closure). Each loader determines whether it can load a resource and how. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $loaders = array()) | | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")|false | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Returns a loader able to load the resource. | | | | [addLoader](#method_addLoader)([LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") $loader) | | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")[] | [getLoaders](#method_getLoaders)() Returns the registered loaders. | | Details ------- ### \_\_construct(array $loaders = array()) #### Parameters | | | | | --- | --- | --- | | array | $loaders | An array of loaders | ### [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")|false resolve(mixed $resource, string|null $type = null) Returns a loader able to load the resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")|false | The loader or false if none is able to load the resource | ### addLoader([LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") $loader) #### Parameters | | | | | --- | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | $loader | | ### [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")[] getLoaders() Returns the registered loaders. #### Return Value | | | | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")[] | An array of LoaderInterface instances | symfony LoaderResolverInterface LoaderResolverInterface ======================== interface **LoaderResolverInterface** LoaderResolverInterface selects a loader for a given resource. Methods ------- | | | | | --- | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")|false | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Returns a loader able to load the resource. | | Details ------- ### [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")|false resolve(mixed $resource, string|null $type = null) Returns a loader able to load the resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface")|false | The loader or false if none is able to load the resource | symfony FileLoader FileLoader =========== abstract class **FileLoader** extends [Loader](loader "Symfony\Component\Config\Loader\Loader") FileLoader is the abstract class used by all built-in loaders that are file based. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | | | protected | $locator | | | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | | | [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | | Details ------- ### [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | symfony Loader Loader ======= abstract class **Loader** implements [LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") Loader is the abstract class used by all built-in loaders. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | | | | [setResolver](#method_setResolver)([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | | | mixed | [import](#method_import)(mixed $resource, string|null $type = null) Imports a resource. | | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | | Details ------- ### [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | mixed | | ### $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | symfony DelegatingLoader DelegatingLoader ================= class **DelegatingLoader** extends [Loader](loader "Symfony\Component\Config\Loader\Loader") DelegatingLoader delegates loading to other loaders using a loader resolver. This loader acts as an array of LoaderInterface objects - each having a chance to load a given resource (handled by the resolver) Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](loader#property_resolver "Symfony\Component\Config\Loader\Loader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null) Imports a resource. | from [Loader](loader#method_import "Symfony\Component\Config\Loader\Loader") | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) | | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | mixed | | ### $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise |
programming_docs
symfony GlobFileLoader GlobFileLoader =============== class **GlobFileLoader** extends [FileLoader](fileloader "Symfony\Component\Config\Loader\FileLoader") GlobFileLoader loads files from a glob pattern. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony LoaderInterface LoaderInterface ================ interface **LoaderInterface** LoaderInterface is the interface implemented by all loader classes. Methods ------- | | | | | --- | --- | --- | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | | | | [setResolver](#method_setResolver)([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | | Details ------- ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | symfony VariableNode VariableNode ============= class **VariableNode** extends [BaseNode](basenode "Symfony\Component\Config\Definition\BaseNode") implements [PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") This node represents a value of variable type in the config tree. This node is intended for values of arbitrary type. Any PHP type is accepted as a value. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | | | protected | $defaultValue | | | | protected | $allowEmptyValue | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) | from [BaseNode](basenode#method___construct "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [BaseNode](basenode#method_allowPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | from [BaseNode](basenode#method_getValidPlaceholderTypes "Symfony\Component\Config\Definition\BaseNode") | | | [setDefaultValue](#method_setDefaultValue)($value) | | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | | | | [setName](#method_setName)(string $name) Sets the name of the node. | | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony ConfigurationInterface ConfigurationInterface ======================= interface **ConfigurationInterface** Configuration interface. Methods ------- | | | | | --- | --- | --- | | [TreeBuilder](builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") | [getConfigTreeBuilder](#method_getConfigTreeBuilder)() Generates the configuration tree builder. | | Details ------- ### [TreeBuilder](builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") getConfigTreeBuilder() Generates the configuration tree builder. #### Return Value | | | | --- | --- | | [TreeBuilder](builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") | The tree builder | symfony Symfony\Component\Config\Definition\Builder Symfony\Component\Config\Definition\Builder =========================================== Classes ------- | | | | --- | --- | | [ArrayNodeDefinition](builder/arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") | This class provides a fluent interface for defining an array node. | | [BooleanNodeDefinition](builder/booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") | This class provides a fluent interface for defining a node. | | [EnumNodeDefinition](builder/enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") | Enum Node Definition. | | [ExprBuilder](builder/exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | This class builds an if expression. | | [FloatNodeDefinition](builder/floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") | This class provides a fluent interface for defining a float node. | | [IntegerNodeDefinition](builder/integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") | This class provides a fluent interface for defining an integer node. | | [MergeBuilder](builder/mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | This class builds merge conditions. | | [NodeBuilder](builder/nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | This class provides a fluent interface for building a node. | | [NodeDefinition](builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | This class provides a fluent interface for defining a node. | | [NormalizationBuilder](builder/normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | This class builds normalization conditions. | | [NumericNodeDefinition](builder/numericnodedefinition "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | Abstract class that contains common code of integer and float node definitions. | | [ScalarNodeDefinition](builder/scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") | This class provides a fluent interface for defining a node. | | [TreeBuilder](builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") | This is the entry class for building a config tree. | | [ValidationBuilder](builder/validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | This class builds validation conditions. | | [VariableNodeDefinition](builder/variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | This class provides a fluent interface for defining a node. | Interfaces ---------- | | | | --- | --- | | *[BuilderAwareInterface](builder/builderawareinterface "Symfony\Component\Config\Definition\Builder\BuilderAwareInterface")* | An interface that can be implemented by nodes which build other nodes. | | *[NodeParentInterface](builder/nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")* | An interface that must be implemented by all node parents. | | *[ParentNodeDefinitionInterface](builder/parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface")* | An interface that must be implemented by nodes which can have children. | symfony Symfony\Component\Config\Definition\Exception Symfony\Component\Config\Definition\Exception ============================================= Classes ------- | | | | --- | --- | | [DuplicateKeyException](exception/duplicatekeyexception "Symfony\Component\Config\Definition\Exception\DuplicateKeyException") | This exception is thrown whenever the key of an array is not unique. This can only be the case if the configuration is coming from an XML file. | | [Exception](exception/exception "Symfony\Component\Config\Definition\Exception\Exception") | Base exception for all configuration exceptions. | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | This exception is thrown when a configuration path is overwritten from a subsequent configuration file, but the entry node specifically forbids this. | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | A very general exception which can be thrown whenever non of the more specific exceptions is suitable. | | [InvalidDefinitionException](exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | Thrown when an error is detected in a node Definition. | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | This exception is thrown if an invalid type is encountered. | | [TreeWithoutRootNodeException](exception/treewithoutrootnodeexception "Symfony\Component\Config\Definition\Exception\TreeWithoutRootNodeException") | | | [UnsetKeyException](exception/unsetkeyexception "Symfony\Component\Config\Definition\Exception\UnsetKeyException") | This exception is usually not encountered by the end-user, but only used internally to signal the parent scope to unset a key. | symfony ScalarNode ScalarNode =========== class **ScalarNode** extends [VariableNode](variablenode "Symfony\Component\Config\Definition\VariableNode") This node represents a scalar value in the config tree. The following values are considered scalars: \* booleans \* strings \* null \* integers \* floats Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | from [VariableNode](variablenode#property_defaultValueSet "Symfony\Component\Config\Definition\VariableNode") | | protected | $defaultValue | | from [VariableNode](variablenode#property_defaultValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $allowEmptyValue | | from [VariableNode](variablenode#property_allowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) | from [BaseNode](basenode#method___construct "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | from [VariableNode](variablenode#method_normalizeValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [VariableNode](variablenode#method_mergeValues "Symfony\Component\Config\Definition\VariableNode") | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | from [VariableNode](variablenode#method_finalizeValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [BaseNode](basenode#method_allowPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | | | | [setDefaultValue](#method_setDefaultValue)($value) | from [VariableNode](variablenode#method_setDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [VariableNode](variablenode#method_hasDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [VariableNode](variablenode#method_getDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | from [VariableNode](variablenode#method_setAllowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [VariableNode](variablenode#method_setName "Symfony\Component\Config\Definition\VariableNode") | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony BaseNode BaseNode ========= abstract class **BaseNode** implements [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") The base node class. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | | | protected | $parent | | | | protected | $normalizationClosures | | | | protected | $finalValidationClosures | | | | protected | $allowOverwrite | | | | protected | $required | | | | protected | $deprecationMessage | | | | protected | $equivalentValues | | | | protected | $attributes | | | | protected | $pathSeparator | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) | | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | | | | [setAttribute](#method_setAttribute)($key, $value) | | | | [getAttribute](#method_getAttribute)($key, $default = null) | | | | [hasAttribute](#method_hasAttribute)($key) | | | | [getAttributes](#method_getAttributes)() | | | | [setAttributes](#method_setAttributes)(array $attributes) | | | | [removeAttribute](#method_removeAttribute)($key) | | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | | | string | [getInfo](#method_getInfo)() Returns info message. | | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | | | string | [getName](#method_getName)() Returns the name of the node. | | | string | [getPath](#method_getPath)() Returns the path of the node. | | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### abstract protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### abstract protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### abstract protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### abstract protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | symfony Processor Processor ========== class **Processor** This class is the entry point for config normalization/merging/finalization. Methods ------- | | | | | --- | --- | --- | | array | [process](#method_process)([NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $configTree, array $configs) Processes an array of configurations. | | | array | [processConfiguration](#method_processConfiguration)([ConfigurationInterface](configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, array $configs) Processes an array of configurations. | | | static array | [normalizeConfig](#method_normalizeConfig)(array $config, string $key, string $plural = null) Normalizes a configuration entry. | | Details ------- ### array process([NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $configTree, array $configs) Processes an array of configurations. #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $configTree | The node tree describing the configuration | | array | $configs | An array of configuration items to process | #### Return Value | | | | --- | --- | | array | The processed configuration | ### array processConfiguration([ConfigurationInterface](configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, array $configs) Processes an array of configurations. #### Parameters | | | | | --- | --- | --- | | [ConfigurationInterface](configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") | $configuration | The configuration class | | array | $configs | An array of configuration items to process | #### Return Value | | | | --- | --- | | array | The processed configuration | ### static array normalizeConfig(array $config, string $key, string $plural = null) Normalizes a configuration entry. This method returns a normalize configuration array for a given key to remove the differences due to the original format (YAML and XML mainly). Here is an example. The configuration in XML: twig.extension.foo twig.extension.bar And the same configuration in YAML: extensions: ['twig.extension.foo', 'twig.extension.bar'] #### Parameters | | | | | --- | --- | --- | | array | $config | A config array | | string | $key | The key to normalize | | string | $plural | The plural form of the key if it is irregular | #### Return Value | | | | --- | --- | | array | | symfony NodeInterface NodeInterface ============== interface **NodeInterface** Common Interface among all nodes. In most cases, it is better to inherit from BaseNode instead of implementing this interface yourself. Methods ------- | | | | | --- | --- | --- | | string | [getName](#method_getName)() Returns the name of the node. | | | string | [getPath](#method_getPath)() Returns the path of the node. | | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | | Details ------- ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | symfony Symfony\Component\Config\Definition\Dumper Symfony\Component\Config\Definition\Dumper ========================================== Classes ------- | | | | --- | --- | | [XmlReferenceDumper](dumper/xmlreferencedumper "Symfony\Component\Config\Definition\Dumper\XmlReferenceDumper") | Dumps a XML reference configuration for the given configuration/node instance. | | [YamlReferenceDumper](dumper/yamlreferencedumper "Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper") | Dumps a Yaml reference configuration for the given configuration/node instance. |
programming_docs
symfony EnumNode EnumNode ========= class **EnumNode** extends [ScalarNode](scalarnode "Symfony\Component\Config\Definition\ScalarNode") Node which only allows a finite set of values. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | from [VariableNode](variablenode#property_defaultValueSet "Symfony\Component\Config\Definition\VariableNode") | | protected | $defaultValue | | from [VariableNode](variablenode#property_defaultValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $allowEmptyValue | | from [VariableNode](variablenode#property_allowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, array $values = array(), string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) | | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | from [ScalarNode](scalarnode#method_validateType "Symfony\Component\Config\Definition\ScalarNode") | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | from [VariableNode](variablenode#method_normalizeValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [VariableNode](variablenode#method_mergeValues "Symfony\Component\Config\Definition\VariableNode") | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | from [ScalarNode](scalarnode#method_getValidPlaceholderTypes "Symfony\Component\Config\Definition\ScalarNode") | | | [setDefaultValue](#method_setDefaultValue)($value) | from [VariableNode](variablenode#method_setDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [VariableNode](variablenode#method_hasDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [VariableNode](variablenode#method_getDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | from [VariableNode](variablenode#method_setAllowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [VariableNode](variablenode#method_setName "Symfony\Component\Config\Definition\VariableNode") | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | from [ScalarNode](scalarnode#method_isValueEmpty "Symfony\Component\Config\Definition\ScalarNode") | | | [getValues](#method_getValues)() | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, array $values = array(), string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | array | $values | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | | ### getValues()
programming_docs
symfony PrototypeNodeInterface PrototypeNodeInterface ======================= interface **PrototypeNodeInterface** implements [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") This interface must be implemented by nodes which can be used as prototypes. Methods ------- | | | | | --- | --- | --- | | string | [getName](#method_getName)() Returns the name of the node. | from [NodeInterface](nodeinterface#method_getName "Symfony\Component\Config\Definition\NodeInterface") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [NodeInterface](nodeinterface#method_getPath "Symfony\Component\Config\Definition\NodeInterface") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [NodeInterface](nodeinterface#method_isRequired "Symfony\Component\Config\Definition\NodeInterface") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [NodeInterface](nodeinterface#method_hasDefaultValue "Symfony\Component\Config\Definition\NodeInterface") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [NodeInterface](nodeinterface#method_getDefaultValue "Symfony\Component\Config\Definition\NodeInterface") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [NodeInterface](nodeinterface#method_normalize "Symfony\Component\Config\Definition\NodeInterface") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [NodeInterface](nodeinterface#method_merge "Symfony\Component\Config\Definition\NodeInterface") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [NodeInterface](nodeinterface#method_finalize "Symfony\Component\Config\Definition\NodeInterface") | | | [setName](#method_setName)(string $name) Sets the name of the node. | | Details ------- ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | symfony NumericNode NumericNode ============ class **NumericNode** extends [ScalarNode](scalarnode "Symfony\Component\Config\Definition\ScalarNode") This node represents a numeric value in the config tree. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | from [VariableNode](variablenode#property_defaultValueSet "Symfony\Component\Config\Definition\VariableNode") | | protected | $defaultValue | | from [VariableNode](variablenode#property_defaultValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $allowEmptyValue | | from [VariableNode](variablenode#property_allowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $min | | | | protected | $max | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, $min = null, $max = null, string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) | | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | from [ScalarNode](scalarnode#method_validateType "Symfony\Component\Config\Definition\ScalarNode") | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | from [VariableNode](variablenode#method_normalizeValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [VariableNode](variablenode#method_mergeValues "Symfony\Component\Config\Definition\VariableNode") | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [BaseNode](basenode#method_allowPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | from [ScalarNode](scalarnode#method_getValidPlaceholderTypes "Symfony\Component\Config\Definition\ScalarNode") | | | [setDefaultValue](#method_setDefaultValue)($value) | from [VariableNode](variablenode#method_setDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [VariableNode](variablenode#method_hasDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [VariableNode](variablenode#method_getDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | from [VariableNode](variablenode#method_setAllowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [VariableNode](variablenode#method_setName "Symfony\Component\Config\Definition\VariableNode") | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, $min = null, $max = null, string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | | $min | | | | $max | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony ArrayNode ArrayNode ========== class **ArrayNode** extends [BaseNode](basenode "Symfony\Component\Config\Definition\BaseNode") implements [PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") Represents an Array node in the config tree. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $xmlRemappings | | | | protected | $children | | | | protected | $allowFalse | | | | protected | $allowNewKeys | | | | protected | $addIfNotSet | | | | protected | $performDeepMerging | | | | protected | $ignoreExtraKeys | | | | protected | $removeExtraKeys | | | | protected | $normalizeKeys | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) | from [BaseNode](basenode#method___construct "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes keys between the different configuration formats. | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of the value. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges values together. | | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes the value of this node. | | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | from [BaseNode](basenode#method_getValidPlaceholderTypes "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizeKeys](#method_setNormalizeKeys)($normalizeKeys) | | | array | [getChildren](#method_getChildren)() Retrieves the children of this node. | | | | [setXmlRemappings](#method_setXmlRemappings)(array $remappings) Sets the xml remappings that should be performed. | | | array | [getXmlRemappings](#method_getXmlRemappings)() Gets the xml remappings that should be performed. | | | | [setAddIfNotSet](#method_setAddIfNotSet)(bool $boolean) Sets whether to add default values for this array if it has not been defined in any of the configuration files. | | | | [setAllowFalse](#method_setAllowFalse)(bool $allow) Sets whether false is allowed as value indicating that the array should be unset. | | | | [setAllowNewKeys](#method_setAllowNewKeys)(bool $allow) Sets whether new keys can be defined in subsequent configurations. | | | | [setPerformDeepMerging](#method_setPerformDeepMerging)(bool $boolean) Sets if deep merging should occur. | | | | [setIgnoreExtraKeys](#method_setIgnoreExtraKeys)(bool $boolean, bool $remove = true) Whether extra keys should just be ignore without an exception. | | | | [setName](#method_setName)(string $name) Sets the name of the node. | | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | | | | [addChild](#method_addChild)([NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node) Adds a child node. | | | array | [remapXml](#method_remapXml)(array $value) Remaps multiple singular values to a single plural value. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes keys between the different configuration formats. Namely, you mostly have foo\_bar in YAML while you have foo-bar in XML. After running this method, all keys are normalized to foo\_bar. If you have a mixed key like foo-bar\_moo, it will not be altered. The key will also not be altered if the target key already exists. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [RuntimeException](http://php.net/RuntimeException) | | ### protected mixed finalizeValue(mixed $value) Finalizes the value of this node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [UnsetKeyException](exception/unsetkeyexception "Symfony\Component\Config\Definition\Exception\UnsetKeyException") | | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the node doesn't have enough children | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setNormalizeKeys($normalizeKeys) #### Parameters | | | | | --- | --- | --- | | | $normalizeKeys | | ### array getChildren() Retrieves the children of this node. #### Return Value | | | | --- | --- | | array | The children | ### setXmlRemappings(array $remappings) Sets the xml remappings that should be performed. #### Parameters | | | | | --- | --- | --- | | array | $remappings | An array of the form array(array(string, string)) | ### array getXmlRemappings() Gets the xml remappings that should be performed. #### Return Value | | | | --- | --- | | array | $remappings an array of the form array(array(string, string)) | ### setAddIfNotSet(bool $boolean) Sets whether to add default values for this array if it has not been defined in any of the configuration files. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | ### setAllowFalse(bool $allow) Sets whether false is allowed as value indicating that the array should be unset. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setAllowNewKeys(bool $allow) Sets whether new keys can be defined in subsequent configurations. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setPerformDeepMerging(bool $boolean) Sets if deep merging should occur. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | ### setIgnoreExtraKeys(bool $boolean, bool $remove = true) Whether extra keys should just be ignore without an exception. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | To allow extra keys | | bool | $remove | To remove extra keys | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### addChild([NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node) Adds a child node. #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the child node has no name | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the child node's name is not unique | ### protected array remapXml(array $value) Remaps multiple singular values to a single plural value. #### Parameters | | | | | --- | --- | --- | | array | $value | The source values | #### Return Value | | | | --- | --- | | array | The remapped values |
programming_docs
symfony PrototypedArrayNode PrototypedArrayNode ==================== class **PrototypedArrayNode** extends [ArrayNode](arraynode "Symfony\Component\Config\Definition\ArrayNode") Represents a prototyped Array node in the config tree. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $xmlRemappings | | from [ArrayNode](arraynode#property_xmlRemappings "Symfony\Component\Config\Definition\ArrayNode") | | protected | $children | | from [ArrayNode](arraynode#property_children "Symfony\Component\Config\Definition\ArrayNode") | | protected | $allowFalse | | from [ArrayNode](arraynode#property_allowFalse "Symfony\Component\Config\Definition\ArrayNode") | | protected | $allowNewKeys | | from [ArrayNode](arraynode#property_allowNewKeys "Symfony\Component\Config\Definition\ArrayNode") | | protected | $addIfNotSet | | from [ArrayNode](arraynode#property_addIfNotSet "Symfony\Component\Config\Definition\ArrayNode") | | protected | $performDeepMerging | | from [ArrayNode](arraynode#property_performDeepMerging "Symfony\Component\Config\Definition\ArrayNode") | | protected | $ignoreExtraKeys | | from [ArrayNode](arraynode#property_ignoreExtraKeys "Symfony\Component\Config\Definition\ArrayNode") | | protected | $removeExtraKeys | | from [ArrayNode](arraynode#property_removeExtraKeys "Symfony\Component\Config\Definition\ArrayNode") | | protected | $normalizeKeys | | from [ArrayNode](arraynode#property_normalizeKeys "Symfony\Component\Config\Definition\ArrayNode") | | protected | $prototype | | | | protected | $keyAttribute | | | | protected | $removeKeyAttribute | | | | protected | $minNumberOfElements | | | | protected | $defaultValue | | | | protected | $defaultChildren | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) | from [BaseNode](basenode#method___construct "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes keys between the different configuration formats. | from [ArrayNode](arraynode#method_preNormalize "Symfony\Component\Config\Definition\ArrayNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of the value. | from [ArrayNode](arraynode#method_validateType "Symfony\Component\Config\Definition\ArrayNode") | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges values together. | | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes the value of this node. | | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [ArrayNode](arraynode#method_allowPlaceholders "Symfony\Component\Config\Definition\ArrayNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | from [BaseNode](basenode#method_getValidPlaceholderTypes "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizeKeys](#method_setNormalizeKeys)($normalizeKeys) | from [ArrayNode](arraynode#method_setNormalizeKeys "Symfony\Component\Config\Definition\ArrayNode") | | array | [getChildren](#method_getChildren)() Retrieves the children of this node. | from [ArrayNode](arraynode#method_getChildren "Symfony\Component\Config\Definition\ArrayNode") | | | [setXmlRemappings](#method_setXmlRemappings)(array $remappings) Sets the xml remappings that should be performed. | from [ArrayNode](arraynode#method_setXmlRemappings "Symfony\Component\Config\Definition\ArrayNode") | | array | [getXmlRemappings](#method_getXmlRemappings)() Gets the xml remappings that should be performed. | from [ArrayNode](arraynode#method_getXmlRemappings "Symfony\Component\Config\Definition\ArrayNode") | | | [setAddIfNotSet](#method_setAddIfNotSet)(bool $boolean) Sets whether to add default values for this array if it has not been defined in any of the configuration files. | from [ArrayNode](arraynode#method_setAddIfNotSet "Symfony\Component\Config\Definition\ArrayNode") | | | [setAllowFalse](#method_setAllowFalse)(bool $allow) Sets whether false is allowed as value indicating that the array should be unset. | from [ArrayNode](arraynode#method_setAllowFalse "Symfony\Component\Config\Definition\ArrayNode") | | | [setAllowNewKeys](#method_setAllowNewKeys)(bool $allow) Sets whether new keys can be defined in subsequent configurations. | from [ArrayNode](arraynode#method_setAllowNewKeys "Symfony\Component\Config\Definition\ArrayNode") | | | [setPerformDeepMerging](#method_setPerformDeepMerging)(bool $boolean) Sets if deep merging should occur. | from [ArrayNode](arraynode#method_setPerformDeepMerging "Symfony\Component\Config\Definition\ArrayNode") | | | [setIgnoreExtraKeys](#method_setIgnoreExtraKeys)(bool $boolean, bool $remove = true) Whether extra keys should just be ignore without an exception. | from [ArrayNode](arraynode#method_setIgnoreExtraKeys "Symfony\Component\Config\Definition\ArrayNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [ArrayNode](arraynode#method_setName "Symfony\Component\Config\Definition\ArrayNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | | | | [addChild](#method_addChild)([NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node) Disable adding concrete children for prototyped nodes. | | | array | [remapXml](#method_remapXml)(array $value) Remaps multiple singular values to a single plural value. | from [ArrayNode](arraynode#method_remapXml "Symfony\Component\Config\Definition\ArrayNode") | | | [setMinNumberOfElements](#method_setMinNumberOfElements)(int $number) Sets the minimum number of elements that a prototype based node must contain. By default this is zero, meaning no elements. | | | | [setKeyAttribute](#method_setKeyAttribute)(string $attribute, bool $remove = true) Sets the attribute which value is to be used as key. | | | string | [getKeyAttribute](#method_getKeyAttribute)() Retrieves the name of the attribute which value should be used as key. | | | | [setDefaultValue](#method_setDefaultValue)(string $value) Sets the default value of this node. | | | | [setAddChildrenIfNoneSet](#method_setAddChildrenIfNoneSet)(int|string|array|null $children = array('defaults')) Adds default children when none are set. | | | | [setPrototype](#method_setPrototype)([PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") $node) Sets the node prototype. | | | [PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") | [getPrototype](#method_getPrototype)() Retrieves the prototype. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes keys between the different configuration formats. Namely, you mostly have foo\_bar in YAML while you have foo-bar in XML. After running this method, all keys are normalized to foo\_bar. If you have a mixed key like foo-bar\_moo, it will not be altered. The key will also not be altered if the target key already exists. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [DuplicateKeyException](exception/duplicatekeyexception "Symfony\Component\Config\Definition\Exception\DuplicateKeyException") | | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [RuntimeException](http://php.net/RuntimeException) | | ### protected mixed finalizeValue(mixed $value) Finalizes the value of this node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [UnsetKeyException](exception/unsetkeyexception "Symfony\Component\Config\Definition\Exception\UnsetKeyException") | | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the node doesn't have enough children | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setNormalizeKeys($normalizeKeys) #### Parameters | | | | | --- | --- | --- | | | $normalizeKeys | | ### array getChildren() Retrieves the children of this node. #### Return Value | | | | --- | --- | | array | The children | ### setXmlRemappings(array $remappings) Sets the xml remappings that should be performed. #### Parameters | | | | | --- | --- | --- | | array | $remappings | An array of the form array(array(string, string)) | ### array getXmlRemappings() Gets the xml remappings that should be performed. #### Return Value | | | | --- | --- | | array | $remappings an array of the form array(array(string, string)) | ### setAddIfNotSet(bool $boolean) Sets whether to add default values for this array if it has not been defined in any of the configuration files. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | ### setAllowFalse(bool $allow) Sets whether false is allowed as value indicating that the array should be unset. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setAllowNewKeys(bool $allow) Sets whether new keys can be defined in subsequent configurations. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setPerformDeepMerging(bool $boolean) Sets if deep merging should occur. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | ### setIgnoreExtraKeys(bool $boolean, bool $remove = true) Whether extra keys should just be ignore without an exception. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | To allow extra keys | | bool | $remove | To remove extra keys | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### addChild([NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node) Disable adding concrete children for prototyped nodes. #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node | | #### Exceptions | | | | --- | --- | | [Exception](exception/exception "Symfony\Component\Config\Definition\Exception\Exception") | | ### protected array remapXml(array $value) Remaps multiple singular values to a single plural value. #### Parameters | | | | | --- | --- | --- | | array | $value | The source values | #### Return Value | | | | --- | --- | | array | The remapped values | ### setMinNumberOfElements(int $number) Sets the minimum number of elements that a prototype based node must contain. By default this is zero, meaning no elements. #### Parameters | | | | | --- | --- | --- | | int | $number | | ### setKeyAttribute(string $attribute, bool $remove = true) Sets the attribute which value is to be used as key. This is useful when you have an indexed array that should be an associative array. You can select an item from within the array to be the key of the particular item. For example, if "id" is the "key", then: ``` array( array('id' => 'my_name', 'foo' => 'bar'), ); ``` becomes ``` array( 'my_name' => array('foo' => 'bar'), ); ``` If you'd like "'id' => 'my\_name'" to still be present in the resulting array, then you can set the second argument of this method to false. #### Parameters | | | | | --- | --- | --- | | string | $attribute | The name of the attribute which value is to be used as a key | | bool | $remove | Whether or not to remove the key | ### string getKeyAttribute() Retrieves the name of the attribute which value should be used as key. #### Return Value | | | | --- | --- | | string | The name of the attribute | ### setDefaultValue(string $value) Sets the default value of this node. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the default value is not an array | ### setAddChildrenIfNoneSet(int|string|array|null $children = array('defaults')) Adds default children when none are set. #### Parameters | | | | | --- | --- | --- | | int|string|array|null | $children | The number of children|The child name|The children names to be added | ### setPrototype([PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") $node) Sets the node prototype. #### Parameters | | | | | --- | --- | --- | | [PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") | $node | | ### [PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") getPrototype() Retrieves the prototype. #### Return Value | | | | --- | --- | | [PrototypeNodeInterface](prototypenodeinterface "Symfony\Component\Config\Definition\PrototypeNodeInterface") | The prototype |
programming_docs
symfony FloatNode FloatNode ========== class **FloatNode** extends [NumericNode](numericnode "Symfony\Component\Config\Definition\NumericNode") This node represents a float value in the config tree. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | from [VariableNode](variablenode#property_defaultValueSet "Symfony\Component\Config\Definition\VariableNode") | | protected | $defaultValue | | from [VariableNode](variablenode#property_defaultValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $allowEmptyValue | | from [VariableNode](variablenode#property_allowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $min | | from [NumericNode](numericnode#property_min "Symfony\Component\Config\Definition\NumericNode") | | protected | $max | | from [NumericNode](numericnode#property_max "Symfony\Component\Config\Definition\NumericNode") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, $min = null, $max = null, string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) | from [NumericNode](numericnode#method___construct "Symfony\Component\Config\Definition\NumericNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | from [VariableNode](variablenode#method_normalizeValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [VariableNode](variablenode#method_mergeValues "Symfony\Component\Config\Definition\VariableNode") | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | from [NumericNode](numericnode#method_finalizeValue "Symfony\Component\Config\Definition\NumericNode") | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [BaseNode](basenode#method_allowPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | | | | [setDefaultValue](#method_setDefaultValue)($value) | from [VariableNode](variablenode#method_setDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [VariableNode](variablenode#method_hasDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [VariableNode](variablenode#method_getDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | from [VariableNode](variablenode#method_setAllowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [VariableNode](variablenode#method_setName "Symfony\Component\Config\Definition\VariableNode") | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | from [NumericNode](numericnode#method_isValueEmpty "Symfony\Component\Config\Definition\NumericNode") | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, $min = null, $max = null, string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | | $min | | | | $max | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony IntegerNode IntegerNode ============ class **IntegerNode** extends [NumericNode](numericnode "Symfony\Component\Config\Definition\NumericNode") This node represents an integer value in the config tree. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | from [VariableNode](variablenode#property_defaultValueSet "Symfony\Component\Config\Definition\VariableNode") | | protected | $defaultValue | | from [VariableNode](variablenode#property_defaultValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $allowEmptyValue | | from [VariableNode](variablenode#property_allowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $min | | from [NumericNode](numericnode#property_min "Symfony\Component\Config\Definition\NumericNode") | | protected | $max | | from [NumericNode](numericnode#property_max "Symfony\Component\Config\Definition\NumericNode") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, $min = null, $max = null, string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) | from [NumericNode](numericnode#method___construct "Symfony\Component\Config\Definition\NumericNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | from [VariableNode](variablenode#method_normalizeValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [VariableNode](variablenode#method_mergeValues "Symfony\Component\Config\Definition\VariableNode") | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | from [NumericNode](numericnode#method_finalizeValue "Symfony\Component\Config\Definition\NumericNode") | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [BaseNode](basenode#method_allowPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | | | | [setDefaultValue](#method_setDefaultValue)($value) | from [VariableNode](variablenode#method_setDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [VariableNode](variablenode#method_hasDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [VariableNode](variablenode#method_getDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | from [VariableNode](variablenode#method_setAllowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [VariableNode](variablenode#method_setName "Symfony\Component\Config\Definition\VariableNode") | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | from [NumericNode](numericnode#method_isValueEmpty "Symfony\Component\Config\Definition\NumericNode") | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, $min = null, $max = null, string $pathSeparator = BaseNode::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | | $min | | | | $max | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony BooleanNode BooleanNode ============ class **BooleanNode** extends [ScalarNode](scalarnode "Symfony\Component\Config\Definition\ScalarNode") This node represents a Boolean value in the config tree. Constants --------- | | | | --- | --- | | DEFAULT\_PATH\_SEPARATOR | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [BaseNode](basenode#property_name "Symfony\Component\Config\Definition\BaseNode") | | protected | $parent | | from [BaseNode](basenode#property_parent "Symfony\Component\Config\Definition\BaseNode") | | protected | $normalizationClosures | | from [BaseNode](basenode#property_normalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $finalValidationClosures | | from [BaseNode](basenode#property_finalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | protected | $allowOverwrite | | from [BaseNode](basenode#property_allowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | protected | $required | | from [BaseNode](basenode#property_required "Symfony\Component\Config\Definition\BaseNode") | | protected | $deprecationMessage | | from [BaseNode](basenode#property_deprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | protected | $equivalentValues | | from [BaseNode](basenode#property_equivalentValues "Symfony\Component\Config\Definition\BaseNode") | | protected | $attributes | | from [BaseNode](basenode#property_attributes "Symfony\Component\Config\Definition\BaseNode") | | protected | $pathSeparator | | from [BaseNode](basenode#property_pathSeparator "Symfony\Component\Config\Definition\BaseNode") | | protected | $defaultValueSet | | from [VariableNode](variablenode#property_defaultValueSet "Symfony\Component\Config\Definition\VariableNode") | | protected | $defaultValue | | from [VariableNode](variablenode#property_defaultValue "Symfony\Component\Config\Definition\VariableNode") | | protected | $allowEmptyValue | | from [VariableNode](variablenode#property_allowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) | from [BaseNode](basenode#method___construct "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholder](#method_setPlaceholder)(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | from [BaseNode](basenode#method_setPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | static void | [setPlaceholderUniquePrefix](#method_setPlaceholderUniquePrefix)(string $prefix) Sets a common prefix for dynamic placeholder values. | from [BaseNode](basenode#method_setPlaceholderUniquePrefix "Symfony\Component\Config\Definition\BaseNode") | | static void | [resetPlaceholders](#method_resetPlaceholders)() Resets all current placeholders available. | from [BaseNode](basenode#method_resetPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | | [setAttribute](#method_setAttribute)($key, $value) | from [BaseNode](basenode#method_setAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttribute](#method_getAttribute)($key, $default = null) | from [BaseNode](basenode#method_getAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [hasAttribute](#method_hasAttribute)($key) | from [BaseNode](basenode#method_hasAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [getAttributes](#method_getAttributes)() | from [BaseNode](basenode#method_getAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [setAttributes](#method_setAttributes)(array $attributes) | from [BaseNode](basenode#method_setAttributes "Symfony\Component\Config\Definition\BaseNode") | | | [removeAttribute](#method_removeAttribute)($key) | from [BaseNode](basenode#method_removeAttribute "Symfony\Component\Config\Definition\BaseNode") | | | [setInfo](#method_setInfo)(string $info) Sets an info message. | from [BaseNode](basenode#method_setInfo "Symfony\Component\Config\Definition\BaseNode") | | string | [getInfo](#method_getInfo)() Returns info message. | from [BaseNode](basenode#method_getInfo "Symfony\Component\Config\Definition\BaseNode") | | | [setExample](#method_setExample)(string|array $example) Sets the example configuration for this node. | from [BaseNode](basenode#method_setExample "Symfony\Component\Config\Definition\BaseNode") | | string|array | [getExample](#method_getExample)() Retrieves the example configuration for this node. | from [BaseNode](basenode#method_getExample "Symfony\Component\Config\Definition\BaseNode") | | | [addEquivalentValue](#method_addEquivalentValue)(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. | from [BaseNode](basenode#method_addEquivalentValue "Symfony\Component\Config\Definition\BaseNode") | | | [setRequired](#method_setRequired)(bool $boolean) Set this node as required. | from [BaseNode](basenode#method_setRequired "Symfony\Component\Config\Definition\BaseNode") | | | [setDeprecated](#method_setDeprecated)(string|null $message) Sets this node as deprecated. | from [BaseNode](basenode#method_setDeprecated "Symfony\Component\Config\Definition\BaseNode") | | | [setAllowOverwrite](#method_setAllowOverwrite)(bool $allow) Sets if this node can be overridden. | from [BaseNode](basenode#method_setAllowOverwrite "Symfony\Component\Config\Definition\BaseNode") | | | [setNormalizationClosures](#method_setNormalizationClosures)(array $closures) Sets the closures used for normalization. | from [BaseNode](basenode#method_setNormalizationClosures "Symfony\Component\Config\Definition\BaseNode") | | | [setFinalValidationClosures](#method_setFinalValidationClosures)(array $closures) Sets the closures used for final validation. | from [BaseNode](basenode#method_setFinalValidationClosures "Symfony\Component\Config\Definition\BaseNode") | | bool | [isRequired](#method_isRequired)() Returns true when the node is required. | from [BaseNode](basenode#method_isRequired "Symfony\Component\Config\Definition\BaseNode") | | bool | [isDeprecated](#method_isDeprecated)() Checks if this node is deprecated. | from [BaseNode](basenode#method_isDeprecated "Symfony\Component\Config\Definition\BaseNode") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $node, string $path) Returns the deprecated message. | from [BaseNode](basenode#method_getDeprecationMessage "Symfony\Component\Config\Definition\BaseNode") | | string | [getName](#method_getName)() Returns the name of the node. | from [BaseNode](basenode#method_getName "Symfony\Component\Config\Definition\BaseNode") | | string | [getPath](#method_getPath)() Returns the path of the node. | from [BaseNode](basenode#method_getPath "Symfony\Component\Config\Definition\BaseNode") | | mixed | [merge](#method_merge)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [BaseNode](basenode#method_merge "Symfony\Component\Config\Definition\BaseNode") | | mixed | [normalize](#method_normalize)(mixed $value) Normalizes a value. | from [BaseNode](basenode#method_normalize "Symfony\Component\Config\Definition\BaseNode") | | $value | [preNormalize](#method_preNormalize)($value) Normalizes the value before any other normalization is applied. | from [BaseNode](basenode#method_preNormalize "Symfony\Component\Config\Definition\BaseNode") | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | [getParent](#method_getParent)() Returns parent node for this node. | from [BaseNode](basenode#method_getParent "Symfony\Component\Config\Definition\BaseNode") | | mixed | [finalize](#method_finalize)(mixed $value) Finalizes a value. | from [BaseNode](basenode#method_finalize "Symfony\Component\Config\Definition\BaseNode") | | | [validateType](#method_validateType)(mixed $value) Validates the type of a Node. | | | mixed | [normalizeValue](#method_normalizeValue)(mixed $value) Normalizes the value. | from [VariableNode](variablenode#method_normalizeValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [mergeValues](#method_mergeValues)(mixed $leftSide, mixed $rightSide) Merges two values together. | from [VariableNode](variablenode#method_mergeValues "Symfony\Component\Config\Definition\VariableNode") | | mixed | [finalizeValue](#method_finalizeValue)(mixed $value) Finalizes a value. | from [VariableNode](variablenode#method_finalizeValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [allowPlaceholders](#method_allowPlaceholders)() Tests if placeholder values are allowed for this node. | from [BaseNode](basenode#method_allowPlaceholders "Symfony\Component\Config\Definition\BaseNode") | | bool | [isHandlingPlaceholder](#method_isHandlingPlaceholder)() Tests if a placeholder is being handled currently. | from [BaseNode](basenode#method_isHandlingPlaceholder "Symfony\Component\Config\Definition\BaseNode") | | array | [getValidPlaceholderTypes](#method_getValidPlaceholderTypes)() Gets allowed dynamic types for this node. | | | | [setDefaultValue](#method_setDefaultValue)($value) | from [VariableNode](variablenode#method_setDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | bool | [hasDefaultValue](#method_hasDefaultValue)() Returns true when the node has a default value. | from [VariableNode](variablenode#method_hasDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | mixed | [getDefaultValue](#method_getDefaultValue)() Returns the default value of the node. | from [VariableNode](variablenode#method_getDefaultValue "Symfony\Component\Config\Definition\VariableNode") | | | [setAllowEmptyValue](#method_setAllowEmptyValue)(bool $boolean) Sets if this node is allowed to have an empty value. | from [VariableNode](variablenode#method_setAllowEmptyValue "Symfony\Component\Config\Definition\VariableNode") | | | [setName](#method_setName)(string $name) Sets the name of the node. | from [VariableNode](variablenode#method_setName "Symfony\Component\Config\Definition\VariableNode") | | bool | [isValueEmpty](#method_isValueEmpty)(mixed $value) Evaluates if the given value is to be treated as empty. | | Details ------- ### \_\_construct(string|null $name, [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $parent = null, string $pathSeparator = self::DEFAULT\_PATH\_SEPARATOR) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $parent | | | string | $pathSeparator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the name contains a period | ### static void setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder. #### Parameters | | | | | --- | --- | --- | | string | $placeholder | | | array | $values | | #### Return Value | | | | --- | --- | | void | | ### static void setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | #### Return Value | | | | --- | --- | | void | | ### static void resetPlaceholders() Resets all current placeholders available. #### Return Value | | | | --- | --- | | void | | ### setAttribute($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### getAttribute($key, $default = null) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $default | | ### hasAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### getAttributes() ### setAttributes(array $attributes) #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### removeAttribute($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### setInfo(string $info) Sets an info message. #### Parameters | | | | | --- | --- | --- | | string | $info | | ### string getInfo() Returns info message. #### Return Value | | | | --- | --- | | string | The info text | ### setExample(string|array $example) Sets the example configuration for this node. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | ### string|array getExample() Retrieves the example configuration for this node. #### Return Value | | | | --- | --- | | string|array | The example | ### addEquivalentValue(mixed $originalValue, mixed $equivalentValue) Adds an equivalent value. #### Parameters | | | | | --- | --- | --- | | mixed | $originalValue | | | mixed | $equivalentValue | | ### setRequired(bool $boolean) Set this node as required. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Required node | ### setDeprecated(string|null $message) Sets this node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string|null | $message | Deprecated message | ### setAllowOverwrite(bool $allow) Sets if this node can be overridden. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | ### setNormalizationClosures(array $closures) Sets the closures used for normalization. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for normalization | ### setFinalValidationClosures(array $closures) Sets the closures used for final validation. #### Parameters | | | | | --- | --- | --- | | array | $closures | An array of Closures used for final validation | ### bool isRequired() Returns true when the node is required. #### Return Value | | | | --- | --- | | bool | If the node is required | ### bool isDeprecated() Checks if this node is deprecated. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $node, string $path) Returns the deprecated message. #### Parameters | | | | | --- | --- | --- | | string | $node | the configuration node name | | string | $path | the path of the node | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the name of the node. #### Return Value | | | | --- | --- | | string | The name of the node | ### string getPath() Returns the path of the node. #### Return Value | | | | --- | --- | | string | The node path | ### final mixed merge(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | #### Exceptions | | | | --- | --- | | [ForbiddenOverwriteException](exception/forbiddenoverwriteexception "Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException") | if the configuration path cannot be overwritten | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### final mixed normalize(mixed $value) Normalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | ### protected $value preNormalize($value) Normalizes the value before any other normalization is applied. #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | $value | The normalized array value | ### [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null getParent() Returns parent node for this node. #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\Config\Definition\NodeInterface")|null | | ### final mixed finalize(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | if the value type is invalid | | [InvalidConfigurationException](exception/invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | if the value is invalid configuration | ### protected validateType(mixed $value) Validates the type of a Node. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to validate | #### Exceptions | | | | --- | --- | | [InvalidTypeException](exception/invalidtypeexception "Symfony\Component\Config\Definition\Exception\InvalidTypeException") | when the value is invalid | ### protected mixed normalizeValue(mixed $value) Normalizes the value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to normalize | #### Return Value | | | | --- | --- | | mixed | The normalized value | ### protected mixed mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. #### Parameters | | | | | --- | --- | --- | | mixed | $leftSide | | | mixed | $rightSide | | #### Return Value | | | | --- | --- | | mixed | The merged value | ### protected mixed finalizeValue(mixed $value) Finalizes a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to finalize | #### Return Value | | | | --- | --- | | mixed | The finalized value | ### protected bool allowPlaceholders() Tests if placeholder values are allowed for this node. #### Return Value | | | | --- | --- | | bool | | ### protected bool isHandlingPlaceholder() Tests if a placeholder is being handled currently. #### Return Value | | | | --- | --- | | bool | | ### protected array getValidPlaceholderTypes() Gets allowed dynamic types for this node. #### Return Value | | | | --- | --- | | array | | ### setDefaultValue($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### bool hasDefaultValue() Returns true when the node has a default value. #### Return Value | | | | --- | --- | | bool | If the node has a default value | ### mixed getDefaultValue() Returns the default value of the node. #### Return Value | | | | --- | --- | | mixed | The default value | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the node has no default value | ### setAllowEmptyValue(bool $boolean) Sets if this node is allowed to have an empty value. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | True if this entity will accept empty values | ### setName(string $name) Sets the name of the node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | ### protected bool isValueEmpty(mixed $value) Evaluates if the given value is to be treated as empty. By default, PHP's empty() function is used to test for emptiness. This method may be overridden by subtypes to better match their understanding of empty data. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony NumericNodeDefinition NumericNodeDefinition ====================== abstract class **NumericNodeDefinition** extends [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") Abstract class that contains common code of integer and float node definitions. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $min | | | | protected | $max | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | from [NodeDefinition](nodedefinition#method___construct "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | from [VariableNodeDefinition](variablenodedefinition#method_createNode "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiate a Node. | from [ScalarNodeDefinition](scalarnodedefinition#method_instantiateNode "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") | | $this | [max](#method_max)(mixed $max) Ensures that the value is smaller than the given reference. | | | $this | [min](#method_min)(mixed $min) Ensures that the value is bigger than the given reference. | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiate a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node | ### $this max(mixed $max) Ensures that the value is smaller than the given reference. #### Parameters | | | | | --- | --- | --- | | mixed | $max | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the constraint is inconsistent | ### $this min(mixed $min) Ensures that the value is bigger than the given reference. #### Parameters | | | | | --- | --- | --- | | mixed | $min | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the constraint is inconsistent | symfony VariableNodeDefinition VariableNodeDefinition ======================= class **VariableNodeDefinition** extends [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") This class provides a fluent interface for defining a node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | from [NodeDefinition](nodedefinition#method___construct "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | from [NodeDefinition](nodedefinition#method_cannotBeEmpty "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiate a Node. | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiate a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node |
programming_docs
symfony MergeBuilder MergeBuilder ============= class **MergeBuilder** This class builds merge conditions. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $node | | | | | $allowFalse | | | | | $allowOverwrite | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | $this | [allowUnset](#method_allowUnset)(bool $allow = true) Sets whether the node can be unset. | | | $this | [denyOverwrite](#method_denyOverwrite)(bool $deny = true) Sets whether the node can be overwritten. | | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | [end](#method_end)() Returns the related node. | | Details ------- ### \_\_construct([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### $this allowUnset(bool $allow = true) Sets whether the node can be unset. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | #### Return Value | | | | --- | --- | | $this | | ### $this denyOverwrite(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") end() Returns the related node. #### Return Value | | | | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | symfony ParentNodeDefinitionInterface ParentNodeDefinitionInterface ============================== interface **ParentNodeDefinitionInterface** implements [BuilderAwareInterface](builderawareinterface "Symfony\Component\Config\Definition\Builder\BuilderAwareInterface") An interface that must be implemented by nodes which can have children. Methods ------- | | | | | --- | --- | --- | | | [setBuilder](#method_setBuilder)([NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder) Sets a custom children builder. | from [BuilderAwareInterface](builderawareinterface#method_setBuilder "Symfony\Component\Config\Definition\Builder\BuilderAwareInterface") | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | [children](#method_children)() Returns a builder to add children nodes. | | | $this | [append](#method_append)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) Appends a node definition. | | Details ------- ### setBuilder([NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder) Sets a custom children builder. #### Parameters | | | | | --- | --- | --- | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | $builder | | ### [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") children() Returns a builder to add children nodes. #### Return Value | | | | --- | --- | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | | ### $this append([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) Appends a node definition. Usage: ``` $node = $parentNode ->children() ->scalarNode('foo')->end() ->scalarNode('baz')->end() ->append($this->getBarNodeDefinition()) ->end() ; ``` #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | #### Return Value | | | | --- | --- | | $this | | symfony BuilderAwareInterface BuilderAwareInterface ====================== interface **BuilderAwareInterface** An interface that can be implemented by nodes which build other nodes. Methods ------- | | | | | --- | --- | --- | | | [setBuilder](#method_setBuilder)([NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder) Sets a custom children builder. | | Details ------- ### setBuilder([NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder) Sets a custom children builder. #### Parameters | | | | | --- | --- | --- | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | $builder | | symfony BooleanNodeDefinition BooleanNodeDefinition ====================== class **BooleanNodeDefinition** extends [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") This class provides a fluent interface for defining a node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | from [VariableNodeDefinition](variablenodedefinition#method_createNode "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiate a Node. | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiate a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node |
programming_docs
symfony NodeDefinition NodeDefinition =============== abstract class **NodeDefinition** implements [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") This class provides a fluent interface for defining a node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | | | protected | $normalization | | | | protected | $validation | | | | protected | $defaultValue | | | | protected | $default | | | | protected | $required | | | | protected | $deprecationMessage | | | | protected | $merge | | | | protected | $allowEmptyValue | | | | protected | $nullEquivalent | | | | protected | $trueEquivalent | | | | protected | $falseEquivalent | | | | protected | $pathSeparator | | | | protected | $parent | | | | protected | $attributes | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | | | $this | [info](#method_info)(string $info) Sets info message. | | | $this | [example](#method_example)(string|array $example) Sets example configuration. | | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | | | $this | [isRequired](#method_isRequired)() Sets the node as required. | | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### abstract protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | symfony EnumNodeDefinition EnumNodeDefinition =================== class **EnumNodeDefinition** extends [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") Enum Node Definition. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | from [NodeDefinition](nodedefinition#method___construct "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | from [NodeDefinition](nodedefinition#method_cannotBeEmpty "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | from [VariableNodeDefinition](variablenodedefinition#method_createNode "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiate a Node. | | | $this | [values](#method_values)(array $values) | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiate a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### $this values(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony NodeBuilder NodeBuilder ============ class **NodeBuilder** implements [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") This class provides a fluent interface for building a node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parent | | | | protected | $nodeMapping | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | $this | [setParent](#method_setParent)([ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface") $parent = null) Set the parent node. | | | [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") | [arrayNode](#method_arrayNode)(string $name) Creates a child array node. | | | [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") | [scalarNode](#method_scalarNode)(string $name) Creates a child scalar node. | | | [BooleanNodeDefinition](booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") | [booleanNode](#method_booleanNode)(string $name) Creates a child Boolean node. | | | [IntegerNodeDefinition](integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") | [integerNode](#method_integerNode)(string $name) Creates a child integer node. | | | [FloatNodeDefinition](floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") | [floatNode](#method_floatNode)(string $name) Creates a child float node. | | | [EnumNodeDefinition](enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") | [enumNode](#method_enumNode)(string $name) Creates a child EnumNode. | | | [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | [variableNode](#method_variableNode)(string $name) Creates a child variable node. | | | [ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | [end](#method_end)() Returns the parent node. | | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | [node](#method_node)(string|null $name, string $type) Creates a child node. | | | $this | [append](#method_append)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) Appends a node definition. | | | $this | [setNodeClass](#method_setNodeClass)(string $type, string $class) Adds or overrides a node Type. | | | string | [getNodeClass](#method_getNodeClass)(string $type) Returns the class name of the node definition. | | Details ------- ### \_\_construct() ### $this setParent([ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface") $parent = null) Set the parent node. #### Parameters | | | | | --- | --- | --- | | [ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") arrayNode(string $name) Creates a child array node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | #### Return Value | | | | --- | --- | | [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") | The child node | ### [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") scalarNode(string $name) Creates a child scalar node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | #### Return Value | | | | --- | --- | | [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") | The child node | ### [BooleanNodeDefinition](booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") booleanNode(string $name) Creates a child Boolean node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | #### Return Value | | | | --- | --- | | [BooleanNodeDefinition](booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") | The child node | ### [IntegerNodeDefinition](integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") integerNode(string $name) Creates a child integer node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | #### Return Value | | | | --- | --- | | [IntegerNodeDefinition](integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") | The child node | ### [FloatNodeDefinition](floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") floatNode(string $name) Creates a child float node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | #### Return Value | | | | --- | --- | | [FloatNodeDefinition](floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") | The child node | ### [EnumNodeDefinition](enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") enumNode(string $name) Creates a child EnumNode. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [EnumNodeDefinition](enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") | | ### [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") variableNode(string $name) Creates a child variable node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the node | #### Return Value | | | | --- | --- | | [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | The builder of the child node | ### [ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") end() Returns the parent node. #### Return Value | | | | --- | --- | | [ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | The parent node | ### [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") node(string|null $name, string $type) Creates a child node. #### Parameters | | | | | --- | --- | --- | | string|null | $name | The name of the node | | string | $type | The type of the node | #### Return Value | | | | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | The child node | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the node type is not registered | | [RuntimeException](http://php.net/RuntimeException) | When the node class is not found | ### $this append([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) Appends a node definition. Usage: ``` $node = new ArrayNodeDefinition('name') ->children() ->scalarNode('foo')->end() ->scalarNode('baz')->end() ->append($this->getBarNodeDefinition()) ->end() ; ``` #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | #### Return Value | | | | --- | --- | | $this | | ### $this setNodeClass(string $type, string $class) Adds or overrides a node Type. #### Parameters | | | | | --- | --- | --- | | string | $type | The name of the type | | string | $class | The fully qualified name the node definition class | #### Return Value | | | | --- | --- | | $this | | ### protected string getNodeClass(string $type) Returns the class name of the node definition. #### Parameters | | | | | --- | --- | --- | | string | $type | The node type | #### Return Value | | | | --- | --- | | string | The node definition class name | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the node type is not registered | | [RuntimeException](http://php.net/RuntimeException) | When the node class is not found | symfony ArrayNodeDefinition ArrayNodeDefinition ==================== class **ArrayNodeDefinition** extends [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") implements [ParentNodeDefinitionInterface](parentnodedefinitioninterface "Symfony\Component\Config\Definition\Builder\ParentNodeDefinitionInterface") This class provides a fluent interface for defining an array node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $performDeepMerging | | | | protected | $ignoreExtraKeys | | | | protected | $removeExtraKeys | | | | protected | $children | | | | protected | $prototype | | | | protected | $atLeastOne | | | | protected | $allowNewKeys | | | | protected | $key | | | | protected | $removeKeyItem | | | | protected | $addDefaults | | | | protected | $addDefaultChildren | | | | protected | $nodeBuilder | | | | protected | $normalizeKeys | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | from [NodeDefinition](nodedefinition#method_cannotBeEmpty "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | | [setBuilder](#method_setBuilder)([NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder) Sets a custom children builder. | | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | [children](#method_children)() Returns a builder to add children nodes. | | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | [prototype](#method_prototype)(string $type) Sets a prototype for child nodes. | | | [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | [variablePrototype](#method_variablePrototype)() | | | [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") | [scalarPrototype](#method_scalarPrototype)() | | | [BooleanNodeDefinition](booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") | [booleanPrototype](#method_booleanPrototype)() | | | [IntegerNodeDefinition](integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") | [integerPrototype](#method_integerPrototype)() | | | [FloatNodeDefinition](floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") | [floatPrototype](#method_floatPrototype)() | | | [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") | [arrayPrototype](#method_arrayPrototype)() | | | [EnumNodeDefinition](enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") | [enumPrototype](#method_enumPrototype)() | | | $this | [addDefaultsIfNotSet](#method_addDefaultsIfNotSet)() Adds the default value if the node is not set in the configuration. | | | $this | [addDefaultChildrenIfNoneSet](#method_addDefaultChildrenIfNoneSet)(int|string|array|null $children = null) Adds children with a default value when none are defined. | | | $this | [requiresAtLeastOneElement](#method_requiresAtLeastOneElement)() Requires the node to have at least one element. | | | $this | [disallowNewKeysInSubsequentConfigs](#method_disallowNewKeysInSubsequentConfigs)() Disallows adding news keys in a subsequent configuration. | | | $this | [fixXmlConfig](#method_fixXmlConfig)(string $singular, string $plural = null) Sets a normalization rule for XML configurations. | | | $this | [useAttributeAsKey](#method_useAttributeAsKey)(string $name, bool $removeKeyItem = true) Sets the attribute which value is to be used as key. | | | $this | [canBeUnset](#method_canBeUnset)(bool $allow = true) Sets whether the node can be unset. | | | $this | [canBeEnabled](#method_canBeEnabled)() Adds an "enabled" boolean to enable the current section. | | | $this | [canBeDisabled](#method_canBeDisabled)() Adds an "enabled" boolean to enable the current section. | | | $this | [performNoDeepMerging](#method_performNoDeepMerging)() Disables the deep merging of the node. | | | $this | [ignoreExtraKeys](#method_ignoreExtraKeys)(bool $remove = true) Allows extra config keys to be specified under an array without throwing an exception. | | | $this | [normalizeKeys](#method_normalizeKeys)(bool $bool) Sets key normalization. | | | $this | [append](#method_append)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) Appends a node definition. | | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | [getNodeBuilder](#method_getNodeBuilder)() Returns a node builder to be used to add children and prototype. | | | | [validateConcreteNode](#method_validateConcreteNode)([ArrayNode](../arraynode "Symfony\Component\Config\Definition\ArrayNode") $node) Validate the configuration of a concrete node. | | | | [validatePrototypeNode](#method_validatePrototypeNode)([PrototypedArrayNode](../prototypedarraynode "Symfony\Component\Config\Definition\PrototypedArrayNode") $node) Validate the configuration of a prototype node. | | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")[] | [getChildNodeDefinitions](#method_getChildNodeDefinitions)() | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### setBuilder([NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder) Sets a custom children builder. #### Parameters | | | | | --- | --- | --- | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | $builder | | ### [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") children() Returns a builder to add children nodes. #### Return Value | | | | --- | --- | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | | ### [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") prototype(string $type) Sets a prototype for child nodes. #### Parameters | | | | | --- | --- | --- | | string | $type | The type of node | #### Return Value | | | | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | ### [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") variablePrototype() #### Return Value | | | | --- | --- | | [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | ### [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") scalarPrototype() #### Return Value | | | | --- | --- | | [ScalarNodeDefinition](scalarnodedefinition "Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition") | | ### [BooleanNodeDefinition](booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") booleanPrototype() #### Return Value | | | | --- | --- | | [BooleanNodeDefinition](booleannodedefinition "Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition") | | ### [IntegerNodeDefinition](integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") integerPrototype() #### Return Value | | | | --- | --- | | [IntegerNodeDefinition](integernodedefinition "Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition") | | ### [FloatNodeDefinition](floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") floatPrototype() #### Return Value | | | | --- | --- | | [FloatNodeDefinition](floatnodedefinition "Symfony\Component\Config\Definition\Builder\FloatNodeDefinition") | | ### [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") arrayPrototype() #### Return Value | | | | --- | --- | | [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition") | | ### [EnumNodeDefinition](enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") enumPrototype() #### Return Value | | | | --- | --- | | [EnumNodeDefinition](enumnodedefinition "Symfony\Component\Config\Definition\Builder\EnumNodeDefinition") | | ### $this addDefaultsIfNotSet() Adds the default value if the node is not set in the configuration. This method is applicable to concrete nodes only (not to prototype nodes). If this function has been called and the node is not set during the finalization phase, it's default value will be derived from its children default values. #### Return Value | | | | --- | --- | | $this | | ### $this addDefaultChildrenIfNoneSet(int|string|array|null $children = null) Adds children with a default value when none are defined. This method is applicable to prototype nodes only. #### Parameters | | | | | --- | --- | --- | | int|string|array|null | $children | The number of children|The child name|The children names to be added | #### Return Value | | | | --- | --- | | $this | | ### $this requiresAtLeastOneElement() Requires the node to have at least one element. This method is applicable to prototype nodes only. #### Return Value | | | | --- | --- | | $this | | ### $this disallowNewKeysInSubsequentConfigs() Disallows adding news keys in a subsequent configuration. If used all keys have to be defined in the same configuration file. #### Return Value | | | | --- | --- | | $this | | ### $this fixXmlConfig(string $singular, string $plural = null) Sets a normalization rule for XML configurations. #### Parameters | | | | | --- | --- | --- | | string | $singular | The key to remap | | string | $plural | The plural of the key for irregular plurals | #### Return Value | | | | --- | --- | | $this | | ### $this useAttributeAsKey(string $name, bool $removeKeyItem = true) Sets the attribute which value is to be used as key. This is useful when you have an indexed array that should be an associative array. You can select an item from within the array to be the key of the particular item. For example, if "id" is the "key", then: ``` array( array('id' => 'my_name', 'foo' => 'bar'), ); ``` becomes ``` array( 'my_name' => array('foo' => 'bar'), ); ``` If you'd like "'id' => 'my\_name'" to still be present in the resulting array, then you can set the second argument of this method to false. This method is applicable to prototype nodes only. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the key | | bool | $removeKeyItem | Whether or not the key item should be removed | #### Return Value | | | | --- | --- | | $this | | ### $this canBeUnset(bool $allow = true) Sets whether the node can be unset. #### Parameters | | | | | --- | --- | --- | | bool | $allow | | #### Return Value | | | | --- | --- | | $this | | ### $this canBeEnabled() Adds an "enabled" boolean to enable the current section. By default, the section is disabled. If any configuration is specified then the node will be automatically enabled: enableableArrayNode: {enabled: true, ...} # The config is enabled & default values get overridden enableableArrayNode: ~ # The config is enabled & use the default values enableableArrayNode: true # The config is enabled & use the default values enableableArrayNode: {other: value, ...} # The config is enabled & default values get overridden enableableArrayNode: {enabled: false, ...} # The config is disabled enableableArrayNode: false # The config is disabled #### Return Value | | | | --- | --- | | $this | | ### $this canBeDisabled() Adds an "enabled" boolean to enable the current section. By default, the section is enabled. #### Return Value | | | | --- | --- | | $this | | ### $this performNoDeepMerging() Disables the deep merging of the node. #### Return Value | | | | --- | --- | | $this | | ### $this ignoreExtraKeys(bool $remove = true) Allows extra config keys to be specified under an array without throwing an exception. Those config values are simply ignored and removed from the resulting array. This should be used only in special cases where you want to send an entire configuration array through a special tree that processes only part of the array. #### Parameters | | | | | --- | --- | --- | | bool | $remove | Whether to remove the extra keys | #### Return Value | | | | --- | --- | | $this | | ### $this normalizeKeys(bool $bool) Sets key normalization. #### Parameters | | | | | --- | --- | --- | | bool | $bool | Whether to enable key normalization | #### Return Value | | | | --- | --- | | $this | | ### $this append([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) Appends a node definition. Usage: ``` $node = $parentNode ->children() ->scalarNode('foo')->end() ->scalarNode('baz')->end() ->append($this->getBarNodeDefinition()) ->end() ; ``` #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | #### Return Value | | | | --- | --- | | $this | | ### protected [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") getNodeBuilder() Returns a node builder to be used to add children and prototype. #### Return Value | | | | --- | --- | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | The node builder | ### protected validateConcreteNode([ArrayNode](../arraynode "Symfony\Component\Config\Definition\ArrayNode") $node) Validate the configuration of a concrete node. #### Parameters | | | | | --- | --- | --- | | [ArrayNode](../arraynode "Symfony\Component\Config\Definition\ArrayNode") | $node | | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | | ### protected validatePrototypeNode([PrototypedArrayNode](../prototypedarraynode "Symfony\Component\Config\Definition\PrototypedArrayNode") $node) Validate the configuration of a prototype node. #### Parameters | | | | | --- | --- | --- | | [PrototypedArrayNode](../prototypedarraynode "Symfony\Component\Config\Definition\PrototypedArrayNode") | $node | | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | | ### [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")[] getChildNodeDefinitions() #### Return Value | | | | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")[] | |
programming_docs
symfony ValidationBuilder ValidationBuilder ================== class **ValidationBuilder** This class builds validation conditions. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $node | | | | | $rules | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder")|$this | [rule](#method_rule)([Closure](http://php.net/Closure) $closure = null) Registers a closure to run as normalization or an expression builder to build it if null is provided. | | Details ------- ### \_\_construct([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder")|$this rule([Closure](http://php.net/Closure) $closure = null) Registers a closure to run as normalization or an expression builder to build it if null is provided. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | | #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder")|$this | | symfony FloatNodeDefinition FloatNodeDefinition ==================== class **FloatNodeDefinition** extends [NumericNodeDefinition](numericnodedefinition "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") This class provides a fluent interface for defining a float node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $min | | from [NumericNodeDefinition](numericnodedefinition#property_min "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | | protected | $max | | from [NumericNodeDefinition](numericnodedefinition#property_max "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | from [NodeDefinition](nodedefinition#method___construct "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | from [NumericNodeDefinition](numericnodedefinition#method_cannotBeEmpty "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | from [VariableNodeDefinition](variablenodedefinition#method_createNode "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiates a Node. | | | $this | [max](#method_max)(mixed $max) Ensures that the value is smaller than the given reference. | from [NumericNodeDefinition](numericnodedefinition#method_max "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | | $this | [min](#method_min)(mixed $min) Ensures that the value is bigger than the given reference. | from [NumericNodeDefinition](numericnodedefinition#method_min "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiates a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node | ### $this max(mixed $max) Ensures that the value is smaller than the given reference. #### Parameters | | | | | --- | --- | --- | | mixed | $max | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the constraint is inconsistent | ### $this min(mixed $min) Ensures that the value is bigger than the given reference. #### Parameters | | | | | --- | --- | --- | | mixed | $min | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the constraint is inconsistent |
programming_docs
symfony NormalizationBuilder NormalizationBuilder ===================== class **NormalizationBuilder** This class builds normalization conditions. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $node | | | | | $before | | | | | $remappings | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | $this | [remap](#method_remap)(string $key, string $plural = null) Registers a key to remap to its plural form. | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder")|$this | [before](#method_before)([Closure](http://php.net/Closure) $closure = null) Registers a closure to run before the normalization or an expression builder to build it if null is provided. | | Details ------- ### \_\_construct([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### $this remap(string $key, string $plural = null) Registers a key to remap to its plural form. #### Parameters | | | | | --- | --- | --- | | string | $key | The key to remap | | string | $plural | The plural of the key in case of irregular plural | #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder")|$this before([Closure](http://php.net/Closure) $closure = null) Registers a closure to run before the normalization or an expression builder to build it if null is provided. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | | #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder")|$this | | symfony ScalarNodeDefinition ScalarNodeDefinition ===================== class **ScalarNodeDefinition** extends [VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") This class provides a fluent interface for defining a node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | from [NodeDefinition](nodedefinition#method___construct "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | from [NodeDefinition](nodedefinition#method_cannotBeEmpty "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | from [VariableNodeDefinition](variablenodedefinition#method_createNode "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiate a Node. | | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiate a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node | symfony TreeBuilder TreeBuilder ============ class **TreeBuilder** implements [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") This is the entry class for building a config tree. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $tree | | | | protected | $root | | | Methods ------- | | | | | --- | --- | --- | | [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | [root](#method_root)(string $name, string $type = 'array', [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder = null) Creates the root node. | | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [buildTree](#method_buildTree)() Builds the tree. | | | | [setPathSeparator](#method_setPathSeparator)(string $separator) | | Details ------- ### [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") root(string $name, string $type = 'array', [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") $builder = null) Creates the root node. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the root node | | string | $type | The type of the root node | | [NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder") | $builder | A custom node builder instance | #### Return Value | | | | --- | --- | | [ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | The root node (as an ArrayNodeDefinition when the type is 'array') | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the node type is not supported | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") buildTree() Builds the tree. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### setPathSeparator(string $separator) #### Parameters | | | | | --- | --- | --- | | string | $separator | |
programming_docs
symfony NodeParentInterface NodeParentInterface ==================== interface **NodeParentInterface** An interface that must be implemented by all node parents. symfony IntegerNodeDefinition IntegerNodeDefinition ====================== class **IntegerNodeDefinition** extends [NumericNodeDefinition](numericnodedefinition "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") This class provides a fluent interface for defining an integer node. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | from [NodeDefinition](nodedefinition#property_name "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $normalization | | from [NodeDefinition](nodedefinition#property_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $validation | | from [NodeDefinition](nodedefinition#property_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $defaultValue | | from [NodeDefinition](nodedefinition#property_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $default | | from [NodeDefinition](nodedefinition#property_default "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $required | | from [NodeDefinition](nodedefinition#property_required "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $deprecationMessage | | from [NodeDefinition](nodedefinition#property_deprecationMessage "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $merge | | from [NodeDefinition](nodedefinition#property_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $allowEmptyValue | | from [NodeDefinition](nodedefinition#property_allowEmptyValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $nullEquivalent | | from [NodeDefinition](nodedefinition#property_nullEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $trueEquivalent | | from [NodeDefinition](nodedefinition#property_trueEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $falseEquivalent | | from [NodeDefinition](nodedefinition#property_falseEquivalent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $pathSeparator | | from [NodeDefinition](nodedefinition#property_pathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $parent | | from [NodeDefinition](nodedefinition#property_parent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $attributes | | from [NodeDefinition](nodedefinition#property_attributes "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | protected | $min | | from [NumericNodeDefinition](numericnodedefinition#property_min "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | | protected | $max | | from [NumericNodeDefinition](numericnodedefinition#property_max "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) | from [NodeDefinition](nodedefinition#method___construct "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setParent](#method_setParent)([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. | from [NodeDefinition](nodedefinition#method_setParent "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [info](#method_info)(string $info) Sets info message. | from [NodeDefinition](nodedefinition#method_info "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [example](#method_example)(string|array $example) Sets example configuration. | from [NodeDefinition](nodedefinition#method_example "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [attribute](#method_attribute)(string $key, mixed $value) Sets an attribute on the node. | from [NodeDefinition](nodedefinition#method_attribute "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | [end](#method_end)() Returns the parent node. | from [NodeDefinition](nodedefinition#method_end "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [getNode](#method_getNode)(bool $forceRootNode = false) Creates the node. | from [NodeDefinition](nodedefinition#method_getNode "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultValue](#method_defaultValue)(mixed $value) Sets the default value. | from [NodeDefinition](nodedefinition#method_defaultValue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [isRequired](#method_isRequired)() Sets the node as required. | from [NodeDefinition](nodedefinition#method_isRequired "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [setDeprecated](#method_setDeprecated)(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. | from [NodeDefinition](nodedefinition#method_setDeprecated "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatNullLike](#method_treatNullLike)(mixed $value) Sets the equivalent value used when the node contains null. | from [NodeDefinition](nodedefinition#method_treatNullLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatTrueLike](#method_treatTrueLike)(mixed $value) Sets the equivalent value used when the node contains true. | from [NodeDefinition](nodedefinition#method_treatTrueLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [treatFalseLike](#method_treatFalseLike)(mixed $value) Sets the equivalent value used when the node contains false. | from [NodeDefinition](nodedefinition#method_treatFalseLike "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultNull](#method_defaultNull)() Sets null as the default value. | from [NodeDefinition](nodedefinition#method_defaultNull "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultTrue](#method_defaultTrue)() Sets true as the default value. | from [NodeDefinition](nodedefinition#method_defaultTrue "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [defaultFalse](#method_defaultFalse)() Sets false as the default value. | from [NodeDefinition](nodedefinition#method_defaultFalse "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [beforeNormalization](#method_beforeNormalization)() Sets an expression to run before the normalization. | from [NodeDefinition](nodedefinition#method_beforeNormalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeEmpty](#method_cannotBeEmpty)() Denies the node value being empty. | from [NumericNodeDefinition](numericnodedefinition#method_cannotBeEmpty "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [validate](#method_validate)() Sets an expression to run for the validation. | from [NodeDefinition](nodedefinition#method_validate "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | $this | [cannotBeOverwritten](#method_cannotBeOverwritten)(bool $deny = true) Sets whether the node can be overwritten. | from [NodeDefinition](nodedefinition#method_cannotBeOverwritten "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | [validation](#method_validation)() Gets the builder for validation rules. | from [NodeDefinition](nodedefinition#method_validation "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | [merge](#method_merge)() Gets the builder for merging rules. | from [NodeDefinition](nodedefinition#method_merge "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | [normalization](#method_normalization)() Gets the builder for normalization rules. | from [NodeDefinition](nodedefinition#method_normalization "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | [createNode](#method_createNode)() Instantiate and configure the node according to this definition. | from [VariableNodeDefinition](variablenodedefinition#method_createNode "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | $this | [setPathSeparator](#method_setPathSeparator)(string $separator) Set PathSeparator to use. | from [NodeDefinition](nodedefinition#method_setPathSeparator "Symfony\Component\Config\Definition\Builder\NodeDefinition") | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | [instantiateNode](#method_instantiateNode)() Instantiates a Node. | | | $this | [max](#method_max)(mixed $max) Ensures that the value is smaller than the given reference. | from [NumericNodeDefinition](numericnodedefinition#method_max "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | | $this | [min](#method_min)(mixed $min) Ensures that the value is bigger than the given reference. | from [NumericNodeDefinition](numericnodedefinition#method_min "Symfony\Component\Config\Definition\Builder\NumericNodeDefinition") | Details ------- ### \_\_construct(string|null $name, [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent = null) #### Parameters | | | | | --- | --- | --- | | string|null | $name | | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | ### $this setParent([NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") $parent) Sets the parent node. #### Parameters | | | | | --- | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface") | $parent | | #### Return Value | | | | --- | --- | | $this | | ### $this info(string $info) Sets info message. #### Parameters | | | | | --- | --- | --- | | string | $info | The info text | #### Return Value | | | | --- | --- | | $this | | ### $this example(string|array $example) Sets example configuration. #### Parameters | | | | | --- | --- | --- | | string|array | $example | | #### Return Value | | | | --- | --- | | $this | | ### $this attribute(string $key, mixed $value) Sets an attribute on the node. #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null end() Returns the parent node. #### Return Value | | | | --- | --- | | [NodeParentInterface](nodeparentinterface "Symfony\Component\Config\Definition\Builder\NodeParentInterface")|[NodeBuilder](nodebuilder "Symfony\Component\Config\Definition\Builder\NodeBuilder")|[NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition")|null | The builder of the parent node | ### [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") getNode(bool $forceRootNode = false) Creates the node. #### Parameters | | | | | --- | --- | --- | | bool | $forceRootNode | Whether to force this node as the root node | #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | | ### $this defaultValue(mixed $value) Sets the default value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The default value | #### Return Value | | | | --- | --- | | $this | | ### $this isRequired() Sets the node as required. #### Return Value | | | | --- | --- | | $this | | ### $this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.') Sets the node as deprecated. You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path. #### Parameters | | | | | --- | --- | --- | | string | $message | Deprecation message | #### Return Value | | | | --- | --- | | $this | | ### $this treatNullLike(mixed $value) Sets the equivalent value used when the node contains null. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatTrueLike(mixed $value) Sets the equivalent value used when the node contains true. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this treatFalseLike(mixed $value) Sets the equivalent value used when the node contains false. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this defaultNull() Sets null as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultTrue() Sets true as the default value. #### Return Value | | | | --- | --- | | $this | | ### $this defaultFalse() Sets false as the default value. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") beforeNormalization() Sets an expression to run before the normalization. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeEmpty() Denies the node value being empty. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") validate() Sets an expression to run for the validation. The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this cannotBeOverwritten(bool $deny = true) Sets whether the node can be overwritten. #### Parameters | | | | | --- | --- | --- | | bool | $deny | Whether the overwriting is forbidden or not | #### Return Value | | | | --- | --- | | $this | | ### protected [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") validation() Gets the builder for validation rules. #### Return Value | | | | --- | --- | | [ValidationBuilder](validationbuilder "Symfony\Component\Config\Definition\Builder\ValidationBuilder") | | ### protected [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") merge() Gets the builder for merging rules. #### Return Value | | | | --- | --- | | [MergeBuilder](mergebuilder "Symfony\Component\Config\Definition\Builder\MergeBuilder") | | ### protected [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") normalization() Gets the builder for normalization rules. #### Return Value | | | | --- | --- | | [NormalizationBuilder](normalizationbuilder "Symfony\Component\Config\Definition\Builder\NormalizationBuilder") | | ### protected [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") createNode() Instantiate and configure the node according to this definition. #### Return Value | | | | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node The node instance | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Config\Definition\Exception\InvalidDefinitionException") | When the definition is invalid | ### $this setPathSeparator(string $separator) Set PathSeparator to use. #### Parameters | | | | | --- | --- | --- | | string | $separator | | #### Return Value | | | | --- | --- | | $this | | ### protected [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") instantiateNode() Instantiates a Node. #### Return Value | | | | --- | --- | | [VariableNode](../variablenode "Symfony\Component\Config\Definition\VariableNode") | The node | ### $this max(mixed $max) Ensures that the value is smaller than the given reference. #### Parameters | | | | | --- | --- | --- | | mixed | $max | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the constraint is inconsistent | ### $this min(mixed $min) Ensures that the value is bigger than the given reference. #### Parameters | | | | | --- | --- | --- | | mixed | $min | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the constraint is inconsistent | symfony ExprBuilder ExprBuilder ============ class **ExprBuilder** This class builds an if expression. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $node | | | | | $ifPart | | | | | $thenPart | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | $this | [always](#method_always)([Closure](http://php.net/Closure) $then = null) Marks the expression as being always used. | | | $this | [ifTrue](#method_ifTrue)([Closure](http://php.net/Closure) $closure = null) Sets a closure to use as tests. | | | $this | [ifString](#method_ifString)() Tests if the value is a string. | | | $this | [ifNull](#method_ifNull)() Tests if the value is null. | | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | [ifEmpty](#method_ifEmpty)() Tests if the value is empty. | | | $this | [ifArray](#method_ifArray)() Tests if the value is an array. | | | $this | [ifInArray](#method_ifInArray)(array $array) Tests if the value is in an array. | | | $this | [ifNotInArray](#method_ifNotInArray)(array $array) Tests if the value is not in an array. | | | $this | [castToArray](#method_castToArray)() Transforms variables of any type into an array. | | | $this | [then](#method_then)([Closure](http://php.net/Closure) $closure) Sets the closure to run if the test pass. | | | $this | [thenEmptyArray](#method_thenEmptyArray)() Sets a closure returning an empty array. | | | $this | [thenInvalid](#method_thenInvalid)(string $message) Sets a closure marking the value as invalid at validation time. | | | $this | [thenUnset](#method_thenUnset)() Sets a closure unsetting this key of the array at validation time. | | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | [end](#method_end)() Returns the related node. | | | static array | [buildExpressions](#method_buildExpressions)(array $expressions) Builds the expressions. | | Details ------- ### \_\_construct([NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### $this always([Closure](http://php.net/Closure) $then = null) Marks the expression as being always used. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $then | | #### Return Value | | | | --- | --- | | $this | | ### $this ifTrue([Closure](http://php.net/Closure) $closure = null) Sets a closure to use as tests. The default one tests if the value is true. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | | #### Return Value | | | | --- | --- | | $this | | ### $this ifString() Tests if the value is a string. #### Return Value | | | | --- | --- | | $this | | ### $this ifNull() Tests if the value is null. #### Return Value | | | | --- | --- | | $this | | ### [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") ifEmpty() Tests if the value is empty. #### Return Value | | | | --- | --- | | [ExprBuilder](exprbuilder "Symfony\Component\Config\Definition\Builder\ExprBuilder") | | ### $this ifArray() Tests if the value is an array. #### Return Value | | | | --- | --- | | $this | | ### $this ifInArray(array $array) Tests if the value is in an array. #### Parameters | | | | | --- | --- | --- | | array | $array | | #### Return Value | | | | --- | --- | | $this | | ### $this ifNotInArray(array $array) Tests if the value is not in an array. #### Parameters | | | | | --- | --- | --- | | array | $array | | #### Return Value | | | | --- | --- | | $this | | ### $this castToArray() Transforms variables of any type into an array. #### Return Value | | | | --- | --- | | $this | | ### $this then([Closure](http://php.net/Closure) $closure) Sets the closure to run if the test pass. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | | #### Return Value | | | | --- | --- | | $this | | ### $this thenEmptyArray() Sets a closure returning an empty array. #### Return Value | | | | --- | --- | | $this | | ### $this thenInvalid(string $message) Sets a closure marking the value as invalid at validation time. if you want to add the value of the node in your message just use a %s placeholder. #### Parameters | | | | | --- | --- | --- | | string | $message | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this thenUnset() Sets a closure unsetting this key of the array at validation time. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UnsetKeyException](../exception/unsetkeyexception "Symfony\Component\Config\Definition\Exception\UnsetKeyException") | | ### [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") end() Returns the related node. #### Return Value | | | | --- | --- | | [NodeDefinition](nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition")|[ArrayNodeDefinition](arraynodedefinition "Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition")|[VariableNodeDefinition](variablenodedefinition "Symfony\Component\Config\Definition\Builder\VariableNodeDefinition") | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### static array buildExpressions(array $expressions) Builds the expressions. #### Parameters | | | | | --- | --- | --- | | array | $expressions | An array of ExprBuilder instances to build | #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony DuplicateKeyException DuplicateKeyException ====================== class **DuplicateKeyException** extends [InvalidConfigurationException](invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") This exception is thrown whenever the key of an array is not unique. This can only be the case if the configuration is coming from an XML file. Methods ------- | | | | | --- | --- | --- | | | [setPath](#method_setPath)($path) | from [InvalidConfigurationException](invalidconfigurationexception#method_setPath "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [getPath](#method_getPath)() | from [InvalidConfigurationException](invalidconfigurationexception#method_getPath "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [addHint](#method_addHint)(string $hint) Adds extra information that is suffixed to the original exception message. | from [InvalidConfigurationException](invalidconfigurationexception#method_addHint "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | Details ------- ### setPath($path) #### Parameters | | | | | --- | --- | --- | | | $path | | ### getPath() ### addHint(string $hint) Adds extra information that is suffixed to the original exception message. #### Parameters | | | | | --- | --- | --- | | string | $hint | | symfony InvalidConfigurationException InvalidConfigurationException ============================== class **InvalidConfigurationException** extends [Exception](exception "Symfony\Component\Config\Definition\Exception\Exception") A very general exception which can be thrown whenever non of the more specific exceptions is suitable. Methods ------- | | | | | --- | --- | --- | | | [setPath](#method_setPath)($path) | | | | [getPath](#method_getPath)() | | | | [addHint](#method_addHint)(string $hint) Adds extra information that is suffixed to the original exception message. | | Details ------- ### setPath($path) #### Parameters | | | | | --- | --- | --- | | | $path | | ### getPath() ### addHint(string $hint) Adds extra information that is suffixed to the original exception message. #### Parameters | | | | | --- | --- | --- | | string | $hint | | symfony Exception Exception ========== class **Exception** extends [RuntimeException](http://php.net/RuntimeException) Base exception for all configuration exceptions. symfony TreeWithoutRootNodeException TreeWithoutRootNodeException ============================= class **TreeWithoutRootNodeException** extends [RuntimeException](http://php.net/RuntimeException) symfony UnsetKeyException UnsetKeyException ================== class **UnsetKeyException** extends [Exception](exception "Symfony\Component\Config\Definition\Exception\Exception") This exception is usually not encountered by the end-user, but only used internally to signal the parent scope to unset a key. symfony InvalidDefinitionException InvalidDefinitionException =========================== class **InvalidDefinitionException** extends [Exception](exception "Symfony\Component\Config\Definition\Exception\Exception") Thrown when an error is detected in a node Definition. symfony ForbiddenOverwriteException ForbiddenOverwriteException ============================ class **ForbiddenOverwriteException** extends [InvalidConfigurationException](invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") This exception is thrown when a configuration path is overwritten from a subsequent configuration file, but the entry node specifically forbids this. Methods ------- | | | | | --- | --- | --- | | | [setPath](#method_setPath)($path) | from [InvalidConfigurationException](invalidconfigurationexception#method_setPath "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [getPath](#method_getPath)() | from [InvalidConfigurationException](invalidconfigurationexception#method_getPath "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [addHint](#method_addHint)(string $hint) Adds extra information that is suffixed to the original exception message. | from [InvalidConfigurationException](invalidconfigurationexception#method_addHint "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | Details ------- ### setPath($path) #### Parameters | | | | | --- | --- | --- | | | $path | | ### getPath() ### addHint(string $hint) Adds extra information that is suffixed to the original exception message. #### Parameters | | | | | --- | --- | --- | | string | $hint | | symfony InvalidTypeException InvalidTypeException ===================== class **InvalidTypeException** extends [InvalidConfigurationException](invalidconfigurationexception "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") This exception is thrown if an invalid type is encountered. Methods ------- | | | | | --- | --- | --- | | | [setPath](#method_setPath)($path) | from [InvalidConfigurationException](invalidconfigurationexception#method_setPath "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [getPath](#method_getPath)() | from [InvalidConfigurationException](invalidconfigurationexception#method_getPath "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | | | [addHint](#method_addHint)(string $hint) Adds extra information that is suffixed to the original exception message. | from [InvalidConfigurationException](invalidconfigurationexception#method_addHint "Symfony\Component\Config\Definition\Exception\InvalidConfigurationException") | Details ------- ### setPath($path) #### Parameters | | | | | --- | --- | --- | | | $path | | ### getPath() ### addHint(string $hint) Adds extra information that is suffixed to the original exception message. #### Parameters | | | | | --- | --- | --- | | string | $hint | | symfony XmlReferenceDumper XmlReferenceDumper =================== class **XmlReferenceDumper** Dumps a XML reference configuration for the given configuration/node instance. Methods ------- | | | | | --- | --- | --- | | | [dump](#method_dump)([ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, $namespace = null) | | | | [dumpNode](#method_dumpNode)([NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node, $namespace = null) | | Details ------- ### dump([ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, $namespace = null) #### Parameters | | | | | --- | --- | --- | | [ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") | $configuration | | | | $namespace | | ### dumpNode([NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node, $namespace = null) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node | | | | $namespace | | symfony YamlReferenceDumper YamlReferenceDumper ==================== class **YamlReferenceDumper** Dumps a Yaml reference configuration for the given configuration/node instance. Methods ------- | | | | | --- | --- | --- | | | [dump](#method_dump)([ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration) | | | | [dumpAtPath](#method_dumpAtPath)([ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, $path) | | | | [dumpNode](#method_dumpNode)([NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node) | | Details ------- ### dump([ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration) #### Parameters | | | | | --- | --- | --- | | [ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") | $configuration | | ### dumpAtPath([ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, $path) #### Parameters | | | | | --- | --- | --- | | [ConfigurationInterface](../configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") | $configuration | | | | $path | | ### dumpNode([NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") $node) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](../nodeinterface "Symfony\Component\Config\Definition\NodeInterface") | $node | | symfony FileResource FileResource ============= class **FileResource** implements [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) FileResource represents a resource stored on the filesystem. The resource can be a file or a directory. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resource) | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | string | [getResource](#method_getResource)() | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### \_\_construct(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | The file path to the resource | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### string getResource() #### Return Value | | | | --- | --- | | string | The canonicalized, absolute path to the resource | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony ComposerResource ComposerResource ================= class **ComposerResource** implements [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) ComposerResource tracks the PHP version and Composer dependencies. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | | [getVendors](#method_getVendors)() | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### \_\_construct() ### getVendors() ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony GlobResource GlobResource ============= class **GlobResource** implements [IteratorAggregate](http://php.net/IteratorAggregate), [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) GlobResource represents a set of resources stored on the filesystem. Only existence/removal is tracked (not mtimes.) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $prefix, string $pattern, bool $recursive) | | | | [getPrefix](#method_getPrefix)() | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | | | [getIterator](#method_getIterator)() | | Details ------- ### \_\_construct(string|null $prefix, string $pattern, bool $recursive) #### Parameters | | | | | --- | --- | --- | | string|null | $prefix | A directory prefix | | string | $pattern | A glob pattern | | bool | $recursive | Whether directories should be scanned recursively or not | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### getPrefix() ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### getIterator() symfony FileExistenceResource FileExistenceResource ====================== class **FileExistenceResource** implements [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) FileExistenceResource represents a resource stored on the filesystem. Freshness is only evaluated against resource creation or deletion. The resource can be a file or a directory. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resource) | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | string | [getResource](#method_getResource)() | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | Details ------- ### \_\_construct(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | The file path to the resource | ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### string getResource() #### Return Value | | | | --- | --- | | string | The file path to the resource | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony ClassExistenceResource ClassExistenceResource ======================= class **ClassExistenceResource** implements [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) ClassExistenceResource represents a class existence. Freshness is only evaluated against resource existence. The resource must be a fully-qualified class name. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resource, bool $exists = null) | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | string | [getResource](#method_getResource)() | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | Details ------- ### \_\_construct(string $resource, bool $exists = null) #### Parameters | | | | | --- | --- | --- | | string | $resource | The fully-qualified class name | | bool | $exists | Boolean when the existency check has already been done | ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### string getResource() #### Return Value | | | | --- | --- | | string | The file path to the resource | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | |
programming_docs
symfony ResourceInterface ResourceInterface ================== interface **ResourceInterface** ResourceInterface is the interface that must be implemented by all Resource classes. Methods ------- | | | | | --- | --- | --- | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | Details ------- ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | symfony SelfCheckingResourceInterface SelfCheckingResourceInterface ============================== interface **SelfCheckingResourceInterface** implements [ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") Interface for Resources that can check for freshness autonomously, without special support from external services. Methods ------- | | | | | --- | --- | --- | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | from [ResourceInterface](resourceinterface#method___toString "Symfony\Component\Config\Resource\ResourceInterface") | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | Details ------- ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | symfony ReflectionClassResource ReflectionClassResource ======================== class **ReflectionClassResource** implements [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ReflectionClass](http://php.net/ReflectionClass) $classReflector, array $excludedVendors = array()) | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### \_\_construct([ReflectionClass](http://php.net/ReflectionClass) $classReflector, array $excludedVendors = array()) #### Parameters | | | | | --- | --- | --- | | [ReflectionClass](http://php.net/ReflectionClass) | $classReflector | | | array | $excludedVendors | | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony DirectoryResource DirectoryResource ================== class **DirectoryResource** implements [SelfCheckingResourceInterface](selfcheckingresourceinterface "Symfony\Component\Config\Resource\SelfCheckingResourceInterface"), [Serializable](http://php.net/Serializable) DirectoryResource represents a resources stored in a subdirectory tree. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resource, string $pattern = null) | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | string | [getResource](#method_getResource)() | | | string|null | [getPattern](#method_getPattern)() Returns the pattern to restrict monitored files. | | | bool | [isFresh](#method_isFresh)(int $timestamp) Returns true if the resource has not been updated since the given timestamp. | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### \_\_construct(string $resource, string $pattern = null) #### Parameters | | | | | --- | --- | --- | | string | $resource | The file path to the resource | | string | $pattern | A pattern to restrict monitored files | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### string getResource() #### Return Value | | | | --- | --- | | string | The file path to the resource | ### string|null getPattern() Returns the pattern to restrict monitored files. #### Return Value | | | | --- | --- | | string|null | | ### bool isFresh(int $timestamp) Returns true if the resource has not been updated since the given timestamp. #### Parameters | | | | | --- | --- | --- | | int | $timestamp | The last time the resource was loaded | #### Return Value | | | | --- | --- | | bool | True if the resource has not been updated, false otherwise | ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony SelfCheckingResourceChecker SelfCheckingResourceChecker ============================ class **SelfCheckingResourceChecker** implements [ResourceCheckerInterface](../resourcecheckerinterface "Symfony\Component\Config\ResourceCheckerInterface") Resource checker for instances of SelfCheckingResourceInterface. As these resources perform the actual check themselves, we can provide this class as a standard way of validating them. Methods ------- | | | | | --- | --- | --- | | bool | [supports](#method_supports)([ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $metadata) Queries the ResourceChecker whether it can validate a given resource or not. | | | bool | [isFresh](#method_isFresh)([ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource, int $timestamp) Validates the resource. | | Details ------- ### bool supports([ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $metadata) Queries the ResourceChecker whether it can validate a given resource or not. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $metadata | The resource to be checked for freshness | #### Return Value | | | | --- | --- | | bool | True if the ResourceChecker can handle this resource type, false if not | ### bool isFresh([ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource, int $timestamp) Validates the resource. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | The resource to be validated | | int | $timestamp | The timestamp at which the cache associated with this resource was created | #### Return Value | | | | --- | --- | | bool | True if the resource has not changed since the given timestamp, false otherwise | symfony FileLocatorFileNotFoundException FileLocatorFileNotFoundException ================================= class **FileLocatorFileNotFoundException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) File locator exception if a file does not exist. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message = '', int $code = 0, [Exception](http://php.net/Exception) $previous = null, array $paths = array()) | | | | [getPaths](#method_getPaths)() | | Details ------- ### \_\_construct(string $message = '', int $code = 0, [Exception](http://php.net/Exception) $previous = null, array $paths = array()) #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $code | | | [Exception](http://php.net/Exception) | $previous | | | array | $paths | | ### getPaths() symfony FileLoaderImportCircularReferenceException FileLoaderImportCircularReferenceException =========================================== class **FileLoaderImportCircularReferenceException** extends [FileLoaderLoadException](fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") Exception class for when a circular reference is detected when importing resources. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $resources, int $code = null, [Exception](http://php.net/Exception) $previous = null) | | | | [varToString](#method_varToString)($var) | from [FileLoaderLoadException](fileloaderloadexception#method_varToString "Symfony\Component\Config\Exception\FileLoaderLoadException") | Details ------- ### \_\_construct(array $resources, int $code = null, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | array | $resources | | | int | $code | The error code | | [Exception](http://php.net/Exception) | $previous | A previous exception | ### protected varToString($var) #### Parameters | | | | | --- | --- | --- | | | $var | | symfony FileLoaderLoadException FileLoaderLoadException ======================== class **FileLoaderLoadException** extends [Exception](http://php.net/Exception) Exception class for when a resource cannot be loaded or imported. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resource, string $sourceResource = null, int $code = null, [Exception](http://php.net/Exception) $previous = null, string $type = null) | | | | [varToString](#method_varToString)($var) | | Details ------- ### \_\_construct(string $resource, string $sourceResource = null, int $code = null, [Exception](http://php.net/Exception) $previous = null, string $type = null) #### Parameters | | | | | --- | --- | --- | | string | $resource | The resource that could not be imported | | string | $sourceResource | The original resource importing the new resource | | int | $code | The error code | | [Exception](http://php.net/Exception) | $previous | A previous exception | | string | $type | The type of resource | ### protected varToString($var) #### Parameters | | | | | --- | --- | --- | | | $var | | symfony Symfony\Component\Security\Core Symfony\Component\Security\Core =============================== Namespaces ---------- [Symfony\Component\Security\Core\Authentication](core/authentication)[Symfony\Component\Security\Core\Authorization](core/authorization)[Symfony\Component\Security\Core\Encoder](core/encoder)[Symfony\Component\Security\Core\Event](core/event)[Symfony\Component\Security\Core\Exception](core/exception)[Symfony\Component\Security\Core\Role](core/role)[Symfony\Component\Security\Core\User](core/user)[Symfony\Component\Security\Core\Validator](core/validator) Classes ------- | | | | --- | --- | | [AuthenticationEvents](core/authenticationevents "Symfony\Component\Security\Core\AuthenticationEvents") | | | [Security](core/security "Symfony\Component\Security\Core\Security") | Helper class for commonly-needed security tasks. | symfony Symfony\Component\Security\Http Symfony\Component\Security\Http =============================== Namespaces ---------- [Symfony\Component\Security\Http\Authentication](http/authentication)[Symfony\Component\Security\Http\Authorization](http/authorization)[Symfony\Component\Security\Http\Controller](http/controller)[Symfony\Component\Security\Http\EntryPoint](http/entrypoint)[Symfony\Component\Security\Http\Event](http/event)[Symfony\Component\Security\Http\Firewall](http/firewall)[Symfony\Component\Security\Http\Logout](http/logout)[Symfony\Component\Security\Http\RememberMe](http/rememberme)[Symfony\Component\Security\Http\Session](http/session)[Symfony\Component\Security\Http\Util](http/util) Classes ------- | | | | --- | --- | | [AccessMap](http/accessmap "Symfony\Component\Security\Http\AccessMap") | AccessMap allows configuration of different access control rules for specific parts of the website. | | [Firewall](http/firewall "Symfony\Component\Security\Http\Firewall") | Firewall uses a FirewallMap to register security listeners for the given request. | | [FirewallMap](http/firewallmap "Symfony\Component\Security\Http\FirewallMap") | FirewallMap allows configuration of different firewalls for specific parts of the website. | | [HttpUtils](http/httputils "Symfony\Component\Security\Http\HttpUtils") | Encapsulates the logic needed to create sub-requests, redirect the user, and match URLs. | | [ParameterBagUtils](http/parameterbagutils "Symfony\Component\Security\Http\ParameterBagUtils") | | | [SecurityEvents](http/securityevents "Symfony\Component\Security\Http\SecurityEvents") | | Interfaces ---------- | | | | --- | --- | | *[AccessMapInterface](http/accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface")* | AccessMap allows configuration of different access control rules for specific parts of the website. | | *[FirewallMapInterface](http/firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface")* | This interface must be implemented by firewall maps. | symfony Symfony\Component\Security\Guard Symfony\Component\Security\Guard ================================ Namespaces ---------- [Symfony\Component\Security\Guard\Authenticator](guard/authenticator)[Symfony\Component\Security\Guard\Firewall](guard/firewall)[Symfony\Component\Security\Guard\Provider](guard/provider)[Symfony\Component\Security\Guard\Token](guard/token) Classes ------- | | | | --- | --- | | [AbstractGuardAuthenticator](guard/abstractguardauthenticator "Symfony\Component\Security\Guard\AbstractGuardAuthenticator") | An optional base class that creates a PostAuthenticationGuardToken for you. | | [GuardAuthenticatorHandler](guard/guardauthenticatorhandler "Symfony\Component\Security\Guard\GuardAuthenticatorHandler") | A utility class that does much of the *work* during the guard authentication process. | Interfaces ---------- | | | | --- | --- | | *[AuthenticatorInterface](guard/authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")* | The interface for all "guard" authenticators. | symfony Symfony\Component\Security\Csrf Symfony\Component\Security\Csrf =============================== Namespaces ---------- [Symfony\Component\Security\Csrf\Exception](csrf/exception)[Symfony\Component\Security\Csrf\TokenGenerator](csrf/tokengenerator)[Symfony\Component\Security\Csrf\TokenStorage](csrf/tokenstorage) Classes ------- | | | | --- | --- | | [CsrfToken](csrf/csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | A CSRF token. | | [CsrfTokenManager](csrf/csrftokenmanager "Symfony\Component\Security\Csrf\CsrfTokenManager") | Default implementation of {@link CsrfTokenManagerInterface}. | Interfaces ---------- | | | | --- | --- | | *[CsrfTokenManagerInterface](csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface")* | Manages CSRF tokens. | symfony Symfony\Component\Security\Core\Exception Symfony\Component\Security\Core\Exception ========================================= Classes ------- | | | | --- | --- | | [AccessDeniedException](exception/accessdeniedexception "Symfony\Component\Security\Core\Exception\AccessDeniedException") | AccessDeniedException is thrown when the account has not the required role. | | [AccountExpiredException](exception/accountexpiredexception "Symfony\Component\Security\Core\Exception\AccountExpiredException") | AccountExpiredException is thrown when the user account has expired. | | [AccountStatusException](exception/accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") | AccountStatusException is the base class for authentication exceptions caused by the user account status. | | [AuthenticationCredentialsNotFoundException](exception/authenticationcredentialsnotfoundexception "Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException") | AuthenticationCredentialsNotFoundException is thrown when an authentication is rejected because no Token is available. | | [AuthenticationException](exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | AuthenticationException is the base class for all authentication exceptions. | | [AuthenticationExpiredException](exception/authenticationexpiredexception "Symfony\Component\Security\Core\Exception\AuthenticationExpiredException") | AuthenticationServiceException is thrown when an authenticated token becomes un-authenticated between requests. | | [AuthenticationServiceException](exception/authenticationserviceexception "Symfony\Component\Security\Core\Exception\AuthenticationServiceException") | AuthenticationServiceException is thrown when an authentication request could not be processed due to a system problem. | | [BadCredentialsException](exception/badcredentialsexception "Symfony\Component\Security\Core\Exception\BadCredentialsException") | BadCredentialsException is thrown when the user credentials are invalid. | | [CookieTheftException](exception/cookietheftexception "Symfony\Component\Security\Core\Exception\CookieTheftException") | This exception is thrown when the RememberMeServices implementation detects that a presented cookie has already been used by someone else. | | [CredentialsExpiredException](exception/credentialsexpiredexception "Symfony\Component\Security\Core\Exception\CredentialsExpiredException") | CredentialsExpiredException is thrown when the user account credentials have expired. | | [CustomUserMessageAuthenticationException](exception/customusermessageauthenticationexception "Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException") | An authentication exception where you can control the message shown to the user. | | [DisabledException](exception/disabledexception "Symfony\Component\Security\Core\Exception\DisabledException") | DisabledException is thrown when the user account is disabled. | | [InsufficientAuthenticationException](exception/insufficientauthenticationexception "Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException") | InsufficientAuthenticationException is thrown if the user credentials are not sufficiently trusted. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Security\Core\Exception\InvalidArgumentException") | Base InvalidArgumentException for the Security component. | | [InvalidCsrfTokenException](exception/invalidcsrftokenexception "Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException") | This exception is thrown when the csrf token is invalid. | | [LockedException](exception/lockedexception "Symfony\Component\Security\Core\Exception\LockedException") | LockedException is thrown if the user account is locked. | | [LogicException](exception/logicexception "Symfony\Component\Security\Core\Exception\LogicException") | Base LogicException for the Security component. | | [LogoutException](exception/logoutexception "Symfony\Component\Security\Core\Exception\LogoutException") | LogoutException is thrown when the account cannot be logged out. | | [ProviderNotFoundException](exception/providernotfoundexception "Symfony\Component\Security\Core\Exception\ProviderNotFoundException") | ProviderNotFoundException is thrown when no AuthenticationProviderInterface instance supports an authentication Token. | | [RuntimeException](exception/runtimeexception "Symfony\Component\Security\Core\Exception\RuntimeException") | Base RuntimeException for the Security component. | | [SessionUnavailableException](exception/sessionunavailableexception "Symfony\Component\Security\Core\Exception\SessionUnavailableException") | This exception is thrown when no session is available. | | [TokenNotFoundException](exception/tokennotfoundexception "Symfony\Component\Security\Core\Exception\TokenNotFoundException") | TokenNotFoundException is thrown if a Token cannot be found. | | [UnsupportedUserException](exception/unsupporteduserexception "Symfony\Component\Security\Core\Exception\UnsupportedUserException") | This exception is thrown when an account is reloaded from a provider which doesn't support the passed implementation of UserInterface. | | [UsernameNotFoundException](exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | UsernameNotFoundException is thrown if a User cannot be found by its username. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Security\Core\Exception\ExceptionInterface")* | Base ExceptionInterface for the Security component. |
programming_docs
symfony Symfony\Component\Security\Core\Validator Symfony\Component\Security\Core\Validator ========================================= Namespaces ---------- [Symfony\Component\Security\Core\Validator\Constraints](validator/constraints) symfony Symfony\Component\Security\Core\User Symfony\Component\Security\Core\User ==================================== Classes ------- | | | | --- | --- | | [ChainUserProvider](user/chainuserprovider "Symfony\Component\Security\Core\User\ChainUserProvider") | Chain User Provider. | | [InMemoryUserProvider](user/inmemoryuserprovider "Symfony\Component\Security\Core\User\InMemoryUserProvider") | InMemoryUserProvider is a simple non persistent user provider. | | [LdapUserProvider](user/ldapuserprovider "Symfony\Component\Security\Core\User\LdapUserProvider") | LdapUserProvider is a simple user provider on top of ldap. | | [MissingUserProvider](user/missinguserprovider "Symfony\Component\Security\Core\User\MissingUserProvider") | MissingUserProvider is a dummy user provider used to throw proper exception when a firewall requires a user provider but none was defined. | | [User](user/user "Symfony\Component\Security\Core\User\User") | User is the user implementation used by the in-memory user provider. | | [UserChecker](user/userchecker "Symfony\Component\Security\Core\User\UserChecker") | UserChecker checks the user account flags. | Interfaces ---------- | | | | --- | --- | | *[AdvancedUserInterface](user/advanceduserinterface "Symfony\Component\Security\Core\User\AdvancedUserInterface")* deprecated | Adds extra features to a user class related to account status flags. | | *[EquatableInterface](user/equatableinterface "Symfony\Component\Security\Core\User\EquatableInterface")* | EquatableInterface used to test if two objects are equal in security and re-authentication context. | | *[UserCheckerInterface](user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface")* | Implement to throw AccountStatusException during the authentication process. | | *[UserInterface](user/userinterface "Symfony\Component\Security\Core\User\UserInterface")* | Represents the interface that all user classes must implement. | | *[UserProviderInterface](user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface")* | Represents a class that loads UserInterface objects from some source for the authentication system. | symfony Symfony\Component\Security\Core\Authentication Symfony\Component\Security\Core\Authentication ============================================== Namespaces ---------- [Symfony\Component\Security\Core\Authentication\Provider](authentication/provider)[Symfony\Component\Security\Core\Authentication\RememberMe](authentication/rememberme)[Symfony\Component\Security\Core\Authentication\Token](authentication/token) Classes ------- | | | | --- | --- | | [AuthenticationProviderManager](authentication/authenticationprovidermanager "Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager") | AuthenticationProviderManager uses a list of AuthenticationProviderInterface instances to authenticate a Token. | | [AuthenticationTrustResolver](authentication/authenticationtrustresolver "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver") | The default implementation of the authentication trust resolver. | Interfaces ---------- | | | | --- | --- | | *[AuthenticationManagerInterface](authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface")* | AuthenticationManagerInterface is the interface for authentication managers, which process Token authentication. | | *[AuthenticationTrustResolverInterface](authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface")* | Interface for resolving the authentication status of a given token. | | *[SimpleAuthenticatorInterface](authentication/simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface")* | | symfony Symfony\Component\Security\Core\Authorization Symfony\Component\Security\Core\Authorization ============================================= Namespaces ---------- [Symfony\Component\Security\Core\Authorization\Voter](authorization/voter) Classes ------- | | | | --- | --- | | [AccessDecisionManager](authorization/accessdecisionmanager "Symfony\Component\Security\Core\Authorization\AccessDecisionManager") | AccessDecisionManager is the base class for all access decision managers that use decision voters. | | [AuthorizationChecker](authorization/authorizationchecker "Symfony\Component\Security\Core\Authorization\AuthorizationChecker") | AuthorizationChecker is the main authorization point of the Security component. | | [ExpressionLanguage](authorization/expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") | Adds some function to the default ExpressionLanguage. | | [ExpressionLanguageProvider](authorization/expressionlanguageprovider "Symfony\Component\Security\Core\Authorization\ExpressionLanguageProvider") | Define some ExpressionLanguage functions. | | [TraceableAccessDecisionManager](authorization/traceableaccessdecisionmanager "Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager") | Decorates the original AccessDecisionManager class to log information about the security voters and the decisions made by them. | Interfaces ---------- | | | | --- | --- | | *[AccessDecisionManagerInterface](authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface")* | AccessDecisionManagerInterface makes authorization decisions. | | *[AuthorizationCheckerInterface](authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface")* | The AuthorizationCheckerInterface. | symfony Symfony\Component\Security\Core\Event Symfony\Component\Security\Core\Event ===================================== Classes ------- | | | | --- | --- | | [AuthenticationEvent](event/authenticationevent "Symfony\Component\Security\Core\Event\AuthenticationEvent") | This is a general purpose authentication event. | | [AuthenticationFailureEvent](event/authenticationfailureevent "Symfony\Component\Security\Core\Event\AuthenticationFailureEvent") | This event is dispatched on authentication failure. | symfony Security Security ========= class **Security** Helper class for commonly-needed security tasks. Constants --------- | | | | --- | --- | | ACCESS\_DENIED\_ERROR | | | AUTHENTICATION\_ERROR | | | LAST\_USERNAME | | | MAX\_USERNAME\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(ContainerInterface $container) | | | [UserInterface](user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|null | [getUser](#method_getUser)() | | | bool | [isGranted](#method_isGranted)(mixed $attributes, mixed $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. | | | [TokenInterface](authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | [getToken](#method_getToken)() | | Details ------- ### \_\_construct(ContainerInterface $container) #### Parameters | | | | | --- | --- | --- | | ContainerInterface | $container | | ### [UserInterface](user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|null getUser() #### Return Value | | | | --- | --- | | [UserInterface](user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|null | | ### bool isGranted(mixed $attributes, mixed $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. #### Parameters | | | | | --- | --- | --- | | mixed | $attributes | | | mixed | $subject | | #### Return Value | | | | --- | --- | | bool | | ### [TokenInterface](authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null getToken() #### Return Value | | | | --- | --- | | [TokenInterface](authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | | symfony AuthenticationEvents AuthenticationEvents ===================== class **AuthenticationEvents** Constants --------- | | | | --- | --- | | AUTHENTICATION\_SUCCESS | *The AUTHENTICATION\_SUCCESS event occurs after a user is authenticated by one provider.* | | AUTHENTICATION\_FAILURE | *The AUTHENTICATION\_FAILURE event occurs after a user cannot be authenticated by any of the providers.* | symfony Symfony\Component\Security\Core\Role Symfony\Component\Security\Core\Role ==================================== Classes ------- | | | | --- | --- | | [Role](role/role "Symfony\Component\Security\Core\Role\Role") | Role is a simple implementation representing a role identified by a string. | | [RoleHierarchy](role/rolehierarchy "Symfony\Component\Security\Core\Role\RoleHierarchy") | RoleHierarchy defines a role hierarchy. | | [SwitchUserRole](role/switchuserrole "Symfony\Component\Security\Core\Role\SwitchUserRole") | SwitchUserRole is used when the current user temporarily impersonates another one. | Interfaces ---------- | | | | --- | --- | | *[RoleHierarchyInterface](role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface")* | RoleHierarchyInterface is the interface for a role hierarchy. | symfony Symfony\Component\Security\Core\Encoder Symfony\Component\Security\Core\Encoder ======================================= Classes ------- | | | | --- | --- | | [Argon2iPasswordEncoder](encoder/argon2ipasswordencoder "Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder") | Argon2iPasswordEncoder uses the Argon2i hashing algorithm. | | [BCryptPasswordEncoder](encoder/bcryptpasswordencoder "Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder") | | | [BasePasswordEncoder](encoder/basepasswordencoder "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | BasePasswordEncoder is the base class for all password encoders. | | [EncoderFactory](encoder/encoderfactory "Symfony\Component\Security\Core\Encoder\EncoderFactory") | A generic encoder factory implementation. | | [MessageDigestPasswordEncoder](encoder/messagedigestpasswordencoder "Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder") | MessageDigestPasswordEncoder uses a message digest algorithm. | | [Pbkdf2PasswordEncoder](encoder/pbkdf2passwordencoder "Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder") | Pbkdf2PasswordEncoder uses the PBKDF2 (Password-Based Key Derivation Function 2). | | [PlaintextPasswordEncoder](encoder/plaintextpasswordencoder "Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder") | PlaintextPasswordEncoder does not do any encoding. | | [UserPasswordEncoder](encoder/userpasswordencoder "Symfony\Component\Security\Core\Encoder\UserPasswordEncoder") | A generic password encoder. | Interfaces ---------- | | | | --- | --- | | *[EncoderAwareInterface](encoder/encoderawareinterface "Symfony\Component\Security\Core\Encoder\EncoderAwareInterface")* | | | *[EncoderFactoryInterface](encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface")* | EncoderFactoryInterface to support different encoders for different accounts. | | *[PasswordEncoderInterface](encoder/passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface")* | PasswordEncoderInterface is the interface for all encoders. | | *[SelfSaltingEncoderInterface](encoder/selfsaltingencoderinterface "Symfony\Component\Security\Core\Encoder\SelfSaltingEncoderInterface")* | SelfSaltingEncoderInterface is a marker interface for encoders that do not require a user-generated salt. | | *[UserPasswordEncoderInterface](encoder/userpasswordencoderinterface "Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface")* | UserPasswordEncoderInterface is the interface for the password encoder service. | symfony RoleHierarchy RoleHierarchy ============== class **RoleHierarchy** implements [RoleHierarchyInterface](rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") RoleHierarchy defines a role hierarchy. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $map | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $hierarchy) | | | [Role](role "Symfony\Component\Security\Core\Role\Role")[] | [getReachableRoles](#method_getReachableRoles)(array $roles) Returns an array of all reachable roles by the given ones. | | | | [buildRoleMap](#method_buildRoleMap)() | | Details ------- ### \_\_construct(array $hierarchy) #### Parameters | | | | | --- | --- | --- | | array | $hierarchy | An array defining the hierarchy | ### [Role](role "Symfony\Component\Security\Core\Role\Role")[] getReachableRoles(array $roles) Returns an array of all reachable roles by the given ones. Reachable roles are the roles directly assigned but also all roles that are transitively reachable from them in the role hierarchy. #### Parameters | | | | | --- | --- | --- | | array | $roles | An array of directly assigned roles | #### Return Value | | | | --- | --- | | [Role](role "Symfony\Component\Security\Core\Role\Role")[] | An array of all reachable roles | ### protected buildRoleMap() symfony SwitchUserRole SwitchUserRole =============== class **SwitchUserRole** extends [Role](role "Symfony\Component\Security\Core\Role\Role") SwitchUserRole is used when the current user temporarily impersonates another one. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $role, [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $source) | | | string | [getRole](#method_getRole)() Returns a string representation of the role. | from [Role](role#method_getRole "Symfony\Component\Security\Core\Role\Role") | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getSource](#method_getSource)() Returns the original Token. | | Details ------- ### \_\_construct(string $role, [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $source) #### Parameters | | | | | --- | --- | --- | | string | $role | | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $source | The original token | ### string getRole() Returns a string representation of the role. #### Return Value | | | | --- | --- | | string | | ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getSource() Returns the original Token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | The original TokenInterface instance | symfony Role Role ===== class **Role** Role is a simple implementation representing a role identified by a string. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $role) | | | string | [getRole](#method_getRole)() Returns a string representation of the role. | | Details ------- ### \_\_construct(string $role) #### Parameters | | | | | --- | --- | --- | | string | $role | | ### string getRole() Returns a string representation of the role. #### Return Value | | | | --- | --- | | string | | symfony RoleHierarchyInterface RoleHierarchyInterface ======================= interface **RoleHierarchyInterface** RoleHierarchyInterface is the interface for a role hierarchy. Methods ------- | | | | | --- | --- | --- | | [Role](role "Symfony\Component\Security\Core\Role\Role")[] | [getReachableRoles](#method_getReachableRoles)(array $roles) Returns an array of all reachable roles by the given ones. | | Details ------- ### [Role](role "Symfony\Component\Security\Core\Role\Role")[] getReachableRoles(array $roles) Returns an array of all reachable roles by the given ones. Reachable roles are the roles directly assigned but also all roles that are transitively reachable from them in the role hierarchy. #### Parameters | | | | | --- | --- | --- | | array | $roles | An array of directly assigned roles | #### Return Value | | | | --- | --- | | [Role](role "Symfony\Component\Security\Core\Role\Role")[] | An array of all reachable roles | symfony Symfony\Component\Security\Core\Validator\Constraints Symfony\Component\Security\Core\Validator\Constraints ===================================================== Classes ------- | | | | --- | --- | | [UserPassword](constraints/userpassword "Symfony\Component\Security\Core\Validator\Constraints\UserPassword") | | | [UserPasswordValidator](constraints/userpasswordvalidator "Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator") | | symfony UserPasswordValidator UserPasswordValidator ====================== class **UserPasswordValidator** extends [ConstraintValidator](../../../../validator/constraintvalidator "Symfony\Component\Validator\ConstraintValidator") Constants --------- | | | | --- | --- | | PRETTY\_DATE | *Whether to format {@link \DateTime} objects as RFC-3339 dates ("Y-m-d H:i:s").* | | OBJECT\_TO\_STRING | *Whether to cast objects with a "\_\_toString()" method to strings.* | Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ExecutionContextInterface](../../../../validator/context/executioncontextinterface "Symfony\Component\Validator\Context\ExecutionContextInterface") | $context | | from [ConstraintValidator](../../../../validator/constraintvalidator#property_context "Symfony\Component\Validator\ConstraintValidator") | Methods ------- | | | | | --- | --- | --- | | | [initialize](#method_initialize)([ExecutionContextInterface](../../../../validator/context/executioncontextinterface "Symfony\Component\Validator\Context\ExecutionContextInterface") $context) Initializes the constraint validator. | from [ConstraintValidator](../../../../validator/constraintvalidator#method_initialize "Symfony\Component\Validator\ConstraintValidator") | | string | [formatTypeOf](#method_formatTypeOf)(mixed $value) Returns a string representation of the type of the value. | from [ConstraintValidator](../../../../validator/constraintvalidator#method_formatTypeOf "Symfony\Component\Validator\ConstraintValidator") | | string | [formatValue](#method_formatValue)(mixed $value, int $format = 0) Returns a string representation of the value. | from [ConstraintValidator](../../../../validator/constraintvalidator#method_formatValue "Symfony\Component\Validator\ConstraintValidator") | | string | [formatValues](#method_formatValues)(array $values, int $format = 0) Returns a string representation of a list of values. | from [ConstraintValidator](../../../../validator/constraintvalidator#method_formatValues "Symfony\Component\Validator\ConstraintValidator") | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [EncoderFactoryInterface](../../encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory) | | | | [validate](#method_validate)($password, [Constraint](../../../../validator/constraint "Symfony\Component\Validator\Constraint") $constraint) Checks if the passed value is valid. | | Details ------- ### initialize([ExecutionContextInterface](../../../../validator/context/executioncontextinterface "Symfony\Component\Validator\Context\ExecutionContextInterface") $context) Initializes the constraint validator. #### Parameters | | | | | --- | --- | --- | | [ExecutionContextInterface](../../../../validator/context/executioncontextinterface "Symfony\Component\Validator\Context\ExecutionContextInterface") | $context | The current validation context | ### protected string formatTypeOf(mixed $value) Returns a string representation of the type of the value. This method should be used if you pass the type of a value as message parameter to a constraint violation. Note that such parameters should usually not be included in messages aimed at non-technical people. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to return the type of | #### Return Value | | | | --- | --- | | string | The type of the value | ### protected string formatValue(mixed $value, int $format = 0) Returns a string representation of the value. This method returns the equivalent PHP tokens for most scalar types (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped in double quotes ("). Objects, arrays and resources are formatted as "object", "array" and "resource". If the $format bitmask contains the PRETTY\_DATE bit, then {@link \DateTime} objects will be formatted as RFC-3339 dates ("Y-m-d H:i:s"). Be careful when passing message parameters to a constraint violation that (may) contain objects, arrays or resources. These parameters should only be displayed for technical users. Non-technical users won't know what an "object", "array" or "resource" is and will be confused by the violation message. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to format as string | | int | $format | A bitwise combination of the format constants in this class | #### Return Value | | | | --- | --- | | string | The string representation of the passed value | ### protected string formatValues(array $values, int $format = 0) Returns a string representation of a list of values. Each of the values is converted to a string using {@link formatValue()}. The values are then concatenated with commas. #### Parameters | | | | | --- | --- | --- | | array | $values | A list of values | | int | $format | A bitwise combination of the format constants in this class | #### Return Value | | | | --- | --- | | string | The string representation of the value list | #### See also | | | | --- | --- | | formatValue() | | ### \_\_construct([TokenStorageInterface](../../authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [EncoderFactoryInterface](../../encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [EncoderFactoryInterface](../../encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") | $encoderFactory | | ### validate($password, [Constraint](../../../../validator/constraint "Symfony\Component\Validator\Constraint") $constraint) Checks if the passed value is valid. #### Parameters | | | | | --- | --- | --- | | | $password | | | [Constraint](../../../../validator/constraint "Symfony\Component\Validator\Constraint") | $constraint | The constraint for the validation |
programming_docs
symfony UserPassword UserPassword ============= class **UserPassword** extends [Constraint](../../../../validator/constraint "Symfony\Component\Validator\Constraint") Constants --------- | | | | --- | --- | | DEFAULT\_GROUP | *The name of the group given to all constraints with no explicit group.* | | CLASS\_CONSTRAINT | *Marks a constraint that can be put onto classes.* | | PROPERTY\_CONSTRAINT | *Marks a constraint that can be put onto properties.* | Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $errorNames | Maps error codes to the names of their constants. | from [Constraint](../../../../validator/constraint#property_errorNames "Symfony\Component\Validator\Constraint") | | mixed | $payload | Domain-specific data attached to a constraint. | from [Constraint](../../../../validator/constraint#property_payload "Symfony\Component\Validator\Constraint") | | array | $groups | The groups that the constraint belongs to | from [Constraint](../../../../validator/constraint#property_groups "Symfony\Component\Validator\Constraint") | | | $message | | | | | $service | | | Methods ------- | | | | | --- | --- | --- | | static string | [getErrorName](#method_getErrorName)(string $errorCode) Returns the name of the given error code. | from [Constraint](../../../../validator/constraint#method_getErrorName "Symfony\Component\Validator\Constraint") | | | [\_\_construct](#method___construct)(mixed $options = null) Initializes the constraint with options. | from [Constraint](../../../../validator/constraint#method___construct "Symfony\Component\Validator\Constraint") | | | [\_\_set](#method___set)(string $option, mixed $value) Sets the value of a lazily initialized option. | from [Constraint](../../../../validator/constraint#method___set "Symfony\Component\Validator\Constraint") | | mixed | [\_\_get](#method___get)(string $option) Returns the value of a lazily initialized option. | from [Constraint](../../../../validator/constraint#method___get "Symfony\Component\Validator\Constraint") | | bool | [\_\_isset](#method___isset)(string $option) | from [Constraint](../../../../validator/constraint#method___isset "Symfony\Component\Validator\Constraint") | | | [addImplicitGroupName](#method_addImplicitGroupName)(string $group) Adds the given group if this constraint is in the Default group. | from [Constraint](../../../../validator/constraint#method_addImplicitGroupName "Symfony\Component\Validator\Constraint") | | string | [getDefaultOption](#method_getDefaultOption)() Returns the name of the default option. | from [Constraint](../../../../validator/constraint#method_getDefaultOption "Symfony\Component\Validator\Constraint") | | array | [getRequiredOptions](#method_getRequiredOptions)() Returns the name of the required options. | from [Constraint](../../../../validator/constraint#method_getRequiredOptions "Symfony\Component\Validator\Constraint") | | string | [validatedBy](#method_validatedBy)() Returns the name of the class that validates this constraint. | | | string|array | [getTargets](#method_getTargets)() Returns whether the constraint can be put onto classes, properties or both. | from [Constraint](../../../../validator/constraint#method_getTargets "Symfony\Component\Validator\Constraint") | | array | [\_\_sleep](#method___sleep)() Optimizes the serialized value to minimize storage space. | from [Constraint](../../../../validator/constraint#method___sleep "Symfony\Component\Validator\Constraint") | Details ------- ### static string getErrorName(string $errorCode) Returns the name of the given error code. #### Parameters | | | | | --- | --- | --- | | string | $errorCode | The error code | #### Return Value | | | | --- | --- | | string | The name of the error code | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../../validator/exception/invalidargumentexception "Symfony\Component\Validator\Exception\InvalidArgumentException") | If the error code does not exist | ### \_\_construct(mixed $options = null) Initializes the constraint with options. You should pass an associative array. The keys should be the names of existing properties in this class. The values should be the value for these properties. Alternatively you can override the method getDefaultOption() to return the name of an existing property. If no associative array is passed, this property is set instead. You can force that certain options are set by overriding getRequiredOptions() to return the names of these options. If any option is not set here, an exception is thrown. #### Parameters | | | | | --- | --- | --- | | mixed | $options | The options (as associative array) or the value for the default option (any other type) | #### Exceptions | | | | --- | --- | | [InvalidOptionsException](../../../../validator/exception/invalidoptionsexception "Symfony\Component\Validator\Exception\InvalidOptionsException") | When you pass the names of non-existing options | | [MissingOptionsException](../../../../validator/exception/missingoptionsexception "Symfony\Component\Validator\Exception\MissingOptionsException") | When you don't pass any of the options returned by getRequiredOptions() | | [ConstraintDefinitionException](../../../../validator/exception/constraintdefinitionexception "Symfony\Component\Validator\Exception\ConstraintDefinitionException") | When you don't pass an associative array, but getDefaultOption() returns null | ### \_\_set(string $option, mixed $value) Sets the value of a lazily initialized option. Corresponding properties are added to the object on first access. Hence this method will be called at most once per constraint instance and option name. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | | mixed | $value | The value to set | #### Exceptions | | | | --- | --- | | [InvalidOptionsException](../../../../validator/exception/invalidoptionsexception "Symfony\Component\Validator\Exception\InvalidOptionsException") | If an invalid option name is given | ### mixed \_\_get(string $option) Returns the value of a lazily initialized option. Corresponding properties are added to the object on first access. Hence this method will be called at most once per constraint instance and option name. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Return Value | | | | --- | --- | | mixed | The value of the option | #### Exceptions | | | | --- | --- | | [InvalidOptionsException](../../../../validator/exception/invalidoptionsexception "Symfony\Component\Validator\Exception\InvalidOptionsException") | If an invalid option name is given | ### bool \_\_isset(string $option) #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Return Value | | | | --- | --- | | bool | | ### addImplicitGroupName(string $group) Adds the given group if this constraint is in the Default group. #### Parameters | | | | | --- | --- | --- | | string | $group | | ### string getDefaultOption() Returns the name of the default option. Override this method to define a default option. #### Return Value | | | | --- | --- | | string | | #### See also | | | | --- | --- | | \_\_construct() | | ### array getRequiredOptions() Returns the name of the required options. Override this method if you want to define required options. #### Return Value | | | | --- | --- | | array | | #### See also | | | | --- | --- | | \_\_construct() | | ### string validatedBy() Returns the name of the class that validates this constraint. By default, this is the fully qualified name of the constraint class suffixed with "Validator". You can override this method to change that behaviour. #### Return Value | | | | --- | --- | | string | | ### string|array getTargets() Returns whether the constraint can be put onto classes, properties or both. This method should return one or more of the constants Constraint::CLASS\_CONSTRAINT and Constraint::PROPERTY\_CONSTRAINT. #### Return Value | | | | --- | --- | | string|array | One or more constant values | ### array \_\_sleep() Optimizes the serialized value to minimize storage space. #### Return Value | | | | --- | --- | | array | The properties to serialize | symfony Argon2iPasswordEncoder Argon2iPasswordEncoder ======================= class **Argon2iPasswordEncoder** extends [BasePasswordEncoder](basepasswordencoder "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") implements [SelfSaltingEncoderInterface](selfsaltingencoderinterface "Symfony\Component\Security\Core\Encoder\SelfSaltingEncoderInterface") Argon2iPasswordEncoder uses the Argon2i hashing algorithm. Constants --------- | | | | --- | --- | | MAX\_PASSWORD\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | array | [demergePasswordAndSalt](#method_demergePasswordAndSalt)(string $mergedPasswordSalt) Demerges a merge password and salt string. | from [BasePasswordEncoder](basepasswordencoder#method_demergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | string | [mergePasswordAndSalt](#method_mergePasswordAndSalt)(string $password, string $salt) Merges a password and a salt. | from [BasePasswordEncoder](basepasswordencoder#method_mergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [comparePasswords](#method_comparePasswords)(string $password1, string $password2) Compares two passwords. | from [BasePasswordEncoder](basepasswordencoder#method_comparePasswords "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [isPasswordTooLong](#method_isPasswordTooLong)(string $password) Checks if the password is too long. | from [BasePasswordEncoder](basepasswordencoder#method_isPasswordTooLong "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | | [\_\_construct](#method___construct)(int $memoryCost = null, int $timeCost = null, int $threads = null) Argon2iPasswordEncoder constructor. | | | static | [isSupported](#method_isSupported)() | | | string | [encodePassword](#method_encodePassword)(string $raw, string $salt) Encodes the raw password. | | | bool | [isPasswordValid](#method_isPasswordValid)(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. | | Details ------- ### protected array demergePasswordAndSalt(string $mergedPasswordSalt) Demerges a merge password and salt string. #### Parameters | | | | | --- | --- | --- | | string | $mergedPasswordSalt | The merged password and salt string | #### Return Value | | | | --- | --- | | array | An array where the first element is the password and the second the salt | ### protected string mergePasswordAndSalt(string $password, string $salt) Merges a password and a salt. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to be used | | string | $salt | The salt to be used | #### Return Value | | | | --- | --- | | string | a merged password and salt | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected bool comparePasswords(string $password1, string $password2) Compares two passwords. This method implements a constant-time algorithm to compare passwords to avoid (remote) timing attacks. #### Parameters | | | | | --- | --- | --- | | string | $password1 | The first password | | string | $password2 | The second password | #### Return Value | | | | --- | --- | | bool | true if the two passwords are the same, false otherwise | ### protected bool isPasswordTooLong(string $password) Checks if the password is too long. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to check | #### Return Value | | | | --- | --- | | bool | true if the password is too long, false otherwise | ### \_\_construct(int $memoryCost = null, int $timeCost = null, int $threads = null) Argon2iPasswordEncoder constructor. #### Parameters | | | | | --- | --- | --- | | int | $memoryCost | memory usage of the algorithm | | int | $timeCost | number of iterations | | int | $threads | number of parallel threads | ### static isSupported() ### string encodePassword(string $raw, string $salt) Encodes the raw password. #### Parameters | | | | | --- | --- | --- | | string | $raw | The password to encode | | string | $salt | The salt | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. #### Parameters | | | | | --- | --- | --- | | string | $encoded | An encoded password | | string | $raw | A raw password | | string | $salt | The salt | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony BasePasswordEncoder BasePasswordEncoder ==================== abstract class **BasePasswordEncoder** implements [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") BasePasswordEncoder is the base class for all password encoders. Constants --------- | | | | --- | --- | | MAX\_PASSWORD\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | array | [demergePasswordAndSalt](#method_demergePasswordAndSalt)(string $mergedPasswordSalt) Demerges a merge password and salt string. | | | string | [mergePasswordAndSalt](#method_mergePasswordAndSalt)(string $password, string $salt) Merges a password and a salt. | | | bool | [comparePasswords](#method_comparePasswords)(string $password1, string $password2) Compares two passwords. | | | bool | [isPasswordTooLong](#method_isPasswordTooLong)(string $password) Checks if the password is too long. | | Details ------- ### protected array demergePasswordAndSalt(string $mergedPasswordSalt) Demerges a merge password and salt string. #### Parameters | | | | | --- | --- | --- | | string | $mergedPasswordSalt | The merged password and salt string | #### Return Value | | | | --- | --- | | array | An array where the first element is the password and the second the salt | ### protected string mergePasswordAndSalt(string $password, string $salt) Merges a password and a salt. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to be used | | string | $salt | The salt to be used | #### Return Value | | | | --- | --- | | string | a merged password and salt | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected bool comparePasswords(string $password1, string $password2) Compares two passwords. This method implements a constant-time algorithm to compare passwords to avoid (remote) timing attacks. #### Parameters | | | | | --- | --- | --- | | string | $password1 | The first password | | string | $password2 | The second password | #### Return Value | | | | --- | --- | | bool | true if the two passwords are the same, false otherwise | ### protected bool isPasswordTooLong(string $password) Checks if the password is too long. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to check | #### Return Value | | | | --- | --- | | bool | true if the password is too long, false otherwise | symfony EncoderFactoryInterface EncoderFactoryInterface ======================== interface **EncoderFactoryInterface** EncoderFactoryInterface to support different encoders for different accounts. Methods ------- | | | | | --- | --- | --- | | [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") | [getEncoder](#method_getEncoder)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|string $user) Returns the password encoder to use for the given account. | | Details ------- ### [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") getEncoder([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|string $user) Returns the password encoder to use for the given account. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|string | $user | A UserInterface instance or a class name | #### Return Value | | | | --- | --- | | [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | when no password encoder could be found for the user | symfony PasswordEncoderInterface PasswordEncoderInterface ========================= interface **PasswordEncoderInterface** PasswordEncoderInterface is the interface for all encoders. Methods ------- | | | | | --- | --- | --- | | string | [encodePassword](#method_encodePassword)(string $raw, string $salt) Encodes the raw password. | | | bool | [isPasswordValid](#method_isPasswordValid)(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. | | Details ------- ### string encodePassword(string $raw, string $salt) Encodes the raw password. #### Parameters | | | | | --- | --- | --- | | string | $raw | The password to encode | | string | $salt | The salt | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. #### Parameters | | | | | --- | --- | --- | | string | $encoded | An encoded password | | string | $raw | A raw password | | string | $salt | The salt | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony EncoderFactory EncoderFactory =============== class **EncoderFactory** implements [EncoderFactoryInterface](encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") A generic encoder factory implementation. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $encoders) | | | [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") | [getEncoder](#method_getEncoder)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|string $user) Returns the password encoder to use for the given account. | | Details ------- ### \_\_construct(array $encoders) #### Parameters | | | | | --- | --- | --- | | array | $encoders | | ### [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") getEncoder([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|string $user) Returns the password encoder to use for the given account. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|string | $user | A UserInterface instance or a class name | #### Return Value | | | | --- | --- | | [PasswordEncoderInterface](passwordencoderinterface "Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface") | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | when no password encoder could be found for the user |
programming_docs
symfony BCryptPasswordEncoder BCryptPasswordEncoder ====================== class **BCryptPasswordEncoder** extends [BasePasswordEncoder](basepasswordencoder "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") implements [SelfSaltingEncoderInterface](selfsaltingencoderinterface "Symfony\Component\Security\Core\Encoder\SelfSaltingEncoderInterface") Constants --------- | | | | --- | --- | | MAX\_PASSWORD\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | array | [demergePasswordAndSalt](#method_demergePasswordAndSalt)(string $mergedPasswordSalt) Demerges a merge password and salt string. | from [BasePasswordEncoder](basepasswordencoder#method_demergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | string | [mergePasswordAndSalt](#method_mergePasswordAndSalt)(string $password, string $salt) Merges a password and a salt. | from [BasePasswordEncoder](basepasswordencoder#method_mergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [comparePasswords](#method_comparePasswords)(string $password1, string $password2) Compares two passwords. | from [BasePasswordEncoder](basepasswordencoder#method_comparePasswords "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [isPasswordTooLong](#method_isPasswordTooLong)(string $password) Checks if the password is too long. | from [BasePasswordEncoder](basepasswordencoder#method_isPasswordTooLong "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | | [\_\_construct](#method___construct)(int $cost) | | | string | [encodePassword](#method_encodePassword)(string $raw, string $salt) Encodes the raw password. | | | bool | [isPasswordValid](#method_isPasswordValid)(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. | | Details ------- ### protected array demergePasswordAndSalt(string $mergedPasswordSalt) Demerges a merge password and salt string. #### Parameters | | | | | --- | --- | --- | | string | $mergedPasswordSalt | The merged password and salt string | #### Return Value | | | | --- | --- | | array | An array where the first element is the password and the second the salt | ### protected string mergePasswordAndSalt(string $password, string $salt) Merges a password and a salt. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to be used | | string | $salt | The salt to be used | #### Return Value | | | | --- | --- | | string | a merged password and salt | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected bool comparePasswords(string $password1, string $password2) Compares two passwords. This method implements a constant-time algorithm to compare passwords to avoid (remote) timing attacks. #### Parameters | | | | | --- | --- | --- | | string | $password1 | The first password | | string | $password2 | The second password | #### Return Value | | | | --- | --- | | bool | true if the two passwords are the same, false otherwise | ### protected bool isPasswordTooLong(string $password) Checks if the password is too long. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to check | #### Return Value | | | | --- | --- | | bool | true if the password is too long, false otherwise | ### \_\_construct(int $cost) #### Parameters | | | | | --- | --- | --- | | int | $cost | The algorithmic cost that should be used | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When no BCrypt encoder is available | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if cost is out of range | ### string encodePassword(string $raw, string $salt) Encodes the raw password. It doesn't work with PHP versions lower than 5.3.7, since the password compat library uses CRYPT\_BLOWFISH hash type with the "$2y$" salt prefix (which is not available in the early PHP versions). #### Parameters | | | | | --- | --- | --- | | string | $raw | The password to encode | | string | $salt | The salt | #### Return Value | | | | --- | --- | | string | The encoded password | #### Exceptions | | | | --- | --- | | [BadCredentialsException](../exception/badcredentialsexception "Symfony\Component\Security\Core\Exception\BadCredentialsException") | when the given password is too long | #### See also | | | | --- | --- | | <https://github.com/ircmaxell/password_compat/issues/10#issuecomment-11203833> | It is almost best to \*\*not\*\* pass a salt and let PHP generate one for you. | | <http://lxr.php.net/xref/PHP_5_5/ext/standard/password.c#111> | | ### bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. #### Parameters | | | | | --- | --- | --- | | string | $encoded | An encoded password | | string | $raw | A raw password | | string | $salt | The salt | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony UserPasswordEncoder UserPasswordEncoder ==================== class **UserPasswordEncoder** implements [UserPasswordEncoderInterface](userpasswordencoderinterface "Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface") A generic password encoder. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([EncoderFactoryInterface](encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory) | | | string | [encodePassword](#method_encodePassword)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $plainPassword) Encodes the plain password. | | | bool | [isPasswordValid](#method_isPasswordValid)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $raw) | | Details ------- ### \_\_construct([EncoderFactoryInterface](encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory) #### Parameters | | | | | --- | --- | --- | | [EncoderFactoryInterface](encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") | $encoderFactory | | ### string encodePassword([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $plainPassword) Encodes the plain password. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | The user | | string | $plainPassword | The password to encode | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $raw) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | The user | | string | $raw | A raw password | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony UserPasswordEncoderInterface UserPasswordEncoderInterface ============================= interface **UserPasswordEncoderInterface** UserPasswordEncoderInterface is the interface for the password encoder service. Methods ------- | | | | | --- | --- | --- | | string | [encodePassword](#method_encodePassword)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $plainPassword) Encodes the plain password. | | | bool | [isPasswordValid](#method_isPasswordValid)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $raw) | | Details ------- ### string encodePassword([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $plainPassword) Encodes the plain password. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | The user | | string | $plainPassword | The password to encode | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $raw) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | The user | | string | $raw | A raw password | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony MessageDigestPasswordEncoder MessageDigestPasswordEncoder ============================= class **MessageDigestPasswordEncoder** extends [BasePasswordEncoder](basepasswordencoder "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") MessageDigestPasswordEncoder uses a message digest algorithm. Constants --------- | | | | --- | --- | | MAX\_PASSWORD\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | array | [demergePasswordAndSalt](#method_demergePasswordAndSalt)(string $mergedPasswordSalt) Demerges a merge password and salt string. | from [BasePasswordEncoder](basepasswordencoder#method_demergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | string | [mergePasswordAndSalt](#method_mergePasswordAndSalt)(string $password, string $salt) Merges a password and a salt. | from [BasePasswordEncoder](basepasswordencoder#method_mergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [comparePasswords](#method_comparePasswords)(string $password1, string $password2) Compares two passwords. | from [BasePasswordEncoder](basepasswordencoder#method_comparePasswords "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [isPasswordTooLong](#method_isPasswordTooLong)(string $password) Checks if the password is too long. | from [BasePasswordEncoder](basepasswordencoder#method_isPasswordTooLong "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | | [\_\_construct](#method___construct)(string $algorithm = 'sha512', bool $encodeHashAsBase64 = true, int $iterations = 5000) | | | string | [encodePassword](#method_encodePassword)(string $raw, string $salt) Encodes the raw password. | | | bool | [isPasswordValid](#method_isPasswordValid)(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. | | Details ------- ### protected array demergePasswordAndSalt(string $mergedPasswordSalt) Demerges a merge password and salt string. #### Parameters | | | | | --- | --- | --- | | string | $mergedPasswordSalt | The merged password and salt string | #### Return Value | | | | --- | --- | | array | An array where the first element is the password and the second the salt | ### protected string mergePasswordAndSalt(string $password, string $salt) Merges a password and a salt. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to be used | | string | $salt | The salt to be used | #### Return Value | | | | --- | --- | | string | a merged password and salt | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected bool comparePasswords(string $password1, string $password2) Compares two passwords. This method implements a constant-time algorithm to compare passwords to avoid (remote) timing attacks. #### Parameters | | | | | --- | --- | --- | | string | $password1 | The first password | | string | $password2 | The second password | #### Return Value | | | | --- | --- | | bool | true if the two passwords are the same, false otherwise | ### protected bool isPasswordTooLong(string $password) Checks if the password is too long. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to check | #### Return Value | | | | --- | --- | | bool | true if the password is too long, false otherwise | ### \_\_construct(string $algorithm = 'sha512', bool $encodeHashAsBase64 = true, int $iterations = 5000) #### Parameters | | | | | --- | --- | --- | | string | $algorithm | The digest algorithm to use | | bool | $encodeHashAsBase64 | Whether to base64 encode the password hash | | int | $iterations | The number of iterations to use to stretch the password hash | ### string encodePassword(string $raw, string $salt) Encodes the raw password. #### Parameters | | | | | --- | --- | --- | | string | $raw | The password to encode | | string | $salt | The salt | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. #### Parameters | | | | | --- | --- | --- | | string | $encoded | An encoded password | | string | $raw | A raw password | | string | $salt | The salt | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony Pbkdf2PasswordEncoder Pbkdf2PasswordEncoder ====================== class **Pbkdf2PasswordEncoder** extends [BasePasswordEncoder](basepasswordencoder "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") Pbkdf2PasswordEncoder uses the PBKDF2 (Password-Based Key Derivation Function 2). Providing a high level of Cryptographic security, PBKDF2 is recommended by the National Institute of Standards and Technology (NIST). But also warrants a warning, using PBKDF2 (with a high number of iterations) slows down the process. PBKDF2 should be used with caution and care. Constants --------- | | | | --- | --- | | MAX\_PASSWORD\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | array | [demergePasswordAndSalt](#method_demergePasswordAndSalt)(string $mergedPasswordSalt) Demerges a merge password and salt string. | from [BasePasswordEncoder](basepasswordencoder#method_demergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | string | [mergePasswordAndSalt](#method_mergePasswordAndSalt)(string $password, string $salt) Merges a password and a salt. | from [BasePasswordEncoder](basepasswordencoder#method_mergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [comparePasswords](#method_comparePasswords)(string $password1, string $password2) Compares two passwords. | from [BasePasswordEncoder](basepasswordencoder#method_comparePasswords "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [isPasswordTooLong](#method_isPasswordTooLong)(string $password) Checks if the password is too long. | from [BasePasswordEncoder](basepasswordencoder#method_isPasswordTooLong "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | | [\_\_construct](#method___construct)(string $algorithm = 'sha512', bool $encodeHashAsBase64 = true, int $iterations = 1000, int $length = 40) | | | string | [encodePassword](#method_encodePassword)(string $raw, string $salt) Encodes the raw password. | | | bool | [isPasswordValid](#method_isPasswordValid)(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. | | Details ------- ### protected array demergePasswordAndSalt(string $mergedPasswordSalt) Demerges a merge password and salt string. #### Parameters | | | | | --- | --- | --- | | string | $mergedPasswordSalt | The merged password and salt string | #### Return Value | | | | --- | --- | | array | An array where the first element is the password and the second the salt | ### protected string mergePasswordAndSalt(string $password, string $salt) Merges a password and a salt. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to be used | | string | $salt | The salt to be used | #### Return Value | | | | --- | --- | | string | a merged password and salt | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected bool comparePasswords(string $password1, string $password2) Compares two passwords. This method implements a constant-time algorithm to compare passwords to avoid (remote) timing attacks. #### Parameters | | | | | --- | --- | --- | | string | $password1 | The first password | | string | $password2 | The second password | #### Return Value | | | | --- | --- | | bool | true if the two passwords are the same, false otherwise | ### protected bool isPasswordTooLong(string $password) Checks if the password is too long. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to check | #### Return Value | | | | --- | --- | | bool | true if the password is too long, false otherwise | ### \_\_construct(string $algorithm = 'sha512', bool $encodeHashAsBase64 = true, int $iterations = 1000, int $length = 40) #### Parameters | | | | | --- | --- | --- | | string | $algorithm | The digest algorithm to use | | bool | $encodeHashAsBase64 | Whether to base64 encode the password hash | | int | $iterations | The number of iterations to use to stretch the password hash | | int | $length | Length of derived key to create | ### string encodePassword(string $raw, string $salt) Encodes the raw password. #### Parameters | | | | | --- | --- | --- | | string | $raw | The password to encode | | string | $salt | The salt | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. #### Parameters | | | | | --- | --- | --- | | string | $encoded | An encoded password | | string | $raw | A raw password | | string | $salt | The salt | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise | symfony PlaintextPasswordEncoder PlaintextPasswordEncoder ========================= class **PlaintextPasswordEncoder** extends [BasePasswordEncoder](basepasswordencoder "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") PlaintextPasswordEncoder does not do any encoding. Constants --------- | | | | --- | --- | | MAX\_PASSWORD\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | array | [demergePasswordAndSalt](#method_demergePasswordAndSalt)(string $mergedPasswordSalt) Demerges a merge password and salt string. | from [BasePasswordEncoder](basepasswordencoder#method_demergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | string | [mergePasswordAndSalt](#method_mergePasswordAndSalt)(string $password, string $salt) Merges a password and a salt. | from [BasePasswordEncoder](basepasswordencoder#method_mergePasswordAndSalt "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [comparePasswords](#method_comparePasswords)(string $password1, string $password2) Compares two passwords. | from [BasePasswordEncoder](basepasswordencoder#method_comparePasswords "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | bool | [isPasswordTooLong](#method_isPasswordTooLong)(string $password) Checks if the password is too long. | from [BasePasswordEncoder](basepasswordencoder#method_isPasswordTooLong "Symfony\Component\Security\Core\Encoder\BasePasswordEncoder") | | | [\_\_construct](#method___construct)(bool $ignorePasswordCase = false) | | | string | [encodePassword](#method_encodePassword)(string $raw, string $salt) Encodes the raw password. | | | bool | [isPasswordValid](#method_isPasswordValid)(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. | | Details ------- ### protected array demergePasswordAndSalt(string $mergedPasswordSalt) Demerges a merge password and salt string. #### Parameters | | | | | --- | --- | --- | | string | $mergedPasswordSalt | The merged password and salt string | #### Return Value | | | | --- | --- | | array | An array where the first element is the password and the second the salt | ### protected string mergePasswordAndSalt(string $password, string $salt) Merges a password and a salt. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to be used | | string | $salt | The salt to be used | #### Return Value | | | | --- | --- | | string | a merged password and salt | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### protected bool comparePasswords(string $password1, string $password2) Compares two passwords. This method implements a constant-time algorithm to compare passwords to avoid (remote) timing attacks. #### Parameters | | | | | --- | --- | --- | | string | $password1 | The first password | | string | $password2 | The second password | #### Return Value | | | | --- | --- | | bool | true if the two passwords are the same, false otherwise | ### protected bool isPasswordTooLong(string $password) Checks if the password is too long. #### Parameters | | | | | --- | --- | --- | | string | $password | The password to check | #### Return Value | | | | --- | --- | | bool | true if the password is too long, false otherwise | ### \_\_construct(bool $ignorePasswordCase = false) #### Parameters | | | | | --- | --- | --- | | bool | $ignorePasswordCase | Compare password case-insensitive | ### string encodePassword(string $raw, string $salt) Encodes the raw password. #### Parameters | | | | | --- | --- | --- | | string | $raw | The password to encode | | string | $salt | The salt | #### Return Value | | | | --- | --- | | string | The encoded password | ### bool isPasswordValid(string $encoded, string $raw, string $salt) Checks a raw password against an encoded password. #### Parameters | | | | | --- | --- | --- | | string | $encoded | An encoded password | | string | $raw | A raw password | | string | $salt | The salt | #### Return Value | | | | --- | --- | | bool | true if the password is valid, false otherwise |
programming_docs
symfony EncoderAwareInterface EncoderAwareInterface ====================== interface **EncoderAwareInterface** Methods ------- | | | | | --- | --- | --- | | string | [getEncoderName](#method_getEncoderName)() Gets the name of the encoder used to encode the password. | | Details ------- ### string getEncoderName() Gets the name of the encoder used to encode the password. If the method returns null, the standard way to retrieve the encoder will be used instead. #### Return Value | | | | --- | --- | | string | | symfony SelfSaltingEncoderInterface SelfSaltingEncoderInterface ============================ interface **SelfSaltingEncoderInterface** SelfSaltingEncoderInterface is a marker interface for encoders that do not require a user-generated salt. symfony AdvancedUserInterface deprecated AdvancedUserInterface deprecated ================================= interface **AdvancedUserInterface** implements [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") deprecated | since | Symfony 4.1 | Adds extra features to a user class related to account status flags. This interface can be implemented in place of UserInterface if you'd like the authentication system to consider different account status flags during authentication. If any of the methods in this interface return false, authentication will fail. If you need to perform custom logic for any of these situations, then you will need to register an exception listener and watch for the specific exception instances thrown in each case. All exceptions are a subclass of AccountStatusException Methods ------- | | | | | --- | --- | --- | | (Role|string)[] | [getRoles](#method_getRoles)() Returns the roles granted to the user. | from [UserInterface](userinterface#method_getRoles "Symfony\Component\Security\Core\User\UserInterface") | | string | [getPassword](#method_getPassword)() Returns the password used to authenticate the user. | from [UserInterface](userinterface#method_getPassword "Symfony\Component\Security\Core\User\UserInterface") | | string|null | [getSalt](#method_getSalt)() Returns the salt that was originally used to encode the password. | from [UserInterface](userinterface#method_getSalt "Symfony\Component\Security\Core\User\UserInterface") | | string | [getUsername](#method_getUsername)() Returns the username used to authenticate the user. | from [UserInterface](userinterface#method_getUsername "Symfony\Component\Security\Core\User\UserInterface") | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive data from the user. | from [UserInterface](userinterface#method_eraseCredentials "Symfony\Component\Security\Core\User\UserInterface") | | bool | [isAccountNonExpired](#method_isAccountNonExpired)() Checks whether the user's account has expired. | | | bool | [isAccountNonLocked](#method_isAccountNonLocked)() Checks whether the user is locked. | | | bool | [isCredentialsNonExpired](#method_isCredentialsNonExpired)() Checks whether the user's credentials (password) has expired. | | | bool | [isEnabled](#method_isEnabled)() Checks whether the user is enabled. | | Details ------- ### (Role|string)[] getRoles() Returns the roles granted to the user. public function getRoles() { return array('ROLE\_USER'); } Alternatively, the roles might be stored on a `roles` property, and populated in any number of different ways when the user object is created. #### Return Value | | | | --- | --- | | (Role|string)[] | The user roles | ### string getPassword() Returns the password used to authenticate the user. This should be the encoded password. On authentication, a plain-text password will be salted, encoded, and then compared to this value. #### Return Value | | | | --- | --- | | string | The password | ### string|null getSalt() Returns the salt that was originally used to encode the password. This can return null if the password was not encoded using a salt. #### Return Value | | | | --- | --- | | string|null | The salt | ### string getUsername() Returns the username used to authenticate the user. #### Return Value | | | | --- | --- | | string | The username | ### eraseCredentials() Removes sensitive data from the user. This is important if, at any given point, sensitive information like the plain-text password is stored on this object. ### bool isAccountNonExpired() Checks whether the user's account has expired. Internally, if this method returns false, the authentication system will throw an AccountExpiredException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user's account is non expired, false otherwise | #### See also | | | | --- | --- | | [AccountExpiredException](../exception/accountexpiredexception "Symfony\Component\Security\Core\Exception\AccountExpiredException") | | ### bool isAccountNonLocked() Checks whether the user is locked. Internally, if this method returns false, the authentication system will throw a LockedException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user is not locked, false otherwise | #### See also | | | | --- | --- | | [LockedException](../exception/lockedexception "Symfony\Component\Security\Core\Exception\LockedException") | | ### bool isCredentialsNonExpired() Checks whether the user's credentials (password) has expired. Internally, if this method returns false, the authentication system will throw a CredentialsExpiredException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user's credentials are non expired, false otherwise | #### See also | | | | --- | --- | | [CredentialsExpiredException](../exception/credentialsexpiredexception "Symfony\Component\Security\Core\Exception\CredentialsExpiredException") | | ### bool isEnabled() Checks whether the user is enabled. Internally, if this method returns false, the authentication system will throw a DisabledException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user is enabled, false otherwise | #### See also | | | | --- | --- | | [DisabledException](../exception/disabledexception "Symfony\Component\Security\Core\Exception\DisabledException") | | symfony UserProviderInterface UserProviderInterface ====================== interface **UserProviderInterface** Represents a class that loads UserInterface objects from some source for the authentication system. In a typical authentication configuration, a username (i.e. some unique user identifier) credential enters the system (via form login, or any method). The user provider that is configured with that authentication method is asked to load the UserInterface object for the given username (via loadUserByUsername) so that the rest of the process can continue. Internally, a user provider can load users from any source (databases, configuration, web service). This is totally independent of how the authentication information is submitted or what the UserInterface object looks like. Methods ------- | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [loadUserByUsername](#method_loadUserByUsername)(string $username) Loads the user for the given username. | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [refreshUser](#method_refreshUser)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. | | | bool | [supportsClass](#method_supportsClass)(string $class) Whether this provider supports the given user class. | | Details ------- ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") loadUserByUsername(string $username) Loads the user for the given username. This method must throw UsernameNotFoundException if the user is not found. #### Parameters | | | | | --- | --- | --- | | string | $username | The username | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") refreshUser([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database), or if the UserInterface object can just be merged into some internal array of users / identity map. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UnsupportedUserException](../exception/unsupporteduserexception "Symfony\Component\Security\Core\Exception\UnsupportedUserException") | if the user is not supported | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### bool supportsClass(string $class) Whether this provider supports the given user class. #### Parameters | | | | | --- | --- | --- | | string | $class | | #### Return Value | | | | --- | --- | | bool | | symfony MissingUserProvider MissingUserProvider ==================== class **MissingUserProvider** implements [UserProviderInterface](userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") MissingUserProvider is a dummy user provider used to throw proper exception when a firewall requires a user provider but none was defined. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $firewall) | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [loadUserByUsername](#method_loadUserByUsername)(string $username) Loads the user for the given username. | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [refreshUser](#method_refreshUser)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. | | | bool | [supportsClass](#method_supportsClass)(string $class) Whether this provider supports the given user class. | | Details ------- ### \_\_construct(string $firewall) #### Parameters | | | | | --- | --- | --- | | string | $firewall | the firewall missing a provider | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") loadUserByUsername(string $username) Loads the user for the given username. This method must throw UsernameNotFoundException if the user is not found. #### Parameters | | | | | --- | --- | --- | | string | $username | The username | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") refreshUser([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database), or if the UserInterface object can just be merged into some internal array of users / identity map. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UnsupportedUserException](../exception/unsupporteduserexception "Symfony\Component\Security\Core\Exception\UnsupportedUserException") | if the user is not supported | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### bool supportsClass(string $class) Whether this provider supports the given user class. #### Parameters | | | | | --- | --- | --- | | string | $class | | #### Return Value | | | | --- | --- | | bool | | symfony UserInterface UserInterface ============== interface **UserInterface** Represents the interface that all user classes must implement. This interface is useful because the authentication layer can deal with the object through its lifecycle, using the object to get the encoded password (for checking against a submitted password), assigning roles and so on. Regardless of how your user are loaded or where they come from (a database, configuration, web service, etc), you will have a class that implements this interface. Objects that implement this interface are created and loaded by different objects that implement UserProviderInterface Methods ------- | | | | | --- | --- | --- | | (Role|string)[] | [getRoles](#method_getRoles)() Returns the roles granted to the user. | | | string | [getPassword](#method_getPassword)() Returns the password used to authenticate the user. | | | string|null | [getSalt](#method_getSalt)() Returns the salt that was originally used to encode the password. | | | string | [getUsername](#method_getUsername)() Returns the username used to authenticate the user. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive data from the user. | | Details ------- ### (Role|string)[] getRoles() Returns the roles granted to the user. public function getRoles() { return array('ROLE\_USER'); } Alternatively, the roles might be stored on a `roles` property, and populated in any number of different ways when the user object is created. #### Return Value | | | | --- | --- | | (Role|string)[] | The user roles | ### string getPassword() Returns the password used to authenticate the user. This should be the encoded password. On authentication, a plain-text password will be salted, encoded, and then compared to this value. #### Return Value | | | | --- | --- | | string | The password | ### string|null getSalt() Returns the salt that was originally used to encode the password. This can return null if the password was not encoded using a salt. #### Return Value | | | | --- | --- | | string|null | The salt | ### string getUsername() Returns the username used to authenticate the user. #### Return Value | | | | --- | --- | | string | The username | ### eraseCredentials() Removes sensitive data from the user. This is important if, at any given point, sensitive information like the plain-text password is stored on this object. symfony User User ===== class **User** implements [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface"), [EquatableInterface](equatableinterface "Symfony\Component\Security\Core\User\EquatableInterface"), [AdvancedUserInterface](advanceduserinterface "Symfony\Component\Security\Core\User\AdvancedUserInterface") User is the user implementation used by the in-memory user provider. This should not be used for anything else. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $username, string|null $password, array $roles = array(), bool $enabled = true, bool $userNonExpired = true, bool $credentialsNonExpired = true, bool $userNonLocked = true) | | | | [\_\_toString](#method___toString)() | | | (Role|string)[] | [getRoles](#method_getRoles)() Returns the roles granted to the user. | | | string | [getPassword](#method_getPassword)() Returns the password used to authenticate the user. | | | string|null | [getSalt](#method_getSalt)() Returns the salt that was originally used to encode the password. | | | string | [getUsername](#method_getUsername)() Returns the username used to authenticate the user. | | | bool | [isAccountNonExpired](#method_isAccountNonExpired)() Checks whether the user's account has expired. | | | bool | [isAccountNonLocked](#method_isAccountNonLocked)() Checks whether the user is locked. | | | bool | [isCredentialsNonExpired](#method_isCredentialsNonExpired)() Checks whether the user's credentials (password) has expired. | | | bool | [isEnabled](#method_isEnabled)() Checks whether the user is enabled. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive data from the user. | | | bool | [isEqualTo](#method_isEqualTo)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()). | | Details ------- ### \_\_construct(string|null $username, string|null $password, array $roles = array(), bool $enabled = true, bool $userNonExpired = true, bool $credentialsNonExpired = true, bool $userNonLocked = true) #### Parameters | | | | | --- | --- | --- | | string|null | $username | | | string|null | $password | | | array | $roles | | | bool | $enabled | | | bool | $userNonExpired | | | bool | $credentialsNonExpired | | | bool | $userNonLocked | | ### \_\_toString() ### (Role|string)[] getRoles() Returns the roles granted to the user. public function getRoles() { return array('ROLE\_USER'); } Alternatively, the roles might be stored on a `roles` property, and populated in any number of different ways when the user object is created. #### Return Value | | | | --- | --- | | (Role|string)[] | The user roles | ### string getPassword() Returns the password used to authenticate the user. This should be the encoded password. On authentication, a plain-text password will be salted, encoded, and then compared to this value. #### Return Value | | | | --- | --- | | string | The password | ### string|null getSalt() Returns the salt that was originally used to encode the password. This can return null if the password was not encoded using a salt. #### Return Value | | | | --- | --- | | string|null | The salt | ### string getUsername() Returns the username used to authenticate the user. #### Return Value | | | | --- | --- | | string | The username | ### bool isAccountNonExpired() Checks whether the user's account has expired. Internally, if this method returns false, the authentication system will throw an AccountExpiredException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user's account is non expired, false otherwise | ### bool isAccountNonLocked() Checks whether the user is locked. Internally, if this method returns false, the authentication system will throw a LockedException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user is not locked, false otherwise | ### bool isCredentialsNonExpired() Checks whether the user's credentials (password) has expired. Internally, if this method returns false, the authentication system will throw a CredentialsExpiredException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user's credentials are non expired, false otherwise | ### bool isEnabled() Checks whether the user is enabled. Internally, if this method returns false, the authentication system will throw a DisabledException and prevent login. #### Return Value | | | | --- | --- | | bool | true if the user is enabled, false otherwise | ### eraseCredentials() Removes sensitive data from the user. This is important if, at any given point, sensitive information like the plain-text password is stored on this object. ### bool isEqualTo([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()). However, you do not need to compare every attribute, but only those that are relevant for assessing whether re-authentication is required. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony EquatableInterface EquatableInterface =================== interface **EquatableInterface** EquatableInterface used to test if two objects are equal in security and re-authentication context. Methods ------- | | | | | --- | --- | --- | | bool | [isEqualTo](#method_isEqualTo)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()). | | Details ------- ### bool isEqualTo([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()). However, you do not need to compare every attribute, but only those that are relevant for assessing whether re-authentication is required. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | bool | | symfony UserCheckerInterface UserCheckerInterface ===================== interface **UserCheckerInterface** Implement to throw AccountStatusException during the authentication process. Can be used when you want to check the account status, e.g when the account is disabled or blocked. This should not be used to make authentication decisions. Methods ------- | | | | | --- | --- | --- | | | [checkPreAuth](#method_checkPreAuth)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account before authentication. | | | | [checkPostAuth](#method_checkPostAuth)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account after authentication. | | Details ------- ### checkPreAuth([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account before authentication. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Exceptions | | | | --- | --- | | [AccountStatusException](../exception/accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") | | ### checkPostAuth([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account after authentication. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Exceptions | | | | --- | --- | | [AccountStatusException](../exception/accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") | | symfony UserChecker UserChecker ============ class **UserChecker** implements [UserCheckerInterface](usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") UserChecker checks the user account flags. Methods ------- | | | | | --- | --- | --- | | | [checkPreAuth](#method_checkPreAuth)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account before authentication. | | | | [checkPostAuth](#method_checkPostAuth)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account after authentication. | | Details ------- ### checkPreAuth([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account before authentication. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Exceptions | | | | --- | --- | | [AccountStatusException](../exception/accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") | | ### checkPostAuth([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Checks the user account after authentication. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Exceptions | | | | --- | --- | | [AccountStatusException](../exception/accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") | | symfony LdapUserProvider LdapUserProvider ================= class **LdapUserProvider** implements [UserProviderInterface](userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") LdapUserProvider is a simple user provider on top of ldap. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([LdapInterface](../../../ldap/ldapinterface "Symfony\Component\Ldap\LdapInterface") $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string|null $uidKey = 'sAMAccountName', string $filter = '({uid\_key}={username})', string $passwordAttribute = null) | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [loadUserByUsername](#method_loadUserByUsername)(string $username) Loads the user for the given username. | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [refreshUser](#method_refreshUser)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. | | | bool | [supportsClass](#method_supportsClass)(string $class) Whether this provider supports the given user class. | | | [User](user "Symfony\Component\Security\Core\User\User") | [loadUser](#method_loadUser)(string $username, [Entry](../../../ldap/entry "Symfony\Component\Ldap\Entry") $entry) Loads a user from an LDAP entry. | | Details ------- ### \_\_construct([LdapInterface](../../../ldap/ldapinterface "Symfony\Component\Ldap\LdapInterface") $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string|null $uidKey = 'sAMAccountName', string $filter = '({uid\_key}={username})', string $passwordAttribute = null) #### Parameters | | | | | --- | --- | --- | | [LdapInterface](../../../ldap/ldapinterface "Symfony\Component\Ldap\LdapInterface") | $ldap | | | string | $baseDn | | | string | $searchDn | | | string | $searchPassword | | | array | $defaultRoles | | | string|null | $uidKey | | | string | $filter | | | string | $passwordAttribute | | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") loadUserByUsername(string $username) Loads the user for the given username. This method must throw UsernameNotFoundException if the user is not found. #### Parameters | | | | | --- | --- | --- | | string | $username | The username | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") refreshUser([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database), or if the UserInterface object can just be merged into some internal array of users / identity map. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UnsupportedUserException](../exception/unsupporteduserexception "Symfony\Component\Security\Core\Exception\UnsupportedUserException") | if the user is not supported | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### bool supportsClass(string $class) Whether this provider supports the given user class. #### Parameters | | | | | --- | --- | --- | | string | $class | | #### Return Value | | | | --- | --- | | bool | | ### protected [User](user "Symfony\Component\Security\Core\User\User") loadUser(string $username, [Entry](../../../ldap/entry "Symfony\Component\Ldap\Entry") $entry) Loads a user from an LDAP entry. #### Parameters | | | | | --- | --- | --- | | string | $username | | | [Entry](../../../ldap/entry "Symfony\Component\Ldap\Entry") | $entry | | #### Return Value | | | | --- | --- | | [User](user "Symfony\Component\Security\Core\User\User") | | symfony ChainUserProvider ChainUserProvider ================== class **ChainUserProvider** implements [UserProviderInterface](userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") Chain User Provider. This provider calls several leaf providers in a chain until one is able to handle the request. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $providers) | | | array | [getProviders](#method_getProviders)() | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [loadUserByUsername](#method_loadUserByUsername)(string $username) Loads the user for the given username. | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [refreshUser](#method_refreshUser)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. | | | bool | [supportsClass](#method_supportsClass)(string $class) Whether this provider supports the given user class. | | Details ------- ### \_\_construct(iterable $providers) #### Parameters | | | | | --- | --- | --- | | iterable | $providers | | ### array getProviders() #### Return Value | | | | --- | --- | | array | | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") loadUserByUsername(string $username) Loads the user for the given username. This method must throw UsernameNotFoundException if the user is not found. #### Parameters | | | | | --- | --- | --- | | string | $username | The username | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") refreshUser([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database), or if the UserInterface object can just be merged into some internal array of users / identity map. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UnsupportedUserException](../exception/unsupporteduserexception "Symfony\Component\Security\Core\Exception\UnsupportedUserException") | if the user is not supported | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### bool supportsClass(string $class) Whether this provider supports the given user class. #### Parameters | | | | | --- | --- | --- | | string | $class | | #### Return Value | | | | --- | --- | | bool | | symfony InMemoryUserProvider InMemoryUserProvider ===================== class **InMemoryUserProvider** implements [UserProviderInterface](userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") InMemoryUserProvider is a simple non persistent user provider. Useful for testing, demonstration, prototyping, and for simple needs (a backend with a unique admin for instance) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $users = array()) The user array is a hash where the keys are usernames and the values are an array of attributes: 'password', 'enabled', and 'roles'. | | | | [createUser](#method_createUser)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Adds a new User to the provider. | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [loadUserByUsername](#method_loadUserByUsername)(string $username) Loads the user for the given username. | | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | [refreshUser](#method_refreshUser)([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. | | | bool | [supportsClass](#method_supportsClass)(string $class) Whether this provider supports the given user class. | | Details ------- ### \_\_construct(array $users = array()) The user array is a hash where the keys are usernames and the values are an array of attributes: 'password', 'enabled', and 'roles'. #### Parameters | | | | | --- | --- | --- | | array | $users | An array of users | ### createUser([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Adds a new User to the provider. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") loadUserByUsername(string $username) Loads the user for the given username. This method must throw UsernameNotFoundException if the user is not found. #### Parameters | | | | | --- | --- | --- | | string | $username | The username | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") refreshUser([UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Refreshes the user. It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database), or if the UserInterface object can just be merged into some internal array of users / identity map. #### Parameters | | | | | --- | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | [UserInterface](userinterface "Symfony\Component\Security\Core\User\UserInterface") | | #### Exceptions | | | | --- | --- | | [UnsupportedUserException](../exception/unsupporteduserexception "Symfony\Component\Security\Core\Exception\UnsupportedUserException") | if the user is not supported | | [UsernameNotFoundException](../exception/usernamenotfoundexception "Symfony\Component\Security\Core\Exception\UsernameNotFoundException") | if the user is not found | ### bool supportsClass(string $class) Whether this provider supports the given user class. #### Parameters | | | | | --- | --- | --- | | string | $class | | #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\Security\Core\Authorization\Voter Symfony\Component\Security\Core\Authorization\Voter =================================================== Classes ------- | | | | --- | --- | | [AuthenticatedVoter](voter/authenticatedvoter "Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter") | AuthenticatedVoter votes if an attribute like IS\_AUTHENTICATED\_FULLY, IS\_AUTHENTICATED\_REMEMBERED, or IS\_AUTHENTICATED\_ANONYMOUSLY is present. | | [ExpressionVoter](voter/expressionvoter "Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter") | ExpressionVoter votes based on the evaluation of an expression. | | [RoleHierarchyVoter](voter/rolehierarchyvoter "Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter") | RoleHierarchyVoter uses a RoleHierarchy to determine the roles granted to the user before voting. | | [RoleVoter](voter/rolevoter "Symfony\Component\Security\Core\Authorization\Voter\RoleVoter") | RoleVoter votes if any attribute starts with a given prefix. | | [Voter](voter/voter "Symfony\Component\Security\Core\Authorization\Voter\Voter") | Voter is an abstract default implementation of a voter. | Interfaces ---------- | | | | --- | --- | | *[VoterInterface](voter/voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface")* | VoterInterface is the interface implemented by all voters. | symfony ExpressionLanguage ExpressionLanguage =================== class **ExpressionLanguage** extends [ExpressionLanguage](../../../expressionlanguage/expressionlanguage "Symfony\Component\ExpressionLanguage\ExpressionLanguage") Adds some function to the default ExpressionLanguage. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $functions | | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#property_functions "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(CacheItemPoolInterface $cache = null, array $providers = array()) | | | string | [compile](#method_compile)([Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_compile "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | mixed | [evaluate](#method_evaluate)([Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_evaluate "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | [ParsedExpression](../../../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | [parse](#method_parse)([Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_parse "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [register](#method_register)(string $name, callable $compiler, callable $evaluator) Registers a function. | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_register "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [addFunction](#method_addFunction)([ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_addFunction "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [registerProvider](#method_registerProvider)([ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_registerProvider "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [registerFunctions](#method_registerFunctions)() | from [ExpressionLanguage](../../../expressionlanguage/expressionlanguage#method_registerFunctions "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | Details ------- ### \_\_construct(CacheItemPoolInterface $cache = null, array $providers = array()) #### Parameters | | | | | --- | --- | --- | | CacheItemPoolInterface | $cache | | | array | $providers | | ### string compile([Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. #### Parameters | | | | | --- | --- | --- | | [Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | string | The compiled PHP source code | ### mixed evaluate([Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $values | An array of values | #### Return Value | | | | --- | --- | | mixed | The result of the evaluation of the expression | ### [ParsedExpression](../../../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") parse([Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](../../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to parse | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | [ParsedExpression](../../../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | A ParsedExpression instance | ### register(string $name, callable $compiler, callable $evaluator) Registers a function. #### Parameters | | | | | --- | --- | --- | | string | $name | The function name | | callable | $compiler | A callable able to compile the function | | callable | $evaluator | A callable able to evaluate the function | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | when registering a function after calling evaluate(), compile() or parse() | #### See also | | | | --- | --- | | [ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | | ### addFunction([ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | $function | | ### registerProvider([ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected registerFunctions()
programming_docs
symfony AuthorizationCheckerInterface AuthorizationCheckerInterface ============================== interface **AuthorizationCheckerInterface** The AuthorizationCheckerInterface. Methods ------- | | | | | --- | --- | --- | | bool | [isGranted](#method_isGranted)(mixed $attributes, mixed $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. | | Details ------- ### bool isGranted(mixed $attributes, mixed $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. #### Parameters | | | | | --- | --- | --- | | mixed | $attributes | | | mixed | $subject | | #### Return Value | | | | --- | --- | | bool | | symfony ExpressionLanguageProvider ExpressionLanguageProvider =========================== class **ExpressionLanguageProvider** implements [ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") Define some ExpressionLanguage functions. Methods ------- | | | | | --- | --- | --- | | [ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] | [getFunctions](#method_getFunctions)() | | Details ------- ### [ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] getFunctions() #### Return Value | | | | --- | --- | | [ExpressionFunction](../../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] | An array of Function instances | symfony TraceableAccessDecisionManager TraceableAccessDecisionManager =============================== class **TraceableAccessDecisionManager** implements [AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") Decorates the original AccessDecisionManager class to log information about the security voters and the decisions made by them. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $manager) | | | bool | [decide](#method_decide)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, array $attributes, object $object = null) Decides whether the access is possible or not. | | | string | [getStrategy](#method_getStrategy)() | | | iterable|[VoterInterface](voter/voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface")[] | [getVoters](#method_getVoters)() | | | array | [getDecisionLog](#method_getDecisionLog)() | | Details ------- ### \_\_construct([AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $manager) #### Parameters | | | | | --- | --- | --- | | [AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") | $manager | | ### bool decide([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, array $attributes, object $object = null) Decides whether the access is possible or not. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | array | $attributes | An array of attributes associated with the method being invoked | | object | $object | The object to secure | #### Return Value | | | | --- | --- | | bool | true if the access is granted, false otherwise | ### string getStrategy() #### Return Value | | | | --- | --- | | string | | ### iterable|[VoterInterface](voter/voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface")[] getVoters() #### Return Value | | | | --- | --- | | iterable|[VoterInterface](voter/voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface")[] | | ### array getDecisionLog() #### Return Value | | | | --- | --- | | array | | symfony AccessDecisionManagerInterface AccessDecisionManagerInterface =============================== interface **AccessDecisionManagerInterface** AccessDecisionManagerInterface makes authorization decisions. Methods ------- | | | | | --- | --- | --- | | bool | [decide](#method_decide)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, array $attributes, object $object = null) Decides whether the access is possible or not. | | Details ------- ### bool decide([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, array $attributes, object $object = null) Decides whether the access is possible or not. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | array | $attributes | An array of attributes associated with the method being invoked | | object | $object | The object to secure | #### Return Value | | | | --- | --- | | bool | true if the access is granted, false otherwise | symfony AuthorizationChecker AuthorizationChecker ===================== class **AuthorizationChecker** implements [AuthorizationCheckerInterface](authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") AuthorizationChecker is the main authorization point of the Security component. It gives access to the token representing the current user authentication. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager, bool $alwaysAuthenticate = false) | | | bool | [isGranted](#method_isGranted)(mixed $attributes, mixed $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. | | Details ------- ### \_\_construct([TokenStorageInterface](../authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager, bool $alwaysAuthenticate = false) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | [AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") | $accessDecisionManager | | | bool | $alwaysAuthenticate | | ### final bool isGranted(mixed $attributes, mixed $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. #### Parameters | | | | | --- | --- | --- | | mixed | $attributes | | | mixed | $subject | | #### Return Value | | | | --- | --- | | bool | | symfony AccessDecisionManager AccessDecisionManager ====================== class **AccessDecisionManager** implements [AccessDecisionManagerInterface](accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") AccessDecisionManager is the base class for all access decision managers that use decision voters. Constants --------- | | | | --- | --- | | STRATEGY\_AFFIRMATIVE | | | STRATEGY\_CONSENSUS | | | STRATEGY\_UNANIMOUS | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $voters = array(), string $strategy = self::STRATEGY\_AFFIRMATIVE, bool $allowIfAllAbstainDecisions = false, bool $allowIfEqualGrantedDeniedDecisions = true) | | | bool | [decide](#method_decide)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, array $attributes, object $object = null) Decides whether the access is possible or not. | | Details ------- ### \_\_construct(iterable $voters = array(), string $strategy = self::STRATEGY\_AFFIRMATIVE, bool $allowIfAllAbstainDecisions = false, bool $allowIfEqualGrantedDeniedDecisions = true) #### Parameters | | | | | --- | --- | --- | | iterable | $voters | An array or an iterator of VoterInterface instances | | string | $strategy | The vote strategy | | bool | $allowIfAllAbstainDecisions | Whether to grant access if all voters abstained or not | | bool | $allowIfEqualGrantedDeniedDecisions | Whether to grant access if result are equals | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool decide([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, array $attributes, object $object = null) Decides whether the access is possible or not. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | array | $attributes | An array of attributes associated with the method being invoked | | object | $object | The object to secure | #### Return Value | | | | --- | --- | | bool | true if the access is granted, false otherwise | symfony ExpressionVoter ExpressionVoter ================ class **ExpressionVoter** implements [VoterInterface](voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface") ExpressionVoter votes based on the evaluation of an expression. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ExpressionLanguage](../expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") $expressionLanguage, [AuthenticationTrustResolverInterface](../../authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver, [RoleHierarchyInterface](../../role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy = null) | | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) deprecated | | | int | [vote](#method_vote)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. | | Details ------- ### \_\_construct([ExpressionLanguage](../expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") $expressionLanguage, [AuthenticationTrustResolverInterface](../../authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver, [RoleHierarchyInterface](../../role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy = null) #### Parameters | | | | | --- | --- | --- | | [ExpressionLanguage](../expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") | $expressionLanguage | | | [AuthenticationTrustResolverInterface](../../authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") | $trustResolver | | | [RoleHierarchyInterface](../../role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") | $roleHierarchy | | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) deprecated deprecated | since | Symfony 4.1, register the provider directly on the injected ExpressionLanguage instance instead. | #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### int vote([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. This method must return one of the following constants: ACCESS\_GRANTED, ACCESS\_DENIED, or ACCESS\_ABSTAIN. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | mixed | $subject | The subject to secure | | array | $attributes | An array of attributes associated with the method being invoked | #### Return Value | | | | --- | --- | | int | either ACCESS\_GRANTED, ACCESS\_ABSTAIN, or ACCESS\_DENIED | symfony Voter Voter ====== abstract class **Voter** implements [VoterInterface](voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface") Voter is an abstract default implementation of a voter. Methods ------- | | | | | --- | --- | --- | | int | [vote](#method_vote)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. | | | bool | [supports](#method_supports)(string $attribute, mixed $subject) Determines if the attribute and subject are supported by this voter. | | | bool | [voteOnAttribute](#method_voteOnAttribute)(string $attribute, mixed $subject, [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Perform a single access check operation on a given attribute, subject and token. | | Details ------- ### int vote([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. This method must return one of the following constants: ACCESS\_GRANTED, ACCESS\_DENIED, or ACCESS\_ABSTAIN. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | mixed | $subject | The subject to secure | | array | $attributes | An array of attributes associated with the method being invoked | #### Return Value | | | | --- | --- | | int | either ACCESS\_GRANTED, ACCESS\_ABSTAIN, or ACCESS\_DENIED | ### abstract protected bool supports(string $attribute, mixed $subject) Determines if the attribute and subject are supported by this voter. #### Parameters | | | | | --- | --- | --- | | string | $attribute | An attribute | | mixed | $subject | The subject to secure, e.g. an object the user wants to access or any other PHP type | #### Return Value | | | | --- | --- | | bool | True if the attribute and subject are supported, false otherwise | ### abstract protected bool voteOnAttribute(string $attribute, mixed $subject, [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Perform a single access check operation on a given attribute, subject and token. It is safe to assume that $attribute and $subject already passed the "supports()" method check. #### Parameters | | | | | --- | --- | --- | | string | $attribute | | | mixed | $subject | | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | symfony RoleVoter RoleVoter ========== class **RoleVoter** implements [VoterInterface](voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface") RoleVoter votes if any attribute starts with a given prefix. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $prefix = 'ROLE\_') | | | int | [vote](#method_vote)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. | | | | [extractRoles](#method_extractRoles)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | | Details ------- ### \_\_construct(string $prefix = 'ROLE\_') #### Parameters | | | | | --- | --- | --- | | string | $prefix | | ### int vote([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. This method must return one of the following constants: ACCESS\_GRANTED, ACCESS\_DENIED, or ACCESS\_ABSTAIN. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | mixed | $subject | The subject to secure | | array | $attributes | An array of attributes associated with the method being invoked | #### Return Value | | | | --- | --- | | int | either ACCESS\_GRANTED, ACCESS\_ABSTAIN, or ACCESS\_DENIED | ### protected extractRoles([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | |
programming_docs
symfony AuthenticatedVoter AuthenticatedVoter =================== class **AuthenticatedVoter** implements [VoterInterface](voterinterface "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface") AuthenticatedVoter votes if an attribute like IS\_AUTHENTICATED\_FULLY, IS\_AUTHENTICATED\_REMEMBERED, or IS\_AUTHENTICATED\_ANONYMOUSLY is present. This list is most restrictive to least restrictive checking. Constants --------- | | | | --- | --- | | IS\_AUTHENTICATED\_FULLY | | | IS\_AUTHENTICATED\_REMEMBERED | | | IS\_AUTHENTICATED\_ANONYMOUSLY | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([AuthenticationTrustResolverInterface](../../authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $authenticationTrustResolver) | | | int | [vote](#method_vote)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. | | Details ------- ### \_\_construct([AuthenticationTrustResolverInterface](../../authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $authenticationTrustResolver) #### Parameters | | | | | --- | --- | --- | | [AuthenticationTrustResolverInterface](../../authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") | $authenticationTrustResolver | | ### int vote([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. This method must return one of the following constants: ACCESS\_GRANTED, ACCESS\_DENIED, or ACCESS\_ABSTAIN. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | mixed | $subject | The subject to secure | | array | $attributes | An array of attributes associated with the method being invoked | #### Return Value | | | | --- | --- | | int | either ACCESS\_GRANTED, ACCESS\_ABSTAIN, or ACCESS\_DENIED | symfony VoterInterface VoterInterface =============== interface **VoterInterface** VoterInterface is the interface implemented by all voters. Constants --------- | | | | --- | --- | | ACCESS\_GRANTED | | | ACCESS\_ABSTAIN | | | ACCESS\_DENIED | | Methods ------- | | | | | --- | --- | --- | | int | [vote](#method_vote)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. | | Details ------- ### int vote([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. This method must return one of the following constants: ACCESS\_GRANTED, ACCESS\_DENIED, or ACCESS\_ABSTAIN. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | mixed | $subject | The subject to secure | | array | $attributes | An array of attributes associated with the method being invoked | #### Return Value | | | | --- | --- | | int | either ACCESS\_GRANTED, ACCESS\_ABSTAIN, or ACCESS\_DENIED | symfony RoleHierarchyVoter RoleHierarchyVoter =================== class **RoleHierarchyVoter** extends [RoleVoter](rolevoter "Symfony\Component\Security\Core\Authorization\Voter\RoleVoter") RoleHierarchyVoter uses a RoleHierarchy to determine the roles granted to the user before voting. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RoleHierarchyInterface](../../role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy, string $prefix = 'ROLE\_') | | | int | [vote](#method_vote)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. | from [RoleVoter](rolevoter#method_vote "Symfony\Component\Security\Core\Authorization\Voter\RoleVoter") | | | [extractRoles](#method_extractRoles)([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | | Details ------- ### \_\_construct([RoleHierarchyInterface](../../role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy, string $prefix = 'ROLE\_') #### Parameters | | | | | --- | --- | --- | | [RoleHierarchyInterface](../../role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") | $roleHierarchy | | | string | $prefix | | ### int vote([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, mixed $subject, array $attributes) Returns the vote for the given parameters. This method must return one of the following constants: ACCESS\_GRANTED, ACCESS\_DENIED, or ACCESS\_ABSTAIN. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface instance | | mixed | $subject | The subject to secure | | array | $attributes | An array of attributes associated with the method being invoked | #### Return Value | | | | --- | --- | | int | either ACCESS\_GRANTED, ACCESS\_ABSTAIN, or ACCESS\_DENIED | ### protected extractRoles([TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony AccountExpiredException AccountExpiredException ======================== class **AccountExpiredException** extends [AccountStatusException](accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") AccountExpiredException is thrown when the user account has expired. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AccountStatusException](accountstatusexception#method_serialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [unserialize](#method_unserialize)($str) | from [AccountStatusException](accountstatusexception#method_unserialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getUser](#method_getUser)() Get the user. | from [AccountStatusException](accountstatusexception#method_getUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [setUser](#method_setUser)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) | from [AccountStatusException](accountstatusexception#method_setUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getUser() Get the user. #### Return Value | | | | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### setUser([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | symfony UsernameNotFoundException UsernameNotFoundException ========================== class **UsernameNotFoundException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") UsernameNotFoundException is thrown if a User cannot be found by its username. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($str) | | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | | | string | [getUsername](#method_getUsername)() Get the username. | | | | [setUsername](#method_setUsername)(string $username) Set the username. | | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### string getUsername() Get the username. #### Return Value | | | | --- | --- | | string | | ### setUsername(string $username) Set the username. #### Parameters | | | | | --- | --- | --- | | string | $username | | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Security\Core\Exception\ExceptionInterface") Base InvalidArgumentException for the Security component. symfony CustomUserMessageAuthenticationException CustomUserMessageAuthenticationException ========================================= class **CustomUserMessageAuthenticationException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") An authentication exception where you can control the message shown to the user. Be sure that the message passed to this exception is something that can be shown safely to your user. In other words, avoid catching other exceptions and passing their message directly to this class. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($str) | | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | | | | [\_\_construct](#method___construct)(string $message = '', array $messageData = array(), int $code = 0, [Exception](http://php.net/Exception) $previous = null) | | | | [setSafeMessage](#method_setSafeMessage)(string $messageKey, array $messageData = array()) Set a message that will be shown to the user. | | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### \_\_construct(string $message = '', array $messageData = array(), int $code = 0, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | array | $messageData | | | int | $code | | | [Exception](http://php.net/Exception) | $previous | | ### setSafeMessage(string $messageKey, array $messageData = array()) Set a message that will be shown to the user. #### Parameters | | | | | --- | --- | --- | | string | $messageKey | The message or message key | | array | $messageData | Data to be passed into the translator | symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Base ExceptionInterface for the Security component. symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Security\Core\Exception\ExceptionInterface") Base LogicException for the Security component. symfony AuthenticationCredentialsNotFoundException AuthenticationCredentialsNotFoundException =========================================== class **AuthenticationCredentialsNotFoundException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") AuthenticationCredentialsNotFoundException is thrown when an authentication is rejected because no Token is available. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony CookieTheftException CookieTheftException ===================== class **CookieTheftException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") This exception is thrown when the RememberMeServices implementation detects that a presented cookie has already been used by someone else. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony TokenNotFoundException TokenNotFoundException ======================= class **TokenNotFoundException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") TokenNotFoundException is thrown if a Token cannot be found. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony CredentialsExpiredException CredentialsExpiredException ============================ class **CredentialsExpiredException** extends [AccountStatusException](accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") CredentialsExpiredException is thrown when the user account credentials have expired. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AccountStatusException](accountstatusexception#method_serialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [unserialize](#method_unserialize)($str) | from [AccountStatusException](accountstatusexception#method_unserialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getUser](#method_getUser)() Get the user. | from [AccountStatusException](accountstatusexception#method_getUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [setUser](#method_setUser)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) | from [AccountStatusException](accountstatusexception#method_setUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getUser() Get the user. #### Return Value | | | | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### setUser([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | symfony DisabledException DisabledException ================== class **DisabledException** extends [AccountStatusException](accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") DisabledException is thrown when the user account is disabled. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AccountStatusException](accountstatusexception#method_serialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [unserialize](#method_unserialize)($str) | from [AccountStatusException](accountstatusexception#method_unserialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getUser](#method_getUser)() Get the user. | from [AccountStatusException](accountstatusexception#method_getUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [setUser](#method_setUser)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) | from [AccountStatusException](accountstatusexception#method_setUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getUser() Get the user. #### Return Value | | | | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### setUser([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Security\Core\Exception\ExceptionInterface") Base RuntimeException for the Security component. symfony LockedException LockedException ================ class **LockedException** extends [AccountStatusException](accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") LockedException is thrown if the user account is locked. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AccountStatusException](accountstatusexception#method_serialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [unserialize](#method_unserialize)($str) | from [AccountStatusException](accountstatusexception#method_unserialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getUser](#method_getUser)() Get the user. | from [AccountStatusException](accountstatusexception#method_getUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [setUser](#method_setUser)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) | from [AccountStatusException](accountstatusexception#method_setUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getUser() Get the user. #### Return Value | | | | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### setUser([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | symfony LogoutException LogoutException ================ class **LogoutException** extends [RuntimeException](runtimeexception "Symfony\Component\Security\Core\Exception\RuntimeException") LogoutException is thrown when the account cannot be logged out. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message = 'Logout Exception', [Exception](http://php.net/Exception) $previous = null) | | Details ------- ### \_\_construct(string $message = 'Logout Exception', [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | [Exception](http://php.net/Exception) | $previous | | symfony AuthenticationExpiredException AuthenticationExpiredException =============================== class **AuthenticationExpiredException** extends [AccountStatusException](accountstatusexception "Symfony\Component\Security\Core\Exception\AccountStatusException") AuthenticationServiceException is thrown when an authenticated token becomes un-authenticated between requests. In practice, this is due to the User changing between requests (e.g. password changes), causes the token to become un-authenticated. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AccountStatusException](accountstatusexception#method_serialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [unserialize](#method_unserialize)($str) | from [AccountStatusException](accountstatusexception#method_unserialize "Symfony\Component\Security\Core\Exception\AccountStatusException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getUser](#method_getUser)() Get the user. | from [AccountStatusException](accountstatusexception#method_getUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | | | [setUser](#method_setUser)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) | from [AccountStatusException](accountstatusexception#method_setUser "Symfony\Component\Security\Core\Exception\AccountStatusException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getUser() Get the user. #### Return Value | | | | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### setUser([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | |
programming_docs
symfony SessionUnavailableException SessionUnavailableException ============================ class **SessionUnavailableException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") This exception is thrown when no session is available. Possible reasons for this are: ``` a) The session timed out because the user waited too long. b) The user has disabled cookies, and a new session is started on each request. ``` Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony BadCredentialsException BadCredentialsException ======================== class **BadCredentialsException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") BadCredentialsException is thrown when the user credentials are invalid. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony AuthenticationServiceException AuthenticationServiceException =============================== class **AuthenticationServiceException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") AuthenticationServiceException is thrown when an authentication request could not be processed due to a system problem. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony ProviderNotFoundException ProviderNotFoundException ========================== class **ProviderNotFoundException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") ProviderNotFoundException is thrown when no AuthenticationProviderInterface instance supports an authentication Token. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony InvalidCsrfTokenException InvalidCsrfTokenException ========================== class **InvalidCsrfTokenException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") This exception is thrown when the csrf token is invalid. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony InsufficientAuthenticationException InsufficientAuthenticationException ==================================== class **InsufficientAuthenticationException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") InsufficientAuthenticationException is thrown if the user credentials are not sufficiently trusted. This is the case when a user is anonymous and the resource to be displayed has an access role. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony AccessDeniedException AccessDeniedException ====================== class **AccessDeniedException** extends [RuntimeException](runtimeexception "Symfony\Component\Security\Core\Exception\RuntimeException") AccessDeniedException is thrown when the account has not the required role. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message = 'Access Denied.', [Exception](http://php.net/Exception) $previous = null) | | | array | [getAttributes](#method_getAttributes)() | | | | [setAttributes](#method_setAttributes)(array|string $attributes) | | | mixed | [getSubject](#method_getSubject)() | | | | [setSubject](#method_setSubject)(mixed $subject) | | Details ------- ### \_\_construct(string $message = 'Access Denied.', [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | [Exception](http://php.net/Exception) | $previous | | ### array getAttributes() #### Return Value | | | | --- | --- | | array | | ### setAttributes(array|string $attributes) #### Parameters | | | | | --- | --- | --- | | array|string | $attributes | | ### mixed getSubject() #### Return Value | | | | --- | --- | | mixed | | ### setSubject(mixed $subject) #### Parameters | | | | | --- | --- | --- | | mixed | $subject | | symfony AuthenticationException AuthenticationException ======================== class **AuthenticationException** extends [RuntimeException](runtimeexception "Symfony\Component\Security\Core\Exception\RuntimeException") implements [Serializable](http://php.net/Serializable) AuthenticationException is the base class for all authentication exceptions. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($str) | | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony AccountStatusException AccountStatusException ======================= abstract class **AccountStatusException** extends [AuthenticationException](authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") AccountStatusException is the base class for authentication exceptions caused by the user account status. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($str) | | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageKey "Symfony\Component\Security\Core\Exception\AuthenticationException") | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getUser](#method_getUser)() Get the user. | | | | [setUser](#method_setUser)([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) | | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | ### [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getUser() Get the user. #### Return Value | | | | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### setUser([UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | symfony UnsupportedUserException UnsupportedUserException ========================= class **UnsupportedUserException** extends [AuthenticationServiceException](authenticationserviceexception "Symfony\Component\Security\Core\Exception\AuthenticationServiceException") This exception is thrown when an account is reloaded from a provider which doesn't support the passed implementation of UserInterface. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getToken](#method_getToken)() Get the token. | from [AuthenticationException](authenticationexception#method_getToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [setToken](#method_setToken)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | from [AuthenticationException](authenticationexception#method_setToken "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [serialize](#method_serialize)() | from [AuthenticationException](authenticationexception#method_serialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | | [unserialize](#method_unserialize)($str) | from [AuthenticationException](authenticationexception#method_unserialize "Symfony\Component\Security\Core\Exception\AuthenticationException") | | string | [getMessageKey](#method_getMessageKey)() Message key to be used by the translation component. | from [AuthenticationServiceException](authenticationserviceexception#method_getMessageKey "Symfony\Component\Security\Core\Exception\AuthenticationServiceException") | | array | [getMessageData](#method_getMessageData)() Message data to be used by the translation component. | from [AuthenticationException](authenticationexception#method_getMessageData "Symfony\Component\Security\Core\Exception\AuthenticationException") | Details ------- ### [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getToken() Get the token. #### Return Value | | | | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### setToken([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### serialize() ### unserialize($str) #### Parameters | | | | | --- | --- | --- | | | $str | | ### string getMessageKey() Message key to be used by the translation component. #### Return Value | | | | --- | --- | | string | | ### array getMessageData() Message data to be used by the translation component. #### Return Value | | | | --- | --- | | array | | symfony AuthenticationManagerInterface AuthenticationManagerInterface =============================== interface **AuthenticationManagerInterface** AuthenticationManagerInterface is the interface for authentication managers, which process Token authentication. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | Details ------- ### [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | symfony AuthenticationTrustResolver AuthenticationTrustResolver ============================ class **AuthenticationTrustResolver** implements [AuthenticationTrustResolverInterface](authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") The default implementation of the authentication trust resolver. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $anonymousClass, string $rememberMeClass) | | | bool | [isAnonymous](#method_isAnonymous)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated anonymously. | | | bool | [isRememberMe](#method_isRememberMe)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated using remember-me capabilities. | | | bool | [isFullFledged](#method_isFullFledged)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is fully authenticated. | | Details ------- ### \_\_construct(string $anonymousClass, string $rememberMeClass) #### Parameters | | | | | --- | --- | --- | | string | $anonymousClass | | | string | $rememberMeClass | | ### bool isAnonymous([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated anonymously. If null is passed, the method must return false. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | ### bool isRememberMe([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated using remember-me capabilities. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | ### bool isFullFledged([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is fully authenticated. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\Security\Core\Authentication\Provider Symfony\Component\Security\Core\Authentication\Provider ======================================================= Classes ------- | | | | --- | --- | | [AnonymousAuthenticationProvider](provider/anonymousauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider") | AnonymousAuthenticationProvider validates AnonymousToken instances. | | [DaoAuthenticationProvider](provider/daoauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider") | DaoAuthenticationProvider uses a UserProviderInterface to retrieve the user for a UsernamePasswordToken. | | [LdapBindAuthenticationProvider](provider/ldapbindauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\LdapBindAuthenticationProvider") | LdapBindAuthenticationProvider authenticates a user against an LDAP server. | | [PreAuthenticatedAuthenticationProvider](provider/preauthenticatedauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider") | Processes a pre-authenticated authentication request. | | [RememberMeAuthenticationProvider](provider/remembermeauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider") | | | [SimpleAuthenticationProvider](provider/simpleauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\SimpleAuthenticationProvider") | | | [UserAuthenticationProvider](provider/userauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") | UserProviderInterface retrieves users for UsernamePasswordToken tokens. | Interfaces ---------- | | | | --- | --- | | *[AuthenticationProviderInterface](provider/authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface")* | AuthenticationProviderInterface is the interface for all authentication providers. | symfony AuthenticationProviderManager AuthenticationProviderManager ============================== class **AuthenticationProviderManager** implements [AuthenticationManagerInterface](authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") AuthenticationProviderManager uses a list of AuthenticationProviderInterface instances to authenticate a Token. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $providers, bool $eraseCredentials = true) | | | | [setEventDispatcher](#method_setEventDispatcher)([EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) | | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | Details ------- ### \_\_construct(iterable $providers, bool $eraseCredentials = true) #### Parameters | | | | | --- | --- | --- | | iterable | $providers | An iterable with AuthenticationProviderInterface instances as values | | bool | $eraseCredentials | Whether to erase credentials after authentication or not | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### setEventDispatcher([EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) #### Parameters | | | | | --- | --- | --- | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | symfony AuthenticationTrustResolverInterface AuthenticationTrustResolverInterface ===================================== interface **AuthenticationTrustResolverInterface** Interface for resolving the authentication status of a given token. Methods ------- | | | | | --- | --- | --- | | bool | [isAnonymous](#method_isAnonymous)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated anonymously. | | | bool | [isRememberMe](#method_isRememberMe)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated using remember-me capabilities. | | | bool | [isFullFledged](#method_isFullFledged)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is fully authenticated. | | Details ------- ### bool isAnonymous([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated anonymously. If null is passed, the method must return false. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | ### bool isRememberMe([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is authenticated using remember-me capabilities. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | ### bool isFullFledged([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Resolves whether the passed token implementation is fully authenticated. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\Security\Core\Authentication\RememberMe Symfony\Component\Security\Core\Authentication\RememberMe ========================================================= Classes ------- | | | | --- | --- | | [InMemoryTokenProvider](rememberme/inmemorytokenprovider "Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider") | This class is used for testing purposes, and is not really suited for production. | | [PersistentToken](rememberme/persistenttoken "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken") | | Interfaces ---------- | | | | --- | --- | | *[PersistentTokenInterface](rememberme/persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface")* | Interface to be implemented by persistent token classes (such as Doctrine entities representing a remember-me token). | | *[TokenProviderInterface](rememberme/tokenproviderinterface "Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface")* | Interface for TokenProviders. |
programming_docs
symfony SimpleAuthenticatorInterface SimpleAuthenticatorInterface ============================= interface **SimpleAuthenticatorInterface** Methods ------- | | | | | --- | --- | --- | | | [authenticateToken](#method_authenticateToken)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [UserProviderInterface](../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, $providerKey) | | | | [supportsToken](#method_supportsToken)([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, $providerKey) | | Details ------- ### authenticateToken([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [UserProviderInterface](../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, $providerKey) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | [UserProviderInterface](../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | | $providerKey | | ### supportsToken([TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, $providerKey) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | | $providerKey | | symfony Symfony\Component\Security\Core\Authentication\Token Symfony\Component\Security\Core\Authentication\Token ==================================================== Namespaces ---------- [Symfony\Component\Security\Core\Authentication\Token\Storage](token/storage) Classes ------- | | | | --- | --- | | [AbstractToken](token/abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | Base class for Token instances. | | [AnonymousToken](token/anonymoustoken "Symfony\Component\Security\Core\Authentication\Token\AnonymousToken") | AnonymousToken represents an anonymous token. | | [PreAuthenticatedToken](token/preauthenticatedtoken "Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken") | PreAuthenticatedToken implements a pre-authenticated token. | | [RememberMeToken](token/remembermetoken "Symfony\Component\Security\Core\Authentication\Token\RememberMeToken") | Authentication Token for "Remember-Me". | | [UsernamePasswordToken](token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | UsernamePasswordToken implements a username and password token. | Interfaces ---------- | | | | --- | --- | | *[TokenInterface](token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")* | TokenInterface is the interface for the user authentication information. | symfony AnonymousToken AnonymousToken =============== class **AnonymousToken** extends [AbstractToken](abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") AnonymousToken represents an anonymous token. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $secret, string|object $user, array $roles = array()) | | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [AbstractToken](abstracttoken#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getUsername](#method_getUsername)() Returns the username. | from [AbstractToken](abstracttoken#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [AbstractToken](abstracttoken#method_getUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [AbstractToken](abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [AbstractToken](abstracttoken#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAuthenticated](#method_setAuthenticated)($authenticated) Sets the authenticated flag. | from [AbstractToken](abstracttoken#method_setAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | from [AbstractToken](abstracttoken#method_eraseCredentials "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [AbstractToken](abstracttoken#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [AbstractToken](abstracttoken#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [AbstractToken](abstracttoken#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [AbstractToken](abstracttoken#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [AbstractToken](abstracttoken#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [AbstractToken](abstracttoken#method___toString "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials. | | | string | [getSecret](#method_getSecret)() Returns the secret. | | Details ------- ### \_\_construct(string $secret, string|object $user, array $roles = array()) #### Parameters | | | | | --- | --- | --- | | string | $secret | A secret used to make sure the token is created by the app and not by a malicious client | | string|object | $user | The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string | | array | $roles | An array of roles | ### [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($authenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $authenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### mixed getCredentials() Returns the user credentials. #### Return Value | | | | --- | --- | | mixed | The user credentials | ### string getSecret() Returns the secret. #### Return Value | | | | --- | --- | | string | | symfony PreAuthenticatedToken PreAuthenticatedToken ====================== class **PreAuthenticatedToken** extends [AbstractToken](abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") PreAuthenticatedToken implements a pre-authenticated token. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|object $user, mixed $credentials, string $providerKey, array $roles = array()) | | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [AbstractToken](abstracttoken#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getUsername](#method_getUsername)() Returns the username. | from [AbstractToken](abstracttoken#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [AbstractToken](abstracttoken#method_getUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [AbstractToken](abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [AbstractToken](abstracttoken#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAuthenticated](#method_setAuthenticated)($authenticated) Sets the authenticated flag. | from [AbstractToken](abstracttoken#method_setAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($str) {@inheritdoc} | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [AbstractToken](abstracttoken#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [AbstractToken](abstracttoken#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [AbstractToken](abstracttoken#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [AbstractToken](abstracttoken#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [AbstractToken](abstracttoken#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [AbstractToken](abstracttoken#method___toString "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getProviderKey](#method_getProviderKey)() Returns the provider key. | | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials. | | Details ------- ### \_\_construct(string|object $user, mixed $credentials, string $providerKey, array $roles = array()) #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string | | mixed | $credentials | The user credentials | | string | $providerKey | The provider key | | array | $roles | An array of roles | ### [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($authenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $authenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($str) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $str | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### string getProviderKey() Returns the provider key. #### Return Value | | | | --- | --- | | string | The provider key | ### mixed getCredentials() Returns the user credentials. #### Return Value | | | | --- | --- | | mixed | The user credentials | symfony Symfony\Component\Security\Core\Authentication\Token\Storage Symfony\Component\Security\Core\Authentication\Token\Storage ============================================================ Classes ------- | | | | --- | --- | | [TokenStorage](storage/tokenstorage "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage") | TokenStorage contains a TokenInterface. | Interfaces ---------- | | | | --- | --- | | *[TokenStorageInterface](storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface")* | The TokenStorageInterface. | symfony AbstractToken AbstractToken ============== abstract class **AbstractToken** implements [TokenInterface](tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") Base class for Token instances. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $roles = array()) | | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | | | string | [getUsername](#method_getUsername)() Returns the username. | | | string|object | [getUser](#method_getUser)() Returns a user representation. | | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | | | | [setAuthenticated](#method_setAuthenticated)($authenticated) Sets the authenticated flag. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | | Details ------- ### \_\_construct(array $roles = array()) #### Parameters | | | | | --- | --- | --- | | array | $roles | An array of roles | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($authenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $authenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony UsernamePasswordToken UsernamePasswordToken ====================== class **UsernamePasswordToken** extends [AbstractToken](abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") UsernamePasswordToken implements a username and password token. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|object $user, mixed $credentials, string $providerKey, array $roles = array()) | | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [AbstractToken](abstracttoken#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getUsername](#method_getUsername)() Returns the username. | from [AbstractToken](abstracttoken#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [AbstractToken](abstracttoken#method_getUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [AbstractToken](abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [AbstractToken](abstracttoken#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAuthenticated](#method_setAuthenticated)($isAuthenticated) Sets the authenticated flag. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [AbstractToken](abstracttoken#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [AbstractToken](abstracttoken#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [AbstractToken](abstracttoken#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [AbstractToken](abstracttoken#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [AbstractToken](abstracttoken#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [AbstractToken](abstracttoken#method___toString "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials. | | | string | [getProviderKey](#method_getProviderKey)() Returns the provider key. | | Details ------- ### \_\_construct(string|object $user, mixed $credentials, string $providerKey, array $roles = array()) #### Parameters | | | | | --- | --- | --- | | string|object | $user | The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a \_\_toString method | | mixed | $credentials | This usually is the password of the user | | string | $providerKey | The provider key | | array | $roles | An array of roles | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($isAuthenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $isAuthenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### mixed getCredentials() Returns the user credentials. #### Return Value | | | | --- | --- | | mixed | The user credentials | ### string getProviderKey() Returns the provider key. #### Return Value | | | | --- | --- | | string | The provider key | symfony TokenInterface TokenInterface =============== interface **TokenInterface** implements [Serializable](http://php.net/Serializable) TokenInterface is the interface for the user authentication information. Methods ------- | | | | | --- | --- | --- | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials. | | | string|object | [getUser](#method_getUser)() Returns a user representation. | | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | | | string | [getUsername](#method_getUsername)() Returns the username. | | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | | | | [setAuthenticated](#method_setAuthenticated)(bool $isAuthenticated) Sets the authenticated flag. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | | Details ------- ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### mixed getCredentials() Returns the user credentials. #### Return Value | | | | --- | --- | | mixed | The user credentials | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | #### See also | | | | --- | --- | | [AbstractToken::setUser](abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated(bool $isAuthenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | bool | $isAuthenticated | The authenticated flag | ### eraseCredentials() Removes sensitive information from the token. ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | symfony RememberMeToken RememberMeToken ================ class **RememberMeToken** extends [AbstractToken](abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") Authentication Token for "Remember-Me". Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey, string $secret) | | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [AbstractToken](abstracttoken#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getUsername](#method_getUsername)() Returns the username. | from [AbstractToken](abstracttoken#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [AbstractToken](abstracttoken#method_getUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [AbstractToken](abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [AbstractToken](abstracttoken#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAuthenticated](#method_setAuthenticated)($authenticated) Sets the authenticated flag. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | from [AbstractToken](abstracttoken#method_eraseCredentials "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [AbstractToken](abstracttoken#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [AbstractToken](abstracttoken#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [AbstractToken](abstracttoken#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [AbstractToken](abstracttoken#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [AbstractToken](abstracttoken#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [AbstractToken](abstracttoken#method___toString "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getProviderKey](#method_getProviderKey)() Returns the provider secret. | | | string | [getSecret](#method_getSecret)() Returns the secret. | | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials. | | Details ------- ### \_\_construct([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey, string $secret) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | string | $providerKey | | | string | $secret | A secret used to make sure the token is created by the app and not by a malicious client | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($authenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $authenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### string getProviderKey() Returns the provider secret. #### Return Value | | | | --- | --- | | string | The provider secret | ### string getSecret() Returns the secret. #### Return Value | | | | --- | --- | | string | | ### mixed getCredentials() Returns the user credentials. #### Return Value | | | | --- | --- | | mixed | The user credentials | symfony TokenStorageInterface TokenStorageInterface ====================== interface **TokenStorageInterface** The TokenStorageInterface. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | [getToken](#method_getToken)() Returns the current security token. | | | | [setToken](#method_setToken)([TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Sets the authentication token. | | Details ------- ### [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null getToken() Returns the current security token. #### Return Value | | | | --- | --- | | [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | A TokenInterface instance or null if no authentication information is available | ### setToken([TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Sets the authentication token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface token, or null if no further authentication information should be stored |
programming_docs
symfony TokenStorage TokenStorage ============= class **TokenStorage** implements [TokenStorageInterface](tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") TokenStorage contains a TokenInterface. It gives access to the token representing the current user authentication. Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | [getToken](#method_getToken)() Returns the current security token. | | | | [setToken](#method_setToken)([TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Sets the authentication token. | | Details ------- ### [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null getToken() Returns the current security token. #### Return Value | | | | --- | --- | | [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | A TokenInterface instance or null if no authentication information is available | ### setToken([TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) Sets the authentication token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | A TokenInterface token, or null if no further authentication information should be stored | symfony PreAuthenticatedAuthenticationProvider PreAuthenticatedAuthenticationProvider ======================================= class **PreAuthenticatedAuthenticationProvider** implements [AuthenticationProviderInterface](authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface") Processes a pre-authenticated authentication request. This authentication provider will not perform any checks on authentication requests, as they should already be pre-authenticated. However, the UserProviderInterface implementation may still throw a UsernameNotFoundException, for example. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | Details ------- ### \_\_construct([UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey) #### Parameters | | | | | --- | --- | --- | | [UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | | string | $providerKey | | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | symfony AnonymousAuthenticationProvider AnonymousAuthenticationProvider ================================ class **AnonymousAuthenticationProvider** implements [AuthenticationProviderInterface](authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface") AnonymousAuthenticationProvider validates AnonymousToken instances. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $secret) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | Details ------- ### \_\_construct(string $secret) #### Parameters | | | | | --- | --- | --- | | string | $secret | The secret shared with the AnonymousToken | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | symfony SimpleAuthenticationProvider SimpleAuthenticationProvider ============================= class **SimpleAuthenticationProvider** implements [AuthenticationProviderInterface](authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SimpleAuthenticatorInterface](../simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") $simpleAuthenticator, [UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, string $providerKey, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker = null) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | Details ------- ### \_\_construct([SimpleAuthenticatorInterface](../simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") $simpleAuthenticator, [UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, string $providerKey, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker = null) #### Parameters | | | | | --- | --- | --- | | [SimpleAuthenticatorInterface](../simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") | $simpleAuthenticator | | | [UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | string | $providerKey | | | [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | symfony AuthenticationProviderInterface AuthenticationProviderInterface ================================ interface **AuthenticationProviderInterface** implements [AuthenticationManagerInterface](../authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") AuthenticationProviderInterface is the interface for all authentication providers. Concrete implementations processes specific Token instances. Constants --------- | | | | --- | --- | | USERNAME\_NONE\_PROVIDED | *Use this constant for not provided username.* | Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | from [AuthenticationManagerInterface](../authenticationmanagerinterface#method_authenticate "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | Details ------- ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | symfony LdapBindAuthenticationProvider LdapBindAuthenticationProvider =============================== class **LdapBindAuthenticationProvider** extends [UserAuthenticationProvider](userauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") LdapBindAuthenticationProvider authenticates a user against an LDAP server. The only way to check user credentials is to try to connect the user with its credentials to the ldap. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, [LdapInterface](../../../../ldap/ldapinterface "Symfony\Component\Ldap\LdapInterface") $ldap, string $dnString = '{username}', bool $hideUserNotFoundExceptions = true) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | from [UserAuthenticationProvider](userauthenticationprovider#method_authenticate "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | from [UserAuthenticationProvider](userauthenticationprovider#method_supports "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [retrieveUser](#method_retrieveUser)(string $username, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Retrieves the user from an implementation-specific location. | | | | [checkAuthentication](#method_checkAuthentication)([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Does additional checks on the user and token (like validating the credentials). | | | | [setQueryString](#method_setQueryString)(string $queryString) Set a query string to use in order to find a DN for the username. | | Details ------- ### \_\_construct([UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, [LdapInterface](../../../../ldap/ldapinterface "Symfony\Component\Ldap\LdapInterface") $ldap, string $dnString = '{username}', bool $hideUserNotFoundExceptions = true) #### Parameters | | | | | --- | --- | --- | | [UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | | string | $providerKey | | | [LdapInterface](../../../../ldap/ldapinterface "Symfony\Component\Ldap\LdapInterface") | $ldap | | | string | $dnString | | | bool | $hideUserNotFoundExceptions | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | ### protected [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") retrieveUser(string $username, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Retrieves the user from an implementation-specific location. #### Parameters | | | | | --- | --- | --- | | string | $username | The username to retrieve | | [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | $token | The Token | #### Return Value | | | | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | The user | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the credentials could not be validated | ### protected checkAuthentication([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Does additional checks on the user and token (like validating the credentials). #### Parameters | | | | | --- | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | $token | | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the credentials could not be validated | ### setQueryString(string $queryString) Set a query string to use in order to find a DN for the username. #### Parameters | | | | | --- | --- | --- | | string | $queryString | |
programming_docs
symfony DaoAuthenticationProvider DaoAuthenticationProvider ========================== class **DaoAuthenticationProvider** extends [UserAuthenticationProvider](userauthenticationprovider "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") DaoAuthenticationProvider uses a UserProviderInterface to retrieve the user for a UsernamePasswordToken. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, [EncoderFactoryInterface](../../encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory, bool $hideUserNotFoundExceptions = true) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | from [UserAuthenticationProvider](userauthenticationprovider#method_authenticate "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | from [UserAuthenticationProvider](userauthenticationprovider#method_supports "Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider") | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [retrieveUser](#method_retrieveUser)(string $username, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Retrieves the user from an implementation-specific location. | | | | [checkAuthentication](#method_checkAuthentication)([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Does additional checks on the user and token (like validating the credentials). | | Details ------- ### \_\_construct([UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, [EncoderFactoryInterface](../../encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory, bool $hideUserNotFoundExceptions = true) #### Parameters | | | | | --- | --- | --- | | [UserProviderInterface](../../user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | | string | $providerKey | | | [EncoderFactoryInterface](../../encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") | $encoderFactory | | | bool | $hideUserNotFoundExceptions | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | ### protected [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") retrieveUser(string $username, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Retrieves the user from an implementation-specific location. #### Parameters | | | | | --- | --- | --- | | string | $username | The username to retrieve | | [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | $token | The Token | #### Return Value | | | | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | The user | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the credentials could not be validated | ### protected checkAuthentication([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Does additional checks on the user and token (like validating the credentials). #### Parameters | | | | | --- | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | $token | | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the credentials could not be validated | symfony RememberMeAuthenticationProvider RememberMeAuthenticationProvider ================================= class **RememberMeAuthenticationProvider** implements [AuthenticationProviderInterface](authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $secret, string $providerKey) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | Details ------- ### \_\_construct([UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $secret, string $providerKey) #### Parameters | | | | | --- | --- | --- | | [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | An UserCheckerInterface interface | | string | $secret | A secret | | string | $providerKey | A provider secret | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | symfony UserAuthenticationProvider UserAuthenticationProvider =========================== abstract class **UserAuthenticationProvider** implements [AuthenticationProviderInterface](authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface") UserProviderInterface retrieves users for UsernamePasswordToken tokens. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, bool $hideUserNotFoundExceptions = true) | | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. | | | bool | [supports](#method_supports)([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [retrieveUser](#method_retrieveUser)(string $username, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Retrieves the user from an implementation-specific location. | | | | [checkAuthentication](#method_checkAuthentication)([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Does additional checks on the user and token (like validating the credentials). | | Details ------- ### \_\_construct([UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, bool $hideUserNotFoundExceptions = true) #### Parameters | | | | | --- | --- | --- | | [UserCheckerInterface](../../user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | | string | $providerKey | | | bool | $hideUserNotFoundExceptions | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Attempts to authenticate a TokenInterface object. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | ### bool supports([TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | ### abstract protected [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") retrieveUser(string $username, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Retrieves the user from an implementation-specific location. #### Parameters | | | | | --- | --- | --- | | string | $username | The username to retrieve | | [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | $token | The Token | #### Return Value | | | | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | The user | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the credentials could not be validated | ### abstract protected checkAuthentication([UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") $token) Does additional checks on the user and token (like validating the credentials). #### Parameters | | | | | --- | --- | --- | | [UserInterface](../../user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | [UsernamePasswordToken](../token/usernamepasswordtoken "Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken") | $token | | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the credentials could not be validated | symfony PersistentTokenInterface PersistentTokenInterface ========================= interface **PersistentTokenInterface** Interface to be implemented by persistent token classes (such as Doctrine entities representing a remember-me token). Methods ------- | | | | | --- | --- | --- | | string | [getClass](#method_getClass)() Returns the class of the user. | | | string | [getUsername](#method_getUsername)() Returns the username. | | | string | [getSeries](#method_getSeries)() Returns the series. | | | string | [getTokenValue](#method_getTokenValue)() Returns the token value. | | | [DateTime](http://php.net/DateTime) | [getLastUsed](#method_getLastUsed)() Returns the time the token was last used. | | Details ------- ### string getClass() Returns the class of the user. #### Return Value | | | | --- | --- | | string | | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string getSeries() Returns the series. #### Return Value | | | | --- | --- | | string | | ### string getTokenValue() Returns the token value. #### Return Value | | | | --- | --- | | string | | ### [DateTime](http://php.net/DateTime) getLastUsed() Returns the time the token was last used. #### Return Value | | | | --- | --- | | [DateTime](http://php.net/DateTime) | | symfony TokenProviderInterface TokenProviderInterface ======================= interface **TokenProviderInterface** Interface for TokenProviders. Methods ------- | | | | | --- | --- | --- | | [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") | [loadTokenBySeries](#method_loadTokenBySeries)(string $series) Loads the active token for the given series. | | | | [deleteTokenBySeries](#method_deleteTokenBySeries)(string $series) Deletes all tokens belonging to series. | | | | [updateToken](#method_updateToken)(string $series, string $tokenValue, [DateTime](http://php.net/DateTime) $lastUsed) Updates the token according to this data. | | | | [createNewToken](#method_createNewToken)([PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") $token) Creates a new token. | | Details ------- ### [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") loadTokenBySeries(string $series) Loads the active token for the given series. #### Parameters | | | | | --- | --- | --- | | string | $series | | #### Return Value | | | | --- | --- | | [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") | | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../../exception/tokennotfoundexception "Symfony\Component\Security\Core\Exception\TokenNotFoundException") | if the token is not found | ### deleteTokenBySeries(string $series) Deletes all tokens belonging to series. #### Parameters | | | | | --- | --- | --- | | string | $series | | ### updateToken(string $series, string $tokenValue, [DateTime](http://php.net/DateTime) $lastUsed) Updates the token according to this data. #### Parameters | | | | | --- | --- | --- | | string | $series | | | string | $tokenValue | | | [DateTime](http://php.net/DateTime) | $lastUsed | | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../../exception/tokennotfoundexception "Symfony\Component\Security\Core\Exception\TokenNotFoundException") | if the token is not found | ### createNewToken([PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") $token) Creates a new token. #### Parameters | | | | | --- | --- | --- | | [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") | $token | |
programming_docs
symfony InMemoryTokenProvider InMemoryTokenProvider ====================== class **InMemoryTokenProvider** implements [TokenProviderInterface](tokenproviderinterface "Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface") This class is used for testing purposes, and is not really suited for production. Methods ------- | | | | | --- | --- | --- | | [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") | [loadTokenBySeries](#method_loadTokenBySeries)(string $series) Loads the active token for the given series. | | | | [updateToken](#method_updateToken)(string $series, string $tokenValue, [DateTime](http://php.net/DateTime) $lastUsed) Updates the token according to this data. | | | | [deleteTokenBySeries](#method_deleteTokenBySeries)(string $series) Deletes all tokens belonging to series. | | | | [createNewToken](#method_createNewToken)([PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") $token) Creates a new token. | | Details ------- ### [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") loadTokenBySeries(string $series) Loads the active token for the given series. #### Parameters | | | | | --- | --- | --- | | string | $series | | #### Return Value | | | | --- | --- | | [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") | | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../../exception/tokennotfoundexception "Symfony\Component\Security\Core\Exception\TokenNotFoundException") | if the token is not found | ### updateToken(string $series, string $tokenValue, [DateTime](http://php.net/DateTime) $lastUsed) Updates the token according to this data. #### Parameters | | | | | --- | --- | --- | | string | $series | | | string | $tokenValue | | | [DateTime](http://php.net/DateTime) | $lastUsed | | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../../exception/tokennotfoundexception "Symfony\Component\Security\Core\Exception\TokenNotFoundException") | if the token is not found | ### deleteTokenBySeries(string $series) Deletes all tokens belonging to series. #### Parameters | | | | | --- | --- | --- | | string | $series | | ### createNewToken([PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") $token) Creates a new token. #### Parameters | | | | | --- | --- | --- | | [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") | $token | | symfony PersistentToken PersistentToken ================ class **PersistentToken** implements [PersistentTokenInterface](persistenttokeninterface "Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $class, string $username, string $series, string $tokenValue, [DateTime](http://php.net/DateTime) $lastUsed) | | | string | [getClass](#method_getClass)() Returns the class of the user. | | | string | [getUsername](#method_getUsername)() Returns the username. | | | string | [getSeries](#method_getSeries)() Returns the series. | | | string | [getTokenValue](#method_getTokenValue)() Returns the token value. | | | [DateTime](http://php.net/DateTime) | [getLastUsed](#method_getLastUsed)() Returns the time the token was last used. | | Details ------- ### \_\_construct(string $class, string $username, string $series, string $tokenValue, [DateTime](http://php.net/DateTime) $lastUsed) #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $username | | | string | $series | | | string | $tokenValue | | | [DateTime](http://php.net/DateTime) | $lastUsed | | ### string getClass() Returns the class of the user. #### Return Value | | | | --- | --- | | string | | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string getSeries() Returns the series. #### Return Value | | | | --- | --- | | string | | ### string getTokenValue() Returns the token value. #### Return Value | | | | --- | --- | | string | | ### [DateTime](http://php.net/DateTime) getLastUsed() Returns the time the token was last used. #### Return Value | | | | --- | --- | | [DateTime](http://php.net/DateTime) | | symfony AuthenticationEvent AuthenticationEvent ==================== class **AuthenticationEvent** extends [Event](../../../eventdispatcher/event "Symfony\Component\EventDispatcher\Event") This is a general purpose authentication event. Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | | | | [getAuthenticationToken](#method_getAuthenticationToken)() | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### getAuthenticationToken() symfony AuthenticationFailureEvent AuthenticationFailureEvent =========================== class **AuthenticationFailureEvent** extends [AuthenticationEvent](authenticationevent "Symfony\Component\Security\Core\Event\AuthenticationEvent") This event is dispatched on authentication failure. Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [AuthenticationException](../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $ex) | | | | [getAuthenticationToken](#method_getAuthenticationToken)() | from [AuthenticationEvent](authenticationevent#method_getAuthenticationToken "Symfony\Component\Security\Core\Event\AuthenticationEvent") | | | [getAuthenticationException](#method_getAuthenticationException)() | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [AuthenticationException](../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $ex) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | [AuthenticationException](../exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $ex | | ### getAuthenticationToken() ### getAuthenticationException() symfony Symfony\Component\Security\Csrf\Exception Symfony\Component\Security\Csrf\Exception ========================================= Classes ------- | | | | --- | --- | | [TokenNotFoundException](exception/tokennotfoundexception "Symfony\Component\Security\Csrf\Exception\TokenNotFoundException") | | symfony Symfony\Component\Security\Csrf\TokenGenerator Symfony\Component\Security\Csrf\TokenGenerator ============================================== Classes ------- | | | | --- | --- | | [UriSafeTokenGenerator](tokengenerator/urisafetokengenerator "Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator") | Generates CSRF tokens. | Interfaces ---------- | | | | --- | --- | | *[TokenGeneratorInterface](tokengenerator/tokengeneratorinterface "Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface")* | Generates CSRF tokens. | symfony Symfony\Component\Security\Csrf\TokenStorage Symfony\Component\Security\Csrf\TokenStorage ============================================ Classes ------- | | | | --- | --- | | [NativeSessionTokenStorage](tokenstorage/nativesessiontokenstorage "Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage") | Token storage that uses PHP's native session handling. | | [SessionTokenStorage](tokenstorage/sessiontokenstorage "Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage") | Token storage that uses a Symfony Session object. | Interfaces ---------- | | | | --- | --- | | *[ClearableTokenStorageInterface](tokenstorage/clearabletokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface")* | | | *[TokenStorageInterface](tokenstorage/tokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface")* | Stores CSRF tokens. | symfony CsrfTokenManagerInterface CsrfTokenManagerInterface ========================== interface **CsrfTokenManagerInterface** Manages CSRF tokens. Methods ------- | | | | | --- | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | [getToken](#method_getToken)(string $tokenId) Returns a CSRF token for the given ID. | | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | [refreshToken](#method_refreshToken)(string $tokenId) Generates a new token value for the given ID. | | | string|null | [removeToken](#method_removeToken)(string $tokenId) Invalidates the CSRF token with the given ID, if one exists. | | | bool | [isTokenValid](#method_isTokenValid)([CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") $token) Returns whether the given CSRF token is valid. | | Details ------- ### [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") getToken(string $tokenId) Returns a CSRF token for the given ID. If previously no token existed for the given ID, a new token is generated. Otherwise the existing token is returned (with the same value, not the same instance). #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID. You may choose an arbitrary value for the ID | #### Return Value | | | | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | The CSRF token | ### [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") refreshToken(string $tokenId) Generates a new token value for the given ID. This method will generate a new token for the given token ID, independent of whether a token value previously existed or not. It can be used to enforce once-only tokens in environments with high security needs. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID. You may choose an arbitrary value for the ID | #### Return Value | | | | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | The CSRF token | ### string|null removeToken(string $tokenId) Invalidates the CSRF token with the given ID, if one exists. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string|null | Returns the removed token value if one existed, NULL otherwise | ### bool isTokenValid([CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") $token) Returns whether the given CSRF token is valid. #### Parameters | | | | | --- | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | $token | | #### Return Value | | | | --- | --- | | bool | Returns true if the token is valid, false otherwise | symfony CsrfTokenManager CsrfTokenManager ================= class **CsrfTokenManager** implements [CsrfTokenManagerInterface](csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") Default implementation of {@link CsrfTokenManagerInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenGeneratorInterface](tokengenerator/tokengeneratorinterface "Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface") $generator = null, [TokenStorageInterface](tokenstorage/tokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") $storage = null, $namespace = null) | | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | [getToken](#method_getToken)(string $tokenId) Returns a CSRF token for the given ID. | | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | [refreshToken](#method_refreshToken)(string $tokenId) Generates a new token value for the given ID. | | | string|null | [removeToken](#method_removeToken)(string $tokenId) Invalidates the CSRF token with the given ID, if one exists. | | | bool | [isTokenValid](#method_isTokenValid)([CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") $token) Returns whether the given CSRF token is valid. | | Details ------- ### \_\_construct([TokenGeneratorInterface](tokengenerator/tokengeneratorinterface "Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface") $generator = null, [TokenStorageInterface](tokenstorage/tokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") $storage = null, $namespace = null) #### Parameters | | | | | --- | --- | --- | | [TokenGeneratorInterface](tokengenerator/tokengeneratorinterface "Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface") | $generator | | | [TokenStorageInterface](tokenstorage/tokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") | $storage | | | | $namespace | | ### [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") getToken(string $tokenId) Returns a CSRF token for the given ID. If previously no token existed for the given ID, a new token is generated. Otherwise the existing token is returned (with the same value, not the same instance). #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID. You may choose an arbitrary value for the ID | #### Return Value | | | | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | The CSRF token | ### [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") refreshToken(string $tokenId) Generates a new token value for the given ID. This method will generate a new token for the given token ID, independent of whether a token value previously existed or not. It can be used to enforce once-only tokens in environments with high security needs. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID. You may choose an arbitrary value for the ID | #### Return Value | | | | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | The CSRF token | ### string|null removeToken(string $tokenId) Invalidates the CSRF token with the given ID, if one exists. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string|null | Returns the removed token value if one existed, NULL otherwise | ### bool isTokenValid([CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") $token) Returns whether the given CSRF token is valid. #### Parameters | | | | | --- | --- | --- | | [CsrfToken](csrftoken "Symfony\Component\Security\Csrf\CsrfToken") | $token | | #### Return Value | | | | --- | --- | | bool | Returns true if the token is valid, false otherwise | symfony CsrfToken CsrfToken ========== class **CsrfToken** A CSRF token. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id, string|null $value) | | | string | [getId](#method_getId)() Returns the ID of the CSRF token. | | | string | [getValue](#method_getValue)() Returns the value of the CSRF token. | | | string | [\_\_toString](#method___toString)() Returns the value of the CSRF token. | | Details ------- ### \_\_construct(string $id, string|null $value) #### Parameters | | | | | --- | --- | --- | | string | $id | | | string|null | $value | | ### string getId() Returns the ID of the CSRF token. #### Return Value | | | | --- | --- | | string | The token ID | ### string getValue() Returns the value of the CSRF token. #### Return Value | | | | --- | --- | | string | The token value | ### string \_\_toString() Returns the value of the CSRF token. #### Return Value | | | | --- | --- | | string | The token value | symfony TokenStorageInterface TokenStorageInterface ====================== interface **TokenStorageInterface** Stores CSRF tokens. Methods ------- | | | | | --- | --- | --- | | string | [getToken](#method_getToken)(string $tokenId) Reads a stored CSRF token. | | | | [setToken](#method_setToken)(string $tokenId, string $token) Stores a CSRF token. | | | string|null | [removeToken](#method_removeToken)(string $tokenId) Removes a CSRF token. | | | bool | [hasToken](#method_hasToken)(string $tokenId) Checks whether a token with the given token ID exists. | | Details ------- ### string getToken(string $tokenId) Reads a stored CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string | The stored token | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../exception/tokennotfoundexception "Symfony\Component\Security\Csrf\Exception\TokenNotFoundException") | If the token ID does not exist | ### setToken(string $tokenId, string $token) Stores a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | | string | $token | The CSRF token | ### string|null removeToken(string $tokenId) Removes a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string|null | Returns the removed token if one existed, NULL otherwise | ### bool hasToken(string $tokenId) Checks whether a token with the given token ID exists. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | bool | Whether a token exists with the given ID |
programming_docs
symfony NativeSessionTokenStorage NativeSessionTokenStorage ========================== class **NativeSessionTokenStorage** implements [ClearableTokenStorageInterface](clearabletokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface") Token storage that uses PHP's native session handling. Constants --------- | | | | --- | --- | | SESSION\_NAMESPACE | *The namespace used to store values in the session.* | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $namespace = self::SESSION\_NAMESPACE) Initializes the storage with a session namespace. | | | string | [getToken](#method_getToken)(string $tokenId) Reads a stored CSRF token. | | | | [setToken](#method_setToken)(string $tokenId, string $token) Stores a CSRF token. | | | bool | [hasToken](#method_hasToken)(string $tokenId) Checks whether a token with the given token ID exists. | | | string|null | [removeToken](#method_removeToken)(string $tokenId) Removes a CSRF token. | | | | [clear](#method_clear)() Removes all CSRF tokens. | | Details ------- ### \_\_construct(string $namespace = self::SESSION\_NAMESPACE) Initializes the storage with a session namespace. #### Parameters | | | | | --- | --- | --- | | string | $namespace | The namespace under which the token is stored in the session | ### string getToken(string $tokenId) Reads a stored CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string | The stored token | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../exception/tokennotfoundexception "Symfony\Component\Security\Csrf\Exception\TokenNotFoundException") | If the token ID does not exist | ### setToken(string $tokenId, string $token) Stores a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | | string | $token | The CSRF token | ### bool hasToken(string $tokenId) Checks whether a token with the given token ID exists. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | bool | Whether a token exists with the given ID | ### string|null removeToken(string $tokenId) Removes a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string|null | Returns the removed token if one existed, NULL otherwise | ### clear() Removes all CSRF tokens. symfony SessionTokenStorage SessionTokenStorage ==================== class **SessionTokenStorage** implements [ClearableTokenStorageInterface](clearabletokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface") Token storage that uses a Symfony Session object. Constants --------- | | | | --- | --- | | SESSION\_NAMESPACE | *The namespace used to store values in the session.* | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SessionInterface](../../../httpfoundation/session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") $session, string $namespace = self::SESSION\_NAMESPACE) Initializes the storage with a Session object and a session namespace. | | | string | [getToken](#method_getToken)(string $tokenId) Reads a stored CSRF token. | | | | [setToken](#method_setToken)(string $tokenId, string $token) Stores a CSRF token. | | | bool | [hasToken](#method_hasToken)(string $tokenId) Checks whether a token with the given token ID exists. | | | string|null | [removeToken](#method_removeToken)(string $tokenId) Removes a CSRF token. | | | | [clear](#method_clear)() Removes all CSRF tokens. | | Details ------- ### \_\_construct([SessionInterface](../../../httpfoundation/session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") $session, string $namespace = self::SESSION\_NAMESPACE) Initializes the storage with a Session object and a session namespace. #### Parameters | | | | | --- | --- | --- | | [SessionInterface](../../../httpfoundation/session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") | $session | The user session from which the session ID is returned | | string | $namespace | The namespace under which the token is stored in the session | ### string getToken(string $tokenId) Reads a stored CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string | The stored token | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../exception/tokennotfoundexception "Symfony\Component\Security\Csrf\Exception\TokenNotFoundException") | If the token ID does not exist | ### setToken(string $tokenId, string $token) Stores a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | | string | $token | The CSRF token | ### bool hasToken(string $tokenId) Checks whether a token with the given token ID exists. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | bool | Whether a token exists with the given ID | ### string|null removeToken(string $tokenId) Removes a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string|null | Returns the removed token if one existed, NULL otherwise | ### clear() Removes all CSRF tokens. symfony ClearableTokenStorageInterface ClearableTokenStorageInterface =============================== interface **ClearableTokenStorageInterface** implements [TokenStorageInterface](tokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") Methods ------- | | | | | --- | --- | --- | | string | [getToken](#method_getToken)(string $tokenId) Reads a stored CSRF token. | from [TokenStorageInterface](tokenstorageinterface#method_getToken "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") | | | [setToken](#method_setToken)(string $tokenId, string $token) Stores a CSRF token. | from [TokenStorageInterface](tokenstorageinterface#method_setToken "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") | | string|null | [removeToken](#method_removeToken)(string $tokenId) Removes a CSRF token. | from [TokenStorageInterface](tokenstorageinterface#method_removeToken "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") | | bool | [hasToken](#method_hasToken)(string $tokenId) Checks whether a token with the given token ID exists. | from [TokenStorageInterface](tokenstorageinterface#method_hasToken "Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface") | | | [clear](#method_clear)() Removes all CSRF tokens. | | Details ------- ### string getToken(string $tokenId) Reads a stored CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string | The stored token | #### Exceptions | | | | --- | --- | | [TokenNotFoundException](../exception/tokennotfoundexception "Symfony\Component\Security\Csrf\Exception\TokenNotFoundException") | If the token ID does not exist | ### setToken(string $tokenId, string $token) Stores a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | | string | $token | The CSRF token | ### string|null removeToken(string $tokenId) Removes a CSRF token. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | string|null | Returns the removed token if one existed, NULL otherwise | ### bool hasToken(string $tokenId) Checks whether a token with the given token ID exists. #### Parameters | | | | | --- | --- | --- | | string | $tokenId | The token ID | #### Return Value | | | | --- | --- | | bool | Whether a token exists with the given ID | ### clear() Removes all CSRF tokens. symfony UriSafeTokenGenerator UriSafeTokenGenerator ====================== class **UriSafeTokenGenerator** implements [TokenGeneratorInterface](tokengeneratorinterface "Symfony\Component\Security\Csrf\TokenGenerator\TokenGeneratorInterface") Generates CSRF tokens. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int $entropy = 256) Generates URI-safe CSRF tokens. | | | string | [generateToken](#method_generateToken)() Generates a CSRF token. | | Details ------- ### \_\_construct(int $entropy = 256) Generates URI-safe CSRF tokens. #### Parameters | | | | | --- | --- | --- | | int | $entropy | The amount of entropy collected for each token (in bits) | ### string generateToken() Generates a CSRF token. #### Return Value | | | | --- | --- | | string | The generated CSRF token | symfony TokenGeneratorInterface TokenGeneratorInterface ======================== interface **TokenGeneratorInterface** Generates CSRF tokens. Methods ------- | | | | | --- | --- | --- | | string | [generateToken](#method_generateToken)() Generates a CSRF token. | | Details ------- ### string generateToken() Generates a CSRF token. #### Return Value | | | | --- | --- | | string | The generated CSRF token | symfony TokenNotFoundException TokenNotFoundException ======================= class **TokenNotFoundException** extends [RuntimeException](../../core/exception/runtimeexception "Symfony\Component\Security\Core\Exception\RuntimeException") symfony FirewallMapInterface FirewallMapInterface ===================== interface **FirewallMapInterface** This interface must be implemented by firewall maps. Methods ------- | | | | | --- | --- | --- | | array | [getListeners](#method_getListeners)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns the authentication listeners, and the exception listener to use for the given request. | | Details ------- ### array getListeners([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns the authentication listeners, and the exception listener to use for the given request. If there are no authentication listeners, the first inner array must be empty. If there is no exception listener, the second element of the outer array must be null. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | of the format array(array(AuthenticationListener), ExceptionListener) | symfony Symfony\Component\Security\Http\Util Symfony\Component\Security\Http\Util ==================================== Classes ------- | | | | --- | --- | | [TargetPathTrait](util/targetpathtrait "Symfony\Component\Security\Http\Util\TargetPathTrait") | Trait to get (and set) the URL the user last visited before being forced to authenticate. | symfony SecurityEvents SecurityEvents =============== class **SecurityEvents** Constants --------- | | | | --- | --- | | INTERACTIVE\_LOGIN | *The INTERACTIVE\_LOGIN event occurs after a user has actively logged into your website. It is important to distinguish this action from non-interactive authentication methods, such as: - authentication based on your session.** authentication using a HTTP basic or HTTP digest header. | | SWITCH\_USER | *The SWITCH\_USER event occurs before switch to another user and before exit from an already switched user.* | symfony Symfony\Component\Security\Http\Authentication Symfony\Component\Security\Http\Authentication ============================================== Classes ------- | | | | --- | --- | | [AuthenticationUtils](authentication/authenticationutils "Symfony\Component\Security\Http\Authentication\AuthenticationUtils") | Extracts Security Errors from Request. | | [CustomAuthenticationFailureHandler](authentication/customauthenticationfailurehandler "Symfony\Component\Security\Http\Authentication\CustomAuthenticationFailureHandler") | | | [CustomAuthenticationSuccessHandler](authentication/customauthenticationsuccesshandler "Symfony\Component\Security\Http\Authentication\CustomAuthenticationSuccessHandler") | | | [DefaultAuthenticationFailureHandler](authentication/defaultauthenticationfailurehandler "Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler") | Class with the default authentication failure handling logic. | | [DefaultAuthenticationSuccessHandler](authentication/defaultauthenticationsuccesshandler "Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler") | Class with the default authentication success handling logic. | | [SimpleAuthenticationHandler](authentication/simpleauthenticationhandler "Symfony\Component\Security\Http\Authentication\SimpleAuthenticationHandler") | Class to proxy authentication success/failure handlers. | Interfaces ---------- | | | | --- | --- | | *[AuthenticationFailureHandlerInterface](authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface")* | Interface for custom authentication failure handlers. | | *[AuthenticationSuccessHandlerInterface](authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface")* | Interface for a custom authentication success handler. | | *[SimpleFormAuthenticatorInterface](authentication/simpleformauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface")* | | | *[SimplePreAuthenticatorInterface](authentication/simplepreauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface")* | | symfony Symfony\Component\Security\Http\Authorization Symfony\Component\Security\Http\Authorization ============================================= Interfaces ---------- | | | | --- | --- | | *[AccessDeniedHandlerInterface](authorization/accessdeniedhandlerinterface "Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface")* | This is used by the ExceptionListener to translate an AccessDeniedException to a Response object. | symfony Symfony\Component\Security\Http\Event Symfony\Component\Security\Http\Event ===================================== Classes ------- | | | | --- | --- | | [InteractiveLoginEvent](event/interactiveloginevent "Symfony\Component\Security\Http\Event\InteractiveLoginEvent") | | | [SwitchUserEvent](event/switchuserevent "Symfony\Component\Security\Http\Event\SwitchUserEvent") | SwitchUserEvent. | symfony ParameterBagUtils ParameterBagUtils ================== class **ParameterBagUtils** Methods ------- | | | | | --- | --- | --- | | static mixed | [getParameterBagValue](#method_getParameterBagValue)([ParameterBag](../../httpfoundation/parameterbag "Symfony\Component\HttpFoundation\ParameterBag") $parameters, string $path) Returns a "parameter" value. | | | static mixed | [getRequestParameterValue](#method_getRequestParameterValue)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Returns a request "parameter" value. | | Details ------- ### static mixed getParameterBagValue([ParameterBag](../../httpfoundation/parameterbag "Symfony\Component\HttpFoundation\ParameterBag") $parameters, string $path) Returns a "parameter" value. Paths like foo[bar] will be evaluated to find deeper items in nested data structures. #### Parameters | | | | | --- | --- | --- | | [ParameterBag](../../httpfoundation/parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $parameters | The parameter bag | | string | $path | The key | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../propertyaccess/exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | when the given path is malformed | ### static mixed getRequestParameterValue([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Returns a request "parameter" value. Paths like foo[bar] will be evaluated to find deeper items in nested data structures. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request | | string | $path | The key | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../propertyaccess/exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | when the given path is malformed | symfony Symfony\Component\Security\Http\RememberMe Symfony\Component\Security\Http\RememberMe ========================================== Classes ------- | | | | --- | --- | | [AbstractRememberMeServices](rememberme/abstractremembermeservices "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | Base class implementing the RememberMeServicesInterface. | | [PersistentTokenBasedRememberMeServices](rememberme/persistenttokenbasedremembermeservices "Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices") | Concrete implementation of the RememberMeServicesInterface which needs an implementation of TokenProviderInterface for providing remember-me capabilities. | | [ResponseListener](rememberme/responselistener "Symfony\Component\Security\Http\RememberMe\ResponseListener") | Adds remember-me cookies to the Response. | | [TokenBasedRememberMeServices](rememberme/tokenbasedremembermeservices "Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices") | Concrete implementation of the RememberMeServicesInterface providing remember-me capabilities without requiring a TokenProvider. | Interfaces ---------- | | | | --- | --- | | *[RememberMeServicesInterface](rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface")* | Interface that needs to be implemented by classes which provide remember-me capabilities. | symfony Symfony\Component\Security\Http\Controller Symfony\Component\Security\Http\Controller ========================================== Classes ------- | | | | --- | --- | | [UserValueResolver](controller/uservalueresolver "Symfony\Component\Security\Http\Controller\UserValueResolver") | Supports the argument type of {see UserInterface}. | symfony FirewallMap FirewallMap ============ class **FirewallMap** implements [FirewallMapInterface](firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") FirewallMap allows configuration of different firewalls for specific parts of the website. Methods ------- | | | | | --- | --- | --- | | | [add](#method_add)([RequestMatcherInterface](../../httpfoundation/requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") $requestMatcher = null, array $listeners = array(), [ExceptionListener](firewall/exceptionlistener "Symfony\Component\Security\Http\Firewall\ExceptionListener") $exceptionListener = null, [LogoutListener](firewall/logoutlistener "Symfony\Component\Security\Http\Firewall\LogoutListener") $logoutListener = null) | | | array | [getListeners](#method_getListeners)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns the authentication listeners, and the exception listener to use for the given request. | | Details ------- ### add([RequestMatcherInterface](../../httpfoundation/requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") $requestMatcher = null, array $listeners = array(), [ExceptionListener](firewall/exceptionlistener "Symfony\Component\Security\Http\Firewall\ExceptionListener") $exceptionListener = null, [LogoutListener](firewall/logoutlistener "Symfony\Component\Security\Http\Firewall\LogoutListener") $logoutListener = null) #### Parameters | | | | | --- | --- | --- | | [RequestMatcherInterface](../../httpfoundation/requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") | $requestMatcher | | | array | $listeners | | | [ExceptionListener](firewall/exceptionlistener "Symfony\Component\Security\Http\Firewall\ExceptionListener") | $exceptionListener | | | [LogoutListener](firewall/logoutlistener "Symfony\Component\Security\Http\Firewall\LogoutListener") | $logoutListener | | ### array getListeners([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns the authentication listeners, and the exception listener to use for the given request. If there are no authentication listeners, the first inner array must be empty. If there is no exception listener, the second element of the outer array must be null. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | of the format array(array(AuthenticationListener), ExceptionListener) |
programming_docs
symfony AccessMap AccessMap ========== class **AccessMap** implements [AccessMapInterface](accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") AccessMap allows configuration of different access control rules for specific parts of the website. Methods ------- | | | | | --- | --- | --- | | | [add](#method_add)([RequestMatcherInterface](../../httpfoundation/requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") $requestMatcher, array $attributes = array(), string|null $channel = null) | | | array | [getPatterns](#method_getPatterns)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns security attributes and required channel for the supplied request. | | Details ------- ### add([RequestMatcherInterface](../../httpfoundation/requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") $requestMatcher, array $attributes = array(), string|null $channel = null) #### Parameters | | | | | --- | --- | --- | | [RequestMatcherInterface](../../httpfoundation/requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") | $requestMatcher | A RequestMatcherInterface instance | | array | $attributes | An array of attributes to pass to the access decision manager (like roles) | | string|null | $channel | The channel to enforce (http, https, or null) | ### array getPatterns([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns security attributes and required channel for the supplied request. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | A tuple of security attributes and the required channel | symfony Firewall Firewall ========= class **Firewall** implements [EventSubscriberInterface](../../eventdispatcher/eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") Firewall uses a FirewallMap to register security listeners for the given request. It allows for different security strategies within the same application (a Basic authentication for the /api, and a web based authentication for everything else for instance). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([FirewallMapInterface](firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") $map, [EventDispatcherInterface](../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) | | | | [onKernelRequest](#method_onKernelRequest)([GetResponseEvent](../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) | | | | [onKernelFinishRequest](#method_onKernelFinishRequest)([FinishRequestEvent](../../httpkernel/event/finishrequestevent "Symfony\Component\HttpKernel\Event\FinishRequestEvent") $event) | | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | | | [handleRequest](#method_handleRequest)([GetResponseEvent](../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event, $listeners) | | Details ------- ### \_\_construct([FirewallMapInterface](firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") $map, [EventDispatcherInterface](../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) #### Parameters | | | | | --- | --- | --- | | [FirewallMapInterface](firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") | $map | | | [EventDispatcherInterface](../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### onKernelRequest([GetResponseEvent](../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### onKernelFinishRequest([FinishRequestEvent](../../httpkernel/event/finishrequestevent "Symfony\Component\HttpKernel\Event\FinishRequestEvent") $event) #### Parameters | | | | | --- | --- | --- | | [FinishRequestEvent](../../httpkernel/event/finishrequestevent "Symfony\Component\HttpKernel\Event\FinishRequestEvent") | $event | | ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | ### protected handleRequest([GetResponseEvent](../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event, $listeners) #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | | | $listeners | | symfony Symfony\Component\Security\Http\Session Symfony\Component\Security\Http\Session ======================================= Classes ------- | | | | --- | --- | | [SessionAuthenticationStrategy](session/sessionauthenticationstrategy "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy") | The default session strategy implementation. | Interfaces ---------- | | | | --- | --- | | *[SessionAuthenticationStrategyInterface](session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface")* | SessionAuthenticationStrategyInterface. | symfony Symfony\Component\Security\Http\Logout Symfony\Component\Security\Http\Logout ====================================== Classes ------- | | | | --- | --- | | [CookieClearingLogoutHandler](logout/cookieclearinglogouthandler "Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler") | This handler clears the passed cookies when a user logs out. | | [CsrfTokenClearingLogoutHandler](logout/csrftokenclearinglogouthandler "Symfony\Component\Security\Http\Logout\CsrfTokenClearingLogoutHandler") | | | [DefaultLogoutSuccessHandler](logout/defaultlogoutsuccesshandler "Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler") | Default logout success handler will redirect users to a configured path. | | [LogoutUrlGenerator](logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") | Provides generator functions for the logout URL. | | [SessionLogoutHandler](logout/sessionlogouthandler "Symfony\Component\Security\Http\Logout\SessionLogoutHandler") | Handler for clearing invalidating the current session. | Interfaces ---------- | | | | --- | --- | | *[LogoutHandlerInterface](logout/logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface")* | Interface that needs to be implemented by LogoutHandlers. | | *[LogoutSuccessHandlerInterface](logout/logoutsuccesshandlerinterface "Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface")* | LogoutSuccesshandlerInterface. | symfony AccessMapInterface AccessMapInterface =================== interface **AccessMapInterface** AccessMap allows configuration of different access control rules for specific parts of the website. Methods ------- | | | | | --- | --- | --- | | array | [getPatterns](#method_getPatterns)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns security attributes and required channel for the supplied request. | | Details ------- ### array getPatterns([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns security attributes and required channel for the supplied request. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | A tuple of security attributes and the required channel | symfony Symfony\Component\Security\Http\EntryPoint Symfony\Component\Security\Http\EntryPoint ========================================== Classes ------- | | | | --- | --- | | [BasicAuthenticationEntryPoint](entrypoint/basicauthenticationentrypoint "Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint") | BasicAuthenticationEntryPoint starts an HTTP Basic authentication. | | [FormAuthenticationEntryPoint](entrypoint/formauthenticationentrypoint "Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint") | FormAuthenticationEntryPoint starts an authentication via a login form. | | [RetryAuthenticationEntryPoint](entrypoint/retryauthenticationentrypoint "Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint") | RetryAuthenticationEntryPoint redirects URL based on the configured scheme. | Interfaces ---------- | | | | --- | --- | | *[AuthenticationEntryPointInterface](entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface")* | Implement this interface for any classes that will be called to "start" the authentication process (see method for more details). | symfony HttpUtils HttpUtils ========== class **HttpUtils** Encapsulates the logic needed to create sub-requests, redirect the user, and match URLs. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UrlGeneratorInterface](../../routing/generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") $urlGenerator = null, [UrlMatcherInterface](../../routing/matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface")|[RequestMatcherInterface](../../routing/matcher/requestmatcherinterface "Symfony\Component\Routing\Matcher\RequestMatcherInterface") $urlMatcher = null, string|null $domainRegexp = null) | | | [RedirectResponse](../../httpfoundation/redirectresponse "Symfony\Component\HttpFoundation\RedirectResponse") | [createRedirectResponse](#method_createRedirectResponse)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path, int $status = 302) Creates a redirect Response. | | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | [createRequest](#method_createRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Creates a Request. | | | bool | [checkRequestPath](#method_checkRequestPath)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Checks that a given path matches the Request. | | | string | [generateUri](#method_generateUri)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Generates a URI, based on the given path or absolute URL. | | Details ------- ### \_\_construct([UrlGeneratorInterface](../../routing/generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") $urlGenerator = null, [UrlMatcherInterface](../../routing/matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface")|[RequestMatcherInterface](../../routing/matcher/requestmatcherinterface "Symfony\Component\Routing\Matcher\RequestMatcherInterface") $urlMatcher = null, string|null $domainRegexp = null) #### Parameters | | | | | --- | --- | --- | | [UrlGeneratorInterface](../../routing/generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") | $urlGenerator | A UrlGeneratorInterface instance | | [UrlMatcherInterface](../../routing/matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface")|[RequestMatcherInterface](../../routing/matcher/requestmatcherinterface "Symfony\Component\Routing\Matcher\RequestMatcherInterface") | $urlMatcher | The URL or Request matcher | | string|null | $domainRegexp | A regexp that the target of HTTP redirections must match, scheme included | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [RedirectResponse](../../httpfoundation/redirectresponse "Symfony\Component\HttpFoundation\RedirectResponse") createRedirectResponse([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path, int $status = 302) Creates a redirect Response. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | A Request instance | | string | $path | A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo)) | | int | $status | The status code | #### Return Value | | | | --- | --- | | [RedirectResponse](../../httpfoundation/redirectresponse "Symfony\Component\HttpFoundation\RedirectResponse") | A RedirectResponse instance | ### [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") createRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Creates a Request. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The current Request instance | | string | $path | A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo)) | #### Return Value | | | | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | A Request instance | ### bool checkRequestPath([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Checks that a given path matches the Request. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | A Request instance | | string | $path | A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo)) | #### Return Value | | | | --- | --- | | bool | true if the path is the same as the one from the Request, false otherwise | ### string generateUri([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, string $path) Generates a URI, based on the given path or absolute URL. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | A Request instance | | string | $path | A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo)) | #### Return Value | | | | --- | --- | | string | An absolute URL | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | symfony TargetPathTrait TargetPathTrait ================ trait **TargetPathTrait** Trait to get (and set) the URL the user last visited before being forced to authenticate. symfony LogoutHandlerInterface LogoutHandlerInterface ======================= interface **LogoutHandlerInterface** Interface that needs to be implemented by LogoutHandlers. Methods ------- | | | | | --- | --- | --- | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This method is called by the LogoutListener when a user has requested to be logged out. Usually, you would unset session variables, or remove cookies, etc. | | Details ------- ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This method is called by the LogoutListener when a user has requested to be logged out. Usually, you would unset session variables, or remove cookies, etc. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony DefaultLogoutSuccessHandler DefaultLogoutSuccessHandler ============================ class **DefaultLogoutSuccessHandler** implements [LogoutSuccessHandlerInterface](logoutsuccesshandlerinterface "Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface") Default logout success handler will redirect users to a configured path. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $httpUtils | | | | protected | $targetUrl | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $targetUrl = '/') | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onLogoutSuccess](#method_onLogoutSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Creates a Response object to send upon a successful logout. | | Details ------- ### \_\_construct([HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $targetUrl = '/') #### Parameters | | | | | --- | --- | --- | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | string | $targetUrl | | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onLogoutSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Creates a Response object to send upon a successful logout. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | never null | symfony LogoutUrlGenerator LogoutUrlGenerator =================== class **LogoutUrlGenerator** Provides generator functions for the logout URL. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack = null, [UrlGeneratorInterface](../../../routing/generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") $router = null, [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage = null) | | | | [registerListener](#method_registerListener)(string $key, string $logoutPath, string $csrfTokenId, string $csrfParameter, [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null, string $context = null) Registers a firewall's LogoutListener, allowing its URL to be generated. | | | string | [getLogoutPath](#method_getLogoutPath)(string|null $key = null) Generates the absolute logout path for the firewall. | | | string | [getLogoutUrl](#method_getLogoutUrl)(string|null $key = null) Generates the absolute logout URL for the firewall. | | | | [setCurrentFirewall](#method_setCurrentFirewall)(string|null $key, string|null $context = null) | | Details ------- ### \_\_construct([RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack = null, [UrlGeneratorInterface](../../../routing/generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") $router = null, [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage = null) #### Parameters | | | | | --- | --- | --- | | [RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") | $requestStack | | | [UrlGeneratorInterface](../../../routing/generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") | $router | | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | ### registerListener(string $key, string $logoutPath, string $csrfTokenId, string $csrfParameter, [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null, string $context = null) Registers a firewall's LogoutListener, allowing its URL to be generated. #### Parameters | | | | | --- | --- | --- | | string | $key | The firewall key | | string | $logoutPath | The path that starts the logout process | | string | $csrfTokenId | The ID of the CSRF token | | string | $csrfParameter | The CSRF token parameter name | | [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") | $csrfTokenManager | A CsrfTokenManagerInterface instance | | string | $context | The listener context | ### string getLogoutPath(string|null $key = null) Generates the absolute logout path for the firewall. #### Parameters | | | | | --- | --- | --- | | string|null | $key | The firewall key or null to use the current firewall key | #### Return Value | | | | --- | --- | | string | The logout path | ### string getLogoutUrl(string|null $key = null) Generates the absolute logout URL for the firewall. #### Parameters | | | | | --- | --- | --- | | string|null | $key | The firewall key or null to use the current firewall key | #### Return Value | | | | --- | --- | | string | The logout URL | ### setCurrentFirewall(string|null $key, string|null $context = null) #### Parameters | | | | | --- | --- | --- | | string|null | $key | The current firewall key | | string|null | $context | The current firewall context |
programming_docs
symfony SessionLogoutHandler SessionLogoutHandler ===================== class **SessionLogoutHandler** implements [LogoutHandlerInterface](logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") Handler for clearing invalidating the current session. Methods ------- | | | | | --- | --- | --- | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Invalidate the current session. | | Details ------- ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Invalidate the current session. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony LogoutSuccessHandlerInterface LogoutSuccessHandlerInterface ============================== interface **LogoutSuccessHandlerInterface** LogoutSuccesshandlerInterface. In contrast to the LogoutHandlerInterface, this interface can return a response which is then used instead of the default behavior. If you want to only perform some logout related clean-up task, use the LogoutHandlerInterface instead. Methods ------- | | | | | --- | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onLogoutSuccess](#method_onLogoutSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Creates a Response object to send upon a successful logout. | | Details ------- ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onLogoutSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Creates a Response object to send upon a successful logout. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | never null | symfony CookieClearingLogoutHandler CookieClearingLogoutHandler ============================ class **CookieClearingLogoutHandler** implements [LogoutHandlerInterface](logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") This handler clears the passed cookies when a user logs out. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $cookies) | | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for the LogoutHandlerInterface. Deletes all requested cookies. | | Details ------- ### \_\_construct(array $cookies) #### Parameters | | | | | --- | --- | --- | | array | $cookies | An array of cookie names to unset | ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for the LogoutHandlerInterface. Deletes all requested cookies. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony CsrfTokenClearingLogoutHandler CsrfTokenClearingLogoutHandler =============================== class **CsrfTokenClearingLogoutHandler** implements [LogoutHandlerInterface](logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ClearableTokenStorageInterface](../../csrf/tokenstorage/clearabletokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface") $csrfTokenStorage) | | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This method is called by the LogoutListener when a user has requested to be logged out. Usually, you would unset session variables, or remove cookies, etc. | | Details ------- ### \_\_construct([ClearableTokenStorageInterface](../../csrf/tokenstorage/clearabletokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface") $csrfTokenStorage) #### Parameters | | | | | --- | --- | --- | | [ClearableTokenStorageInterface](../../csrf/tokenstorage/clearabletokenstorageinterface "Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface") | $csrfTokenStorage | | ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This method is called by the LogoutListener when a user has requested to be logged out. Usually, you would unset session variables, or remove cookies, etc. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony X509AuthenticationListener X509AuthenticationListener =========================== class **X509AuthenticationListener** extends [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") X509 authentication listener. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | from [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener#property_logger "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, string $userKey = 'SSL\_CLIENT\_S\_DN\_Email', string $credentialKey = 'SSL\_CLIENT\_S\_DN', LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles pre-authentication. | from [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener#method_handle "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | from [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener#method_setSessionAuthenticationStrategy "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") | | array | [getPreAuthenticatedData](#method_getPreAuthenticatedData)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Gets the user and credentials from the Request. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, string $userKey = 'SSL\_CLIENT\_S\_DN\_Email', string $credentialKey = 'SSL\_CLIENT\_S\_DN', LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | string | $providerKey | | | string | $userKey | | | string | $credentialKey | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### final handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles pre-authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | ### protected array getPreAuthenticatedData([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Gets the user and credentials from the Request. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array composed of the user and the credentials | symfony SimplePreAuthenticationListener SimplePreAuthenticationListener ================================ class **SimplePreAuthenticationListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") SimplePreAuthenticationListener implements simple proxying to an authenticator. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, [SimplePreAuthenticatorInterface](../authentication/simplepreauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface") $simpleAuthenticator, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) | | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles basic authentication. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, [SimplePreAuthenticatorInterface](../authentication/simplepreauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface") $simpleAuthenticator, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | string | $providerKey | | | [SimplePreAuthenticatorInterface](../authentication/simplepreauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface") | $simpleAuthenticator | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles basic authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | symfony AbstractAuthenticationListener AbstractAuthenticationListener =============================== abstract class **AbstractAuthenticationListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") The AbstractAuthenticationListener is the preferred base class for all browser-/HTTP-based authentication requests. Subclasses likely have to implement the following: - an TokenInterface to hold authentication related data - an AuthenticationProvider to perform the actual authentication of the token, retrieve the UserInterface implementation from a database, and perform the specific account checks using the UserChecker By default, this listener only is active for a specific path, e.g. /login\_check. If you want to change this behavior, you can overwrite the requiresAuthentication() method. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | | | protected | $logger | | | | protected | $authenticationManager | | | | protected | $providerKey | | | | protected | $httpUtils | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) | | | | [setRememberMeServices](#method_setRememberMeServices)([RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Sets the RememberMeServices implementation to use. | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles form based authentication. | | | bool | [requiresAuthentication](#method_requiresAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request requires authentication. | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | [attemptAuthentication](#method_attemptAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Performs authentication. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | string | $providerKey | | | [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") | $successHandler | | | [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") | $failureHandler | | | array | $options | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### setRememberMeServices([RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Sets the RememberMeServices implementation to use. #### Parameters | | | | | --- | --- | --- | | [RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") | $rememberMeServices | | ### final handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles form based authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | | [SessionUnavailableException](../../core/exception/sessionunavailableexception "Symfony\Component\Security\Core\Exception\SessionUnavailableException") | | ### protected bool requiresAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request requires authentication. The default implementation only processes requests to a specific path, but a subclass could change this to only authenticate requests where a certain parameters is present. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | ### abstract protected [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null attemptAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Performs authentication. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | The authenticated token, null if full authentication is not possible, or a Response | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails |
programming_docs
symfony LogoutListener LogoutListener =============== class **LogoutListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") LogoutListener logout users. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, [LogoutSuccessHandlerInterface](../logout/logoutsuccesshandlerinterface "Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface") $successHandler, array $options = array(), [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null) | | | | [addHandler](#method_addHandler)([LogoutHandlerInterface](../logout/logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") $handler) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Performs the logout if requested. | | | bool | [requiresLogout](#method_requiresLogout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request is asking for logout. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, [LogoutSuccessHandlerInterface](../logout/logoutsuccesshandlerinterface "Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface") $successHandler, array $options = array(), [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | An HttpUtils instance | | [LogoutSuccessHandlerInterface](../logout/logoutsuccesshandlerinterface "Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface") | $successHandler | A LogoutSuccessHandlerInterface instance | | array | $options | An array of options to process a logout attempt | | [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") | $csrfTokenManager | A CsrfTokenManagerInterface instance | ### addHandler([LogoutHandlerInterface](../logout/logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") $handler) #### Parameters | | | | | --- | --- | --- | | [LogoutHandlerInterface](../logout/logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") | $handler | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Performs the logout if requested. If a CsrfTokenManagerInterface instance is available, it will be used to validate the request. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | #### Exceptions | | | | --- | --- | | [LogoutException](../../core/exception/logoutexception "Symfony\Component\Security\Core\Exception\LogoutException") | if the CSRF token is invalid | | [RuntimeException](http://php.net/RuntimeException) | if the LogoutSuccessHandlerInterface instance does not return a response | ### protected bool requiresLogout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request is asking for logout. The default implementation only processed requests to a specific path, but a subclass could change this to logout requests where certain parameters is present. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | symfony AccessListener AccessListener =============== class **AccessListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") AccessListener enforces access control rules. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AccessDecisionManagerInterface](../../core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager, [AccessMapInterface](../accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") $map, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authManager) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles access authorization. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AccessDecisionManagerInterface](../../core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager, [AccessMapInterface](../accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") $map, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authManager) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AccessDecisionManagerInterface](../../core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") | $accessDecisionManager | | | [AccessMapInterface](../accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") | $map | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authManager | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles access authorization. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | #### Exceptions | | | | --- | --- | | [AccessDeniedException](../../core/exception/accessdeniedexception "Symfony\Component\Security\Core\Exception\AccessDeniedException") | | | [AuthenticationCredentialsNotFoundException](../../core/exception/authenticationcredentialsnotfoundexception "Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException") | | symfony ChannelListener ChannelListener ================ class **ChannelListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") ChannelListener switches the HTTP protocol based on the access control configuration. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([AccessMapInterface](../accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") $map, [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") $authenticationEntryPoint, LoggerInterface $logger = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles channel management. | | Details ------- ### \_\_construct([AccessMapInterface](../accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") $map, [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") $authenticationEntryPoint, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [AccessMapInterface](../accessmapinterface "Symfony\Component\Security\Http\AccessMapInterface") | $map | | | [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") | $authenticationEntryPoint | | | LoggerInterface | $logger | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles channel management. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | symfony BasicAuthenticationListener BasicAuthenticationListener ============================ class **BasicAuthenticationListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") BasicAuthenticationListener implements Basic HTTP authentication. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") $authenticationEntryPoint, LoggerInterface $logger = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles basic authentication. | | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") $authenticationEntryPoint, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | string | $providerKey | | | [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") | $authenticationEntryPoint | | | LoggerInterface | $logger | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles basic authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | symfony ListenerInterface ListenerInterface ================== interface **ListenerInterface** Interface that must be implemented by firewall listeners. Methods ------- | | | | | --- | --- | --- | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) | | Details ------- ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | symfony AbstractPreAuthenticatedListener AbstractPreAuthenticatedListener ================================= abstract class **AbstractPreAuthenticatedListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") AbstractPreAuthenticatedListener is the base class for all listener that authenticates users based on a pre-authenticated request (like a certificate for instance). Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles pre-authentication. | | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | | | array | [getPreAuthenticatedData](#method_getPreAuthenticatedData)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Gets the user and credentials from the Request. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | string | $providerKey | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### final handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles pre-authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | ### abstract protected array getPreAuthenticatedData([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Gets the user and credentials from the Request. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array composed of the user and the credentials | symfony SwitchUserListener SwitchUserListener =================== class **SwitchUserListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") SwitchUserListener allows a user to impersonate another one temporarily (like the Unix su command). Constants --------- | | | | --- | --- | | EXIT\_VALUE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $provider, [UserCheckerInterface](../../core/user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, [AccessDecisionManagerInterface](../../core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '\_switch\_user', string $role = 'ROLE\_ALLOWED\_TO\_SWITCH', [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, bool $stateless = false) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles the switch to another user. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $provider, [UserCheckerInterface](../../core/user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker, string $providerKey, [AccessDecisionManagerInterface](../../core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '\_switch\_user', string $role = 'ROLE\_ALLOWED\_TO\_SWITCH', [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, bool $stateless = false) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $provider | | | [UserCheckerInterface](../../core/user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | | string | $providerKey | | | [AccessDecisionManagerInterface](../../core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") | $accessDecisionManager | | | LoggerInterface | $logger | | | string | $usernameParameter | | | string | $role | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | bool | $stateless | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles the switch to another user. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if switching to a user failed |
programming_docs
symfony RememberMeListener RememberMeListener =================== class **RememberMeListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") RememberMeListener implements authentication capabilities via a cookie. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, bool $catchExceptions = true, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles remember-me cookie based authentication. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, bool $catchExceptions = true, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") | $rememberMeServices | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | bool | $catchExceptions | | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles remember-me cookie based authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | symfony ExceptionListener ExceptionListener ================== class **ExceptionListener** ExceptionListener catches authentication exception and converts them to Response instances. Traits ------ | | | | --- | --- | | [TargetPathTrait](../util/targetpathtrait "Symfony\Component\Security\Http\Util\TargetPathTrait") | Trait to get (and set) the URL the user last visited before being forced to authenticate. | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationTrustResolverInterface](../../core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") $authenticationEntryPoint = null, string $errorPage = null, [AccessDeniedHandlerInterface](../authorization/accessdeniedhandlerinterface "Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface") $accessDeniedHandler = null, LoggerInterface $logger = null, bool $stateless = false) | | | | [register](#method_register)([EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) Registers a onKernelException listener to take care of security exceptions. | | | | [unregister](#method_unregister)([EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) Unregisters the dispatcher. | | | | [onKernelException](#method_onKernelException)([GetResponseForExceptionEvent](../../../httpkernel/event/getresponseforexceptionevent "Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent") $event) Handles security related exceptions. | | | | [setTargetPath](#method_setTargetPath)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationTrustResolverInterface](../../core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") $authenticationEntryPoint = null, string $errorPage = null, [AccessDeniedHandlerInterface](../authorization/accessdeniedhandlerinterface "Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface") $accessDeniedHandler = null, LoggerInterface $logger = null, bool $stateless = false) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationTrustResolverInterface](../../core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") | $trustResolver | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | string | $providerKey | | | [AuthenticationEntryPointInterface](../entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") | $authenticationEntryPoint | | | string | $errorPage | | | [AccessDeniedHandlerInterface](../authorization/accessdeniedhandlerinterface "Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface") | $accessDeniedHandler | | | LoggerInterface | $logger | | | bool | $stateless | | ### register([EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) Registers a onKernelException listener to take care of security exceptions. #### Parameters | | | | | --- | --- | --- | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### unregister([EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) Unregisters the dispatcher. #### Parameters | | | | | --- | --- | --- | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### onKernelException([GetResponseForExceptionEvent](../../../httpkernel/event/getresponseforexceptionevent "Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent") $event) Handles security related exceptions. #### Parameters | | | | | --- | --- | --- | | [GetResponseForExceptionEvent](../../../httpkernel/event/getresponseforexceptionevent "Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent") | $event | | ### protected setTargetPath([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | symfony UsernamePasswordJsonAuthenticationListener UsernamePasswordJsonAuthenticationListener =========================================== class **UsernamePasswordJsonAuthenticationListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") UsernamePasswordJsonAuthenticationListener is a stateless implementation of an authentication via a JSON document composed of a username and a password. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler = null, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler = null, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $eventDispatcher = null, [PropertyAccessorInterface](../../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") $propertyAccessor = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) | | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler = null, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler = null, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $eventDispatcher = null, [PropertyAccessorInterface](../../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") $propertyAccessor = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | string | $providerKey | | | [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") | $successHandler | | | [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") | $failureHandler | | | array | $options | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $eventDispatcher | | | [PropertyAccessorInterface](../../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") | $propertyAccessor | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | symfony ContextListener ContextListener ================ class **ContextListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") ContextListener manages the SecurityContext persistence through a session. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, [AuthenticationTrustResolverInterface](../../core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver = null) | | | | [setLogoutOnUserChange](#method_setLogoutOnUserChange)(bool $logoutOnUserChange) deprecated Enables deauthentication during refreshUser when the user has changed. | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Reads the Security Token from the session. | | | | [onKernelResponse](#method_onKernelResponse)([FilterResponseEvent](../../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") $event) Writes the security token into the session. | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | [refreshUser](#method_refreshUser)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Refreshes the user by reloading it from the user provider. | | | static | [handleUnserializeCallback](#method_handleUnserializeCallback)($class) | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, [AuthenticationTrustResolverInterface](../../core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | iterable | $userProviders | | | string | $contextKey | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | [AuthenticationTrustResolverInterface](../../core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") | $trustResolver | | ### setLogoutOnUserChange(bool $logoutOnUserChange) deprecated deprecated | since | Symfony 4.1 | Enables deauthentication during refreshUser when the user has changed. #### Parameters | | | | | --- | --- | --- | | bool | $logoutOnUserChange | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Reads the Security Token from the session. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### onKernelResponse([FilterResponseEvent](../../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") $event) Writes the security token into the session. #### Parameters | | | | | --- | --- | --- | | [FilterResponseEvent](../../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") | $event | | ### protected [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null refreshUser([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Refreshes the user by reloading it from the user provider. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### static handleUnserializeCallback($class) #### Parameters | | | | | --- | --- | --- | | | $class | |
programming_docs
symfony UsernamePasswordFormAuthenticationListener UsernamePasswordFormAuthenticationListener =========================================== class **UsernamePasswordFormAuthenticationListener** extends [AbstractAuthenticationListener](abstractauthenticationlistener "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") UsernamePasswordFormAuthenticationListener is the default implementation of an authentication via a simple form composed of a username and a password. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_options "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $logger | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_logger "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $authenticationManager | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_authenticationManager "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $providerKey | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_providerKey "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $httpUtils | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_httpUtils "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null) | | | | [setRememberMeServices](#method_setRememberMeServices)([RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Sets the RememberMeServices implementation to use. | from [AbstractAuthenticationListener](abstractauthenticationlistener#method_setRememberMeServices "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles form based authentication. | from [AbstractAuthenticationListener](abstractauthenticationlistener#method_handle "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | bool | [requiresAuthentication](#method_requiresAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request requires authentication. | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | [attemptAuthentication](#method_attemptAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Performs authentication. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | string | $providerKey | | | [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") | $successHandler | | | [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") | $failureHandler | | | array | $options | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") | $csrfTokenManager | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### setRememberMeServices([RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Sets the RememberMeServices implementation to use. #### Parameters | | | | | --- | --- | --- | | [RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") | $rememberMeServices | | ### final handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles form based authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | | [SessionUnavailableException](../../core/exception/sessionunavailableexception "Symfony\Component\Security\Core\Exception\SessionUnavailableException") | | ### protected bool requiresAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request requires authentication. The default implementation only processes requests to a specific path, but a subclass could change this to only authenticate requests where a certain parameters is present. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | ### protected [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null attemptAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Performs authentication. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | The authenticated token, null if full authentication is not possible, or a Response | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails | symfony AnonymousAuthenticationListener AnonymousAuthenticationListener ================================ class **AnonymousAuthenticationListener** implements [ListenerInterface](listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") AnonymousAuthenticationListener automatically adds a Token if none is already present. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, string $secret, LoggerInterface $logger = null, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles anonymous authentication. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, string $secret, LoggerInterface $logger = null, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | string | $secret | | | LoggerInterface | $logger | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles anonymous authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | symfony SimpleFormAuthenticationListener SimpleFormAuthenticationListener ================================= class **SimpleFormAuthenticationListener** extends [AbstractAuthenticationListener](abstractauthenticationlistener "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_options "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $logger | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_logger "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $authenticationManager | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_authenticationManager "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $providerKey | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_providerKey "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | protected | $httpUtils | | from [AbstractAuthenticationListener](abstractauthenticationlistener#property_httpUtils "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null, [SimpleFormAuthenticatorInterface](../authentication/simpleformauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface") $simpleAuthenticator = null) | | | | [setRememberMeServices](#method_setRememberMeServices)([RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Sets the RememberMeServices implementation to use. | from [AbstractAuthenticationListener](abstractauthenticationlistener#method_setRememberMeServices "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles form based authentication. | from [AbstractAuthenticationListener](abstractauthenticationlistener#method_handle "Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener") | | bool | [requiresAuthentication](#method_requiresAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request requires authentication. | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | [attemptAuthentication](#method_attemptAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Performs authentication. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $providerKey, [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, array $options = array(), LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") $csrfTokenManager = null, [SimpleFormAuthenticatorInterface](../authentication/simpleformauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface") $simpleAuthenticator = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | string | $providerKey | | | [AuthenticationSuccessHandlerInterface](../authentication/authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") | $successHandler | | | [AuthenticationFailureHandlerInterface](../authentication/authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") | $failureHandler | | | array | $options | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | [CsrfTokenManagerInterface](../../csrf/csrftokenmanagerinterface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface") | $csrfTokenManager | | | [SimpleFormAuthenticatorInterface](../authentication/simpleformauthenticatorinterface "Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface") | $simpleAuthenticator | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | In case no simple authenticator is provided | ### setRememberMeServices([RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Sets the RememberMeServices implementation to use. #### Parameters | | | | | --- | --- | --- | | [RememberMeServicesInterface](../rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") | $rememberMeServices | | ### final handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles form based authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | | [SessionUnavailableException](../../core/exception/sessionunavailableexception "Symfony\Component\Security\Core\Exception\SessionUnavailableException") | | ### protected bool requiresAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Whether this request requires authentication. The default implementation only processes requests to a specific path, but a subclass could change this to only authenticate requests where a certain parameters is present. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | ### protected [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null attemptAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Performs authentication. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|[Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | The authenticated token, null if full authentication is not possible, or a Response | #### Exceptions | | | | --- | --- | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | if the authentication fails |
programming_docs
symfony RemoteUserAuthenticationListener RemoteUserAuthenticationListener ================================= class **RemoteUserAuthenticationListener** extends [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") REMOTE\_USER authentication listener. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | from [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener#property_logger "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, string $userKey = 'REMOTE\_USER', LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles pre-authentication. | from [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener#method_handle "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | from [AbstractPreAuthenticatedListener](abstractpreauthenticatedlistener#method_setSessionAuthenticationStrategy "Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener") | | array | [getPreAuthenticatedData](#method_getPreAuthenticatedData)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Gets the user and credentials from the Request. | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, string $userKey = 'REMOTE\_USER', LoggerInterface $logger = null, [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | | | string | $providerKey | | | string | $userKey | | | LoggerInterface | $logger | | | [EventDispatcherInterface](../../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### final handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Handles pre-authentication. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | | ### protected array getPreAuthenticatedData([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Gets the user and credentials from the Request. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array composed of the user and the credentials | symfony UserValueResolver UserValueResolver ================== class **UserValueResolver** implements [ArgumentValueResolverInterface](../../../httpkernel/controller/argumentvalueresolverinterface "Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface") Supports the argument type of {see UserInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage) | | | bool | [supports](#method_supports)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../../httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Whether this resolver can resolve the value for the given ArgumentMetadata. | | | [Generator](http://php.net/Generator) | [resolve](#method_resolve)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../../httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Returns the possible value(s). | | Details ------- ### \_\_construct([TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | ### bool supports([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../../httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Whether this resolver can resolve the value for the given ArgumentMetadata. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [ArgumentMetadata](../../../httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") | $argument | | #### Return Value | | | | --- | --- | | bool | | ### [Generator](http://php.net/Generator) resolve([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../../httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Returns the possible value(s). #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [ArgumentMetadata](../../../httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") | $argument | | #### Return Value | | | | --- | --- | | [Generator](http://php.net/Generator) | | symfony AbstractRememberMeServices AbstractRememberMeServices =========================== abstract class **AbstractRememberMeServices** implements [RememberMeServicesInterface](remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface"), [LogoutHandlerInterface](../logout/logouthandlerinterface "Symfony\Component\Security\Http\Logout\LogoutHandlerInterface") Base class implementing the RememberMeServicesInterface. Constants --------- | | | | --- | --- | | COOKIE\_DELIMITER | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | | | protected | $options | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null) | | | string | [getRememberMeParameter](#method_getRememberMeParameter)() Returns the parameter that is used for checking whether remember-me services have been requested. | | | string | [getSecret](#method_getSecret)() | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [autoLogin](#method_autoLogin)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing. | | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for LogoutHandlerInterface. Deletes the cookie. | | | | [loginFail](#method_loginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails. | | | | [loginSuccess](#method_loginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for RememberMeServicesInterface. This is called when an authentication is successful. | | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [processAutoLoginCookie](#method_processAutoLoginCookie)(array $cookieParts, [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin(). | | | | [onLoginFail](#method_onLoginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) | | | | [onLoginSuccess](#method_onLoginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it. | | | | [getUserProvider](#method_getUserProvider)($class) | | | array | [decodeCookie](#method_decodeCookie)(string $rawCookie) Decodes the raw cookie value. | | | string | [encodeCookie](#method_encodeCookie)(array $cookieParts) Encodes the cookie parts. | | | | [cancelCookie](#method_cancelCookie)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Deletes the remember-me cookie. | | | bool | [isRememberMeRequested](#method_isRememberMeRequested)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Checks whether remember-me capabilities were requested. | | Details ------- ### \_\_construct(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | array | $userProviders | | | string | $secret | | | string | $providerKey | | | array | $options | | | LoggerInterface | $logger | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getRememberMeParameter() Returns the parameter that is used for checking whether remember-me services have been requested. #### Return Value | | | | --- | --- | | string | | ### string getSecret() #### Return Value | | | | --- | --- | | string | | ### final [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") autoLogin([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | #### Exceptions | | | | --- | --- | | [CookieTheftException](../../core/exception/cookietheftexception "Symfony\Component\Security\Core\Exception\CookieTheftException") | | | [RuntimeException](http://php.net/RuntimeException) | | ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for LogoutHandlerInterface. Deletes the cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### final loginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### final loginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for RememberMeServicesInterface. This is called when an authentication is successful. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### abstract protected [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") processAutoLoginCookie(array $cookieParts, [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin(). #### Parameters | | | | | --- | --- | --- | | array | $cookieParts | | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### protected onLoginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### abstract protected onLoginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### final protected getUserProvider($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### protected array decodeCookie(string $rawCookie) Decodes the raw cookie value. #### Parameters | | | | | --- | --- | --- | | string | $rawCookie | | #### Return Value | | | | --- | --- | | array | | ### protected string encodeCookie(array $cookieParts) Encodes the cookie parts. #### Parameters | | | | | --- | --- | --- | | array | $cookieParts | | #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When $cookieParts contain the cookie delimiter. Extending class should either remove or escape it. | ### protected cancelCookie([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Deletes the remember-me cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | ### protected bool isRememberMeRequested([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Checks whether remember-me capabilities were requested. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony ResponseListener ResponseListener ================= class **ResponseListener** implements [EventSubscriberInterface](../../../eventdispatcher/eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") Adds remember-me cookies to the Response. Methods ------- | | | | | --- | --- | --- | | | [onKernelResponse](#method_onKernelResponse)([FilterResponseEvent](../../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") $event) | | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | Details ------- ### onKernelResponse([FilterResponseEvent](../../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") $event) #### Parameters | | | | | --- | --- | --- | | [FilterResponseEvent](../../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") | $event | | ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | symfony RememberMeServicesInterface RememberMeServicesInterface ============================ interface **RememberMeServicesInterface** Interface that needs to be implemented by classes which provide remember-me capabilities. We provide two implementations out-of-the-box: - TokenBasedRememberMeServices (does not require a TokenProvider) - PersistentTokenBasedRememberMeServices (requires a TokenProvider) Constants --------- | | | | --- | --- | | COOKIE\_ATTR\_NAME | *This attribute name can be used by the implementation if it needs to set a cookie on the Request when there is no actual Response, yet.* | Methods ------- | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [autoLogin](#method_autoLogin)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) This method will be called whenever the TokenStorage does not contain a TokenInterface object and the framework wishes to provide an implementation with an opportunity to authenticate the request using remember-me capabilities. | | | | [loginFail](#method_loginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Called whenever an interactive authentication attempt was made, but the credentials supplied by the user were missing or otherwise invalid. | | | | [loginSuccess](#method_loginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Called whenever an interactive authentication attempt is successful (e.g. a form login). | | Details ------- ### [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") autoLogin([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) This method will be called whenever the TokenStorage does not contain a TokenInterface object and the framework wishes to provide an implementation with an opportunity to authenticate the request using remember-me capabilities. No attempt whatsoever is made to determine whether the browser has requested remember-me services or presented a valid cookie. Any and all such determinations are left to the implementation of this method. If a browser has presented an unauthorised cookie for whatever reason, make sure to throw an AuthenticationException as this will consequentially result in a call to loginFail() and therefore an invalidation of the cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | ### loginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Called whenever an interactive authentication attempt was made, but the credentials supplied by the user were missing or otherwise invalid. This method needs to take care of invalidating the cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### loginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Called whenever an interactive authentication attempt is successful (e.g. a form login). An implementation may always set a remember-me cookie in the Response, although this is not recommended. Instead, implementations should typically look for a request parameter (such as a HTTP POST parameter) that indicates the browser has explicitly requested for the authentication to be remembered. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony TokenBasedRememberMeServices TokenBasedRememberMeServices ============================= class **TokenBasedRememberMeServices** extends [AbstractRememberMeServices](abstractremembermeservices "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") Concrete implementation of the RememberMeServicesInterface providing remember-me capabilities without requiring a TokenProvider. Constants --------- | | | | --- | --- | | COOKIE\_DELIMITER | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | from [AbstractRememberMeServices](abstractremembermeservices#property_logger "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | protected | $options | | from [AbstractRememberMeServices](abstractremembermeservices#property_options "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null) | from [AbstractRememberMeServices](abstractremembermeservices#method___construct "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [getRememberMeParameter](#method_getRememberMeParameter)() Returns the parameter that is used for checking whether remember-me services have been requested. | from [AbstractRememberMeServices](abstractremembermeservices#method_getRememberMeParameter "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [getSecret](#method_getSecret)() | from [AbstractRememberMeServices](abstractremembermeservices#method_getSecret "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [autoLogin](#method_autoLogin)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing. | from [AbstractRememberMeServices](abstractremembermeservices#method_autoLogin "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for LogoutHandlerInterface. Deletes the cookie. | from [AbstractRememberMeServices](abstractremembermeservices#method_logout "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [loginFail](#method_loginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails. | from [AbstractRememberMeServices](abstractremembermeservices#method_loginFail "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [loginSuccess](#method_loginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for RememberMeServicesInterface. This is called when an authentication is successful. | from [AbstractRememberMeServices](abstractremembermeservices#method_loginSuccess "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [processAutoLoginCookie](#method_processAutoLoginCookie)(array $cookieParts, [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin(). | | | | [onLoginFail](#method_onLoginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) | from [AbstractRememberMeServices](abstractremembermeservices#method_onLoginFail "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [onLoginSuccess](#method_onLoginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it. | | | | [getUserProvider](#method_getUserProvider)($class) | from [AbstractRememberMeServices](abstractremembermeservices#method_getUserProvider "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | array | [decodeCookie](#method_decodeCookie)(string $rawCookie) Decodes the raw cookie value. | from [AbstractRememberMeServices](abstractremembermeservices#method_decodeCookie "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [encodeCookie](#method_encodeCookie)(array $cookieParts) Encodes the cookie parts. | from [AbstractRememberMeServices](abstractremembermeservices#method_encodeCookie "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [cancelCookie](#method_cancelCookie)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Deletes the remember-me cookie. | from [AbstractRememberMeServices](abstractremembermeservices#method_cancelCookie "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | bool | [isRememberMeRequested](#method_isRememberMeRequested)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Checks whether remember-me capabilities were requested. | from [AbstractRememberMeServices](abstractremembermeservices#method_isRememberMeRequested "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [generateCookieValue](#method_generateCookieValue)(string $class, string $username, int $expires, string $password) Generates the cookie value. | | | string | [generateCookieHash](#method_generateCookieHash)(string $class, string $username, int $expires, string $password) Generates a hash for the cookie to ensure it is not being tempered with. | | Details ------- ### \_\_construct(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | array | $userProviders | | | string | $secret | | | string | $providerKey | | | array | $options | | | LoggerInterface | $logger | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getRememberMeParameter() Returns the parameter that is used for checking whether remember-me services have been requested. #### Return Value | | | | --- | --- | | string | | ### string getSecret() #### Return Value | | | | --- | --- | | string | | ### final [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") autoLogin([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | #### Exceptions | | | | --- | --- | | [CookieTheftException](../../core/exception/cookietheftexception "Symfony\Component\Security\Core\Exception\CookieTheftException") | | | [RuntimeException](http://php.net/RuntimeException) | | ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for LogoutHandlerInterface. Deletes the cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### final loginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### final loginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for RememberMeServicesInterface. This is called when an authentication is successful. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### protected [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") processAutoLoginCookie(array $cookieParts, [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin(). #### Parameters | | | | | --- | --- | --- | | array | $cookieParts | | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### protected onLoginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### protected onLoginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### final protected getUserProvider($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### protected array decodeCookie(string $rawCookie) Decodes the raw cookie value. #### Parameters | | | | | --- | --- | --- | | string | $rawCookie | | #### Return Value | | | | --- | --- | | array | | ### protected string encodeCookie(array $cookieParts) Encodes the cookie parts. #### Parameters | | | | | --- | --- | --- | | array | $cookieParts | | #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When $cookieParts contain the cookie delimiter. Extending class should either remove or escape it. | ### protected cancelCookie([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Deletes the remember-me cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | ### protected bool isRememberMeRequested([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Checks whether remember-me capabilities were requested. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | ### protected string generateCookieValue(string $class, string $username, int $expires, string $password) Generates the cookie value. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $username | The username | | int | $expires | The Unix timestamp when the cookie expires | | string | $password | The encoded password | #### Return Value | | | | --- | --- | | string | | ### protected string generateCookieHash(string $class, string $username, int $expires, string $password) Generates a hash for the cookie to ensure it is not being tempered with. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $username | The username | | int | $expires | The Unix timestamp when the cookie expires | | string | $password | The encoded password | #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony PersistentTokenBasedRememberMeServices PersistentTokenBasedRememberMeServices ======================================= class **PersistentTokenBasedRememberMeServices** extends [AbstractRememberMeServices](abstractremembermeservices "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") Concrete implementation of the RememberMeServicesInterface which needs an implementation of TokenProviderInterface for providing remember-me capabilities. Constants --------- | | | | --- | --- | | COOKIE\_DELIMITER | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | from [AbstractRememberMeServices](abstractremembermeservices#property_logger "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | protected | $options | | from [AbstractRememberMeServices](abstractremembermeservices#property_options "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null) | from [AbstractRememberMeServices](abstractremembermeservices#method___construct "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [getRememberMeParameter](#method_getRememberMeParameter)() Returns the parameter that is used for checking whether remember-me services have been requested. | from [AbstractRememberMeServices](abstractremembermeservices#method_getRememberMeParameter "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [getSecret](#method_getSecret)() | from [AbstractRememberMeServices](abstractremembermeservices#method_getSecret "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [autoLogin](#method_autoLogin)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing. | from [AbstractRememberMeServices](abstractremembermeservices#method_autoLogin "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [logout](#method_logout)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for LogoutHandlerInterface. Deletes the cookie. | from [AbstractRememberMeServices](abstractremembermeservices#method_logout "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [loginFail](#method_loginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails. | from [AbstractRememberMeServices](abstractremembermeservices#method_loginFail "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [loginSuccess](#method_loginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for RememberMeServicesInterface. This is called when an authentication is successful. | from [AbstractRememberMeServices](abstractremembermeservices#method_loginSuccess "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [processAutoLoginCookie](#method_processAutoLoginCookie)(array $cookieParts, [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin(). | | | | [onLoginFail](#method_onLoginFail)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) | from [AbstractRememberMeServices](abstractremembermeservices#method_onLoginFail "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [onLoginSuccess](#method_onLoginSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it. | | | | [getUserProvider](#method_getUserProvider)($class) | from [AbstractRememberMeServices](abstractremembermeservices#method_getUserProvider "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | array | [decodeCookie](#method_decodeCookie)(string $rawCookie) Decodes the raw cookie value. | from [AbstractRememberMeServices](abstractremembermeservices#method_decodeCookie "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | string | [encodeCookie](#method_encodeCookie)(array $cookieParts) Encodes the cookie parts. | from [AbstractRememberMeServices](abstractremembermeservices#method_encodeCookie "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [cancelCookie](#method_cancelCookie)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Deletes the remember-me cookie. | | | bool | [isRememberMeRequested](#method_isRememberMeRequested)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Checks whether remember-me capabilities were requested. | from [AbstractRememberMeServices](abstractremembermeservices#method_isRememberMeRequested "Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices") | | | [setTokenProvider](#method_setTokenProvider)([TokenProviderInterface](../../core/authentication/rememberme/tokenproviderinterface "Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface") $tokenProvider) | | Details ------- ### \_\_construct(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | array | $userProviders | | | string | $secret | | | string | $providerKey | | | array | $options | | | LoggerInterface | $logger | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getRememberMeParameter() Returns the parameter that is used for checking whether remember-me services have been requested. #### Return Value | | | | --- | --- | | string | | ### string getSecret() #### Return Value | | | | --- | --- | | string | | ### final [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") autoLogin([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | #### Exceptions | | | | --- | --- | | [CookieTheftException](../../core/exception/cookietheftexception "Symfony\Component\Security\Core\Exception\CookieTheftException") | | | [RuntimeException](http://php.net/RuntimeException) | | ### logout([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for LogoutHandlerInterface. Deletes the cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### final loginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### final loginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Implementation for RememberMeServicesInterface. This is called when an authentication is successful. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### protected [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") processAutoLoginCookie(array $cookieParts, [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin(). #### Parameters | | | | | --- | --- | --- | | array | $cookieParts | | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### protected onLoginFail([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Exception](http://php.net/Exception) $exception = null) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Exception](http://php.net/Exception) | $exception | | ### protected onLoginSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### final protected getUserProvider($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### protected array decodeCookie(string $rawCookie) Decodes the raw cookie value. #### Parameters | | | | | --- | --- | --- | | string | $rawCookie | | #### Return Value | | | | --- | --- | | array | | ### protected string encodeCookie(array $cookieParts) Encodes the cookie parts. #### Parameters | | | | | --- | --- | --- | | array | $cookieParts | | #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When $cookieParts contain the cookie delimiter. Extending class should either remove or escape it. | ### protected cancelCookie([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Deletes the remember-me cookie. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | ### protected bool isRememberMeRequested([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Checks whether remember-me capabilities were requested. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | ### setTokenProvider([TokenProviderInterface](../../core/authentication/rememberme/tokenproviderinterface "Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface") $tokenProvider) #### Parameters | | | | | --- | --- | --- | | [TokenProviderInterface](../../core/authentication/rememberme/tokenproviderinterface "Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInterface") | $tokenProvider | | symfony RetryAuthenticationEntryPoint RetryAuthenticationEntryPoint ============================== class **RetryAuthenticationEntryPoint** implements [AuthenticationEntryPointInterface](authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") RetryAuthenticationEntryPoint redirects URL based on the configured scheme. This entry point is not intended to work with HTTP post requests. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int $httpPort = 80, int $httpsPort = 443) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [start](#method_start)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. | | Details ------- ### \_\_construct(int $httpPort = 80, int $httpsPort = 443) #### Parameters | | | | | --- | --- | --- | | int | $httpPort | | | int | $httpsPort | | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") start([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. This is called when an anonymous request accesses a resource that requires authentication. The job of this method is to return some response that "helps" the user start into the authentication process. Examples: * For a form login, you might redirect to the login page return new RedirectResponse('/login'); * For an API token authentication system, you return a 401 response return new Response('Auth header required', 401); #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request that resulted in an AuthenticationException | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authException | The exception that started the authentication process | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | | symfony FormAuthenticationEntryPoint FormAuthenticationEntryPoint ============================= class **FormAuthenticationEntryPoint** implements [AuthenticationEntryPointInterface](authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") FormAuthenticationEntryPoint starts an authentication via a login form. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([HttpKernelInterface](../../../httpkernel/httpkernelinterface "Symfony\Component\HttpKernel\HttpKernelInterface") $kernel, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $loginPath, bool $useForward = false) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [start](#method_start)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. | | Details ------- ### \_\_construct([HttpKernelInterface](../../../httpkernel/httpkernelinterface "Symfony\Component\HttpKernel\HttpKernelInterface") $kernel, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, string $loginPath, bool $useForward = false) #### Parameters | | | | | --- | --- | --- | | [HttpKernelInterface](../../../httpkernel/httpkernelinterface "Symfony\Component\HttpKernel\HttpKernelInterface") | $kernel | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | An HttpUtils instance | | string | $loginPath | The path to the login form | | bool | $useForward | Whether to forward or redirect to the login form | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") start([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. This is called when an anonymous request accesses a resource that requires authentication. The job of this method is to return some response that "helps" the user start into the authentication process. Examples: * For a form login, you might redirect to the login page return new RedirectResponse('/login'); * For an API token authentication system, you return a 401 response return new Response('Auth header required', 401); #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request that resulted in an AuthenticationException | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authException | The exception that started the authentication process | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | |
programming_docs
symfony BasicAuthenticationEntryPoint BasicAuthenticationEntryPoint ============================== class **BasicAuthenticationEntryPoint** implements [AuthenticationEntryPointInterface](authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") BasicAuthenticationEntryPoint starts an HTTP Basic authentication. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $realmName) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [start](#method_start)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. | | Details ------- ### \_\_construct(string $realmName) #### Parameters | | | | | --- | --- | --- | | string | $realmName | | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") start([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. This is called when an anonymous request accesses a resource that requires authentication. The job of this method is to return some response that "helps" the user start into the authentication process. Examples: * For a form login, you might redirect to the login page return new RedirectResponse('/login'); * For an API token authentication system, you return a 401 response return new Response('Auth header required', 401); #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request that resulted in an AuthenticationException | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authException | The exception that started the authentication process | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | | symfony AuthenticationEntryPointInterface AuthenticationEntryPointInterface ================================== interface **AuthenticationEntryPointInterface** Implement this interface for any classes that will be called to "start" the authentication process (see method for more details). Methods ------- | | | | | --- | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [start](#method_start)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. | | Details ------- ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") start([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. This is called when an anonymous request accesses a resource that requires authentication. The job of this method is to return some response that "helps" the user start into the authentication process. Examples: * For a form login, you might redirect to the login page return new RedirectResponse('/login'); * For an API token authentication system, you return a 401 response return new Response('Auth header required', 401); #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request that resulted in an AuthenticationException | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authException | The exception that started the authentication process | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | | symfony AccessDeniedHandlerInterface AccessDeniedHandlerInterface ============================= interface **AccessDeniedHandlerInterface** This is used by the ExceptionListener to translate an AccessDeniedException to a Response object. Methods ------- | | | | | --- | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [handle](#method_handle)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AccessDeniedException](../../core/exception/accessdeniedexception "Symfony\Component\Security\Core\Exception\AccessDeniedException") $accessDeniedException) Handles an access denied failure. | | Details ------- ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") handle([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AccessDeniedException](../../core/exception/accessdeniedexception "Symfony\Component\Security\Core\Exception\AccessDeniedException") $accessDeniedException) Handles an access denied failure. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AccessDeniedException](../../core/exception/accessdeniedexception "Symfony\Component\Security\Core\Exception\AccessDeniedException") | $accessDeniedException | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | may return null | symfony SimplePreAuthenticatorInterface SimplePreAuthenticatorInterface ================================ interface **SimplePreAuthenticatorInterface** implements [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") Methods ------- | | | | | --- | --- | --- | | | [authenticateToken](#method_authenticateToken)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, $providerKey) | from [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface#method_authenticateToken "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") | | | [supportsToken](#method_supportsToken)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, $providerKey) | from [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface#method_supportsToken "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") | | | [createToken](#method_createToken)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, $providerKey) | | Details ------- ### authenticateToken([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, $providerKey) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | | $providerKey | | ### supportsToken([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, $providerKey) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | | $providerKey | | ### createToken([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, $providerKey) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | | $providerKey | | symfony CustomAuthenticationSuccessHandler CustomAuthenticationSuccessHandler =================================== class **CustomAuthenticationSuccessHandler** implements [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $handler, array $options, string $providerKey) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationSuccess](#method_onAuthenticationSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | Details ------- ### \_\_construct([AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $handler, array $options, string $providerKey) #### Parameters | | | | | --- | --- | --- | | [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") | $handler | An AuthenticationSuccessHandlerInterface instance | | array | $options | Options for processing a successful authentication attempt | | string | $providerKey | The provider key | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | never null | symfony DefaultAuthenticationFailureHandler DefaultAuthenticationFailureHandler ==================================== class **DefaultAuthenticationFailureHandler** implements [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") Class with the default authentication failure handling logic. Can be optionally be extended from by the developer to alter the behaviour while keeping the default behaviour. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $httpKernel | | | | protected | $httpUtils | | | | protected | $logger | | | | protected | $options | | | | protected | $defaultOptions | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([HttpKernelInterface](../../../httpkernel/httpkernelinterface "Symfony\Component\HttpKernel\HttpKernelInterface") $httpKernel, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, array $options = array(), LoggerInterface $logger = null) | | | array | [getOptions](#method_getOptions)() Gets the options. | | | | [setOptions](#method_setOptions)(array $options) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationFailure](#method_onAuthenticationFailure)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | Details ------- ### \_\_construct([HttpKernelInterface](../../../httpkernel/httpkernelinterface "Symfony\Component\HttpKernel\HttpKernelInterface") $httpKernel, [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, array $options = array(), LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [HttpKernelInterface](../../../httpkernel/httpkernelinterface "Symfony\Component\HttpKernel\HttpKernelInterface") | $httpKernel | | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | array | $options | | | LoggerInterface | $logger | | ### array getOptions() Gets the options. #### Return Value | | | | --- | --- | | array | An array of options | ### setOptions(array $options) #### Parameters | | | | | --- | --- | --- | | array | $options | | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationFailure([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $exception | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | The response to return, never null | symfony AuthenticationSuccessHandlerInterface AuthenticationSuccessHandlerInterface ====================================== interface **AuthenticationSuccessHandlerInterface** Interface for a custom authentication success handler. If you want to customize the success handling process, instead of overwriting the respective listener globally, you can set a custom success handler which implements this interface. Methods ------- | | | | | --- | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationSuccess](#method_onAuthenticationSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | Details ------- ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | never null | symfony SimpleAuthenticationHandler SimpleAuthenticationHandler ============================ class **SimpleAuthenticationHandler** implements [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface"), [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") Class to proxy authentication success/failure handlers. Events are sent to the SimpleAuthenticatorInterface if it implements the right interface, otherwise (or if it fails to return a Response) the default handlers are triggered. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $successHandler | | | | protected | $failureHandler | | | | protected | $simpleAuthenticator | | | | protected | $logger | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") $authenticator, [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, LoggerInterface $logger = null) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationSuccess](#method_onAuthenticationSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationFailure](#method_onAuthenticationFailure)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | Details ------- ### \_\_construct([SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") $authenticator, [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") $successHandler, [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $failureHandler, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") | $authenticator | SimpleAuthenticatorInterface instance | | [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") | $successHandler | Default success handler | | [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") | $failureHandler | Default failure handler | | LoggerInterface | $logger | Optional logger | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | never null | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationFailure([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $exception | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | The response to return, never null |
programming_docs
symfony CustomAuthenticationFailureHandler CustomAuthenticationFailureHandler =================================== class **CustomAuthenticationFailureHandler** implements [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $handler, array $options) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationFailure](#method_onAuthenticationFailure)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | Details ------- ### \_\_construct([AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") $handler, array $options) #### Parameters | | | | | --- | --- | --- | | [AuthenticationFailureHandlerInterface](authenticationfailurehandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface") | $handler | An AuthenticationFailureHandlerInterface instance | | array | $options | Options for processing a successful authentication attempt | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationFailure([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $exception | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | The response to return, never null | symfony DefaultAuthenticationSuccessHandler DefaultAuthenticationSuccessHandler ==================================== class **DefaultAuthenticationSuccessHandler** implements [AuthenticationSuccessHandlerInterface](authenticationsuccesshandlerinterface "Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface") Class with the default authentication success handling logic. Traits ------ | | | | --- | --- | | [TargetPathTrait](../util/targetpathtrait "Symfony\Component\Security\Http\Util\TargetPathTrait") | Trait to get (and set) the URL the user last visited before being forced to authenticate. | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $httpUtils | | | | protected | $options | | | | protected | $providerKey | | | | protected | $defaultOptions | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, array $options = array()) | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationSuccess](#method_onAuthenticationSuccess)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | | array | [getOptions](#method_getOptions)() Gets the options. | | | | [setOptions](#method_setOptions)(array $options) | | | string | [getProviderKey](#method_getProviderKey)() Get the provider key. | | | | [setProviderKey](#method_setProviderKey)(string $providerKey) Set the provider key. | | | string | [determineTargetUrl](#method_determineTargetUrl)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Builds the target URL according to the defined options. | | Details ------- ### \_\_construct([HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") $httpUtils, array $options = array()) #### Parameters | | | | | --- | --- | --- | | [HttpUtils](../httputils "Symfony\Component\Security\Http\HttpUtils") | $httpUtils | | | array | $options | Options for processing a successful authentication attempt | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationSuccess([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | never null | ### array getOptions() Gets the options. #### Return Value | | | | --- | --- | | array | An array of options | ### setOptions(array $options) #### Parameters | | | | | --- | --- | --- | | array | $options | | ### string getProviderKey() Get the provider key. #### Return Value | | | | --- | --- | | string | | ### setProviderKey(string $providerKey) Set the provider key. #### Parameters | | | | | --- | --- | --- | | string | $providerKey | | ### protected string determineTargetUrl([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Builds the target URL according to the defined options. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | string | | symfony AuthenticationFailureHandlerInterface AuthenticationFailureHandlerInterface ====================================== interface **AuthenticationFailureHandlerInterface** Interface for custom authentication failure handlers. If you want to customize the failure handling process, instead of overwriting the respective listener globally, you can set a custom failure handler which implements this interface. Methods ------- | | | | | --- | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [onAuthenticationFailure](#method_onAuthenticationFailure)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. | | Details ------- ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") onAuthenticationFailure([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $exception | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | The response to return, never null | symfony AuthenticationUtils AuthenticationUtils ==================== class **AuthenticationUtils** Extracts Security Errors from Request. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack) | | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException")|null | [getLastAuthenticationError](#method_getLastAuthenticationError)(bool $clearSession = true) | | | string | [getLastUsername](#method_getLastUsername)() | | Details ------- ### \_\_construct([RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack) #### Parameters | | | | | --- | --- | --- | | [RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") | $requestStack | | ### [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException")|null getLastAuthenticationError(bool $clearSession = true) #### Parameters | | | | | --- | --- | --- | | bool | $clearSession | | #### Return Value | | | | --- | --- | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException")|null | | ### string getLastUsername() #### Return Value | | | | --- | --- | | string | | symfony SimpleFormAuthenticatorInterface SimpleFormAuthenticatorInterface ================================= interface **SimpleFormAuthenticatorInterface** implements [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") Methods ------- | | | | | --- | --- | --- | | | [authenticateToken](#method_authenticateToken)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, $providerKey) | from [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface#method_authenticateToken "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") | | | [supportsToken](#method_supportsToken)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, $providerKey) | from [SimpleAuthenticatorInterface](../../core/authentication/simpleauthenticatorinterface#method_supportsToken "Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface") | | | [createToken](#method_createToken)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, $username, $password, $providerKey) | | Details ------- ### authenticateToken([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, $providerKey) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | | | $providerKey | | ### supportsToken([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, $providerKey) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | | $providerKey | | ### createToken([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, $username, $password, $providerKey) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | | $username | | | | $password | | | | $providerKey | | symfony SwitchUserEvent SwitchUserEvent ================ class **SwitchUserEvent** extends [Event](../../../eventdispatcher/event "Symfony\Component\EventDispatcher\Event") SwitchUserEvent. Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $targetUser, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) | | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | [getRequest](#method_getRequest)() | | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | [getTargetUser](#method_getTargetUser)() | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | [getToken](#method_getToken)() | | | | [setToken](#method_setToken)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $targetUser, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token = null) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $targetUser | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | ### [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") getRequest() #### Return Value | | | | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | | ### [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") getTargetUser() #### Return Value | | | | --- | --- | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | | ### [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null getToken() #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface")|null | | ### setToken([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony InteractiveLoginEvent InteractiveLoginEvent ====================== class **InteractiveLoginEvent** extends [Event](../../../eventdispatcher/event "Symfony\Component\EventDispatcher\Event") Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $authenticationToken) | | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | [getRequest](#method_getRequest)() Gets the request. | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [getAuthenticationToken](#method_getAuthenticationToken)() Gets the authentication token. | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $authenticationToken) #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $authenticationToken | | ### [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") getRequest() Gets the request. #### Return Value | | | | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | A Request instance | ### [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") getAuthenticationToken() Gets the authentication token. #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | A TokenInterface instance |
programming_docs
symfony SessionAuthenticationStrategyInterface SessionAuthenticationStrategyInterface ======================================= interface **SessionAuthenticationStrategyInterface** SessionAuthenticationStrategyInterface. Implementation are responsible for updating the session after an interactive authentication attempt was successful. Methods ------- | | | | | --- | --- | --- | | | [onAuthentication](#method_onAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This performs any necessary changes to the session. | | Details ------- ### onAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This performs any necessary changes to the session. This method should be called before the TokenStorage is populated with a Token. It should be used by authentication listeners when a session is used. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony SessionAuthenticationStrategy SessionAuthenticationStrategy ============================== class **SessionAuthenticationStrategy** implements [SessionAuthenticationStrategyInterface](sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") The default session strategy implementation. Supports the following strategies: NONE: the session is not changed MIGRATE: the session id is updated, attributes are kept INVALIDATE: the session id is updated, attributes are lost Constants --------- | | | | --- | --- | | NONE | | | MIGRATE | | | INVALIDATE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $strategy) | | | | [onAuthentication](#method_onAuthentication)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This performs any necessary changes to the session. | | Details ------- ### \_\_construct(string $strategy) #### Parameters | | | | | --- | --- | --- | | string | $strategy | | ### onAuthentication([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) This performs any necessary changes to the session. This method should be called before the TokenStorage is populated with a Token. It should be used by authentication listeners when a session is used. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | symfony Symfony\Component\Security\Guard\Provider Symfony\Component\Security\Guard\Provider ========================================= Classes ------- | | | | --- | --- | | [GuardAuthenticationProvider](provider/guardauthenticationprovider "Symfony\Component\Security\Guard\Provider\GuardAuthenticationProvider") | Responsible for accepting the PreAuthenticationGuardToken and calling the correct authenticator to retrieve the authenticated token. | symfony AbstractGuardAuthenticator AbstractGuardAuthenticator =========================== abstract class **AbstractGuardAuthenticator** implements [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") An optional base class that creates a PostAuthenticationGuardToken for you. Methods ------- | | | | | --- | --- | --- | | [GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") | [createAuthenticatedToken](#method_createAuthenticatedToken)([UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey) Shortcut to create a PostAuthenticationGuardToken for you, if you don't really care about which authenticated token you're using. | | Details ------- ### [GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") createAuthenticatedToken([UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey) Shortcut to create a PostAuthenticationGuardToken for you, if you don't really care about which authenticated token you're using. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | string | $providerKey | The provider (i.e. firewall) key | #### Return Value | | | | --- | --- | | [GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") | | symfony AuthenticatorInterface AuthenticatorInterface ======================= interface **AuthenticatorInterface** implements [AuthenticationEntryPointInterface](../http/entrypoint/authenticationentrypointinterface "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") The interface for all "guard" authenticators. The methods on this interface are called throughout the guard authentication process to give you the power to control most parts of the process from one location. Methods ------- | | | | | --- | --- | --- | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [start](#method_start)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. | from [AuthenticationEntryPointInterface](../http/entrypoint/authenticationentrypointinterface#method_start "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface") | | bool | [supports](#method_supports)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Does the authenticator support the given Request? | | | mixed | [getCredentials](#method_getCredentials)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Get the authentication credentials from the request and return them as any type (e.g. an associate array). | | | [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|null | [getUser](#method_getUser)(mixed $credentials, [UserProviderInterface](../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider) Return a UserInterface object based on the credentials. | | | bool | [checkCredentials](#method_checkCredentials)(mixed $credentials, [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Returns true if the credentials are valid. | | | [GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") | [createAuthenticatedToken](#method_createAuthenticatedToken)([UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey) Create an authenticated token for the given user. | | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | [onAuthenticationFailure](#method_onAuthenticationFailure)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) Called when authentication executed, but failed (e.g. wrong username password). | | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | [onAuthenticationSuccess](#method_onAuthenticationSuccess)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, string $providerKey) Called when authentication executed and was successful! | | | bool | [supportsRememberMe](#method_supportsRememberMe)() Does this method support remember me cookies? | | Details ------- ### [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") start([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Returns a response that directs the user to authenticate. This is called when an anonymous request accesses a resource that requires authentication. The job of this method is to return some response that "helps" the user start into the authentication process. Examples: * For a form login, you might redirect to the login page return new RedirectResponse('/login'); * For an API token authentication system, you return a 401 response return new Response('Auth header required', 401); #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request that resulted in an AuthenticationException | | [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authException | The exception that started the authentication process | #### Return Value | | | | --- | --- | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | | ### bool supports([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Does the authenticator support the given Request? If this returns false, the authenticator will be skipped. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | | ### mixed getCredentials([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Get the authentication credentials from the request and return them as any type (e.g. an associate array). Whatever value you return here will be passed to getUser() and checkCredentials() For example, for a form login, you might: ``` return array( 'username' => $request->request->get('_username'), 'password' => $request->request->get('_password'), ); ``` Or for an API token that's on a header, you might use: ``` return array('api_key' => $request->headers->get('X-API-TOKEN')); ``` #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | mixed | Any non-null value | #### Exceptions | | | | --- | --- | | [UnexpectedValueException](http://php.net/UnexpectedValueException) | If null is returned | ### [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|null getUser(mixed $credentials, [UserProviderInterface](../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider) Return a UserInterface object based on the credentials. The *credentials* are the return value from getCredentials() You may throw an AuthenticationException if you wish. If you return null, then a UsernameNotFoundException is thrown for you. #### Parameters | | | | | --- | --- | --- | | mixed | $credentials | | | [UserProviderInterface](../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | | #### Return Value | | | | --- | --- | | [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface")|null | | #### Exceptions | | | | --- | --- | | [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | | ### bool checkCredentials(mixed $credentials, [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user) Returns true if the credentials are valid. If any value other than true is returned, authentication will fail. You may also throw an AuthenticationException if you wish to cause authentication to fail. The *credentials* are the return value from getCredentials() #### Parameters | | | | | --- | --- | --- | | mixed | $credentials | | | [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | | ### [GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") createAuthenticatedToken([UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey) Create an authenticated token for the given user. If you don't care about which token class is used or don't really understand what a "token" is, you can skip this method by extending the AbstractGuardAuthenticator class from your authenticator. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | string | $providerKey | The provider (i.e. firewall) key | #### Return Value | | | | --- | --- | | [GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") | | #### See also | | | | --- | --- | | [AbstractGuardAuthenticator](abstractguardauthenticator "Symfony\Component\Security\Guard\AbstractGuardAuthenticator") | | ### [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null onAuthenticationFailure([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) Called when authentication executed, but failed (e.g. wrong username password). This should return the Response sent back to the user, like a RedirectResponse to the login page or a 403 response. If you return null, the request will continue, but the user will not be authenticated. This is probably not what you want to do. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $exception | | #### Return Value | | | | --- | --- | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | | ### [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null onAuthenticationSuccess([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, string $providerKey) Called when authentication executed and was successful! This should return the Response sent back to the user, like a RedirectResponse to the last page they visited. If you return null, the current request will continue, and the user will be authenticated. This makes sense, for example, with an API. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | string | $providerKey | The provider (i.e. firewall) key | #### Return Value | | | | --- | --- | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | | ### bool supportsRememberMe() Does this method support remember me cookies? Remember me cookie will be set if *all* of the following are met: A) This method returns true B) The remember\_me key under your firewall is configured C) The "remember me" functionality is activated. This is usually done by having a \_remember\_me checkbox in your form, but can be configured by the "always\_remember\_me" and "remember\_me\_parameter" parameters under the "remember\_me" firewall key D) The onAuthenticationSuccess method returns a Response object #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\Security\Guard\Authenticator Symfony\Component\Security\Guard\Authenticator ============================================== Classes ------- | | | | --- | --- | | [AbstractFormLoginAuthenticator](authenticator/abstractformloginauthenticator "Symfony\Component\Security\Guard\Authenticator\AbstractFormLoginAuthenticator") | A base class to make form login authentication easier! | symfony Symfony\Component\Security\Guard\Token Symfony\Component\Security\Guard\Token ====================================== Classes ------- | | | | --- | --- | | [PostAuthenticationGuardToken](token/postauthenticationguardtoken "Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken") | Used as an "authenticated" token, though it could be set to not-authenticated later. | | [PreAuthenticationGuardToken](token/preauthenticationguardtoken "Symfony\Component\Security\Guard\Token\PreAuthenticationGuardToken") | The token used by the guard auth system before authentication. | Interfaces ---------- | | | | --- | --- | | *[GuardTokenInterface](token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface")* | A marker interface that both guard tokens implement. | symfony Symfony\Component\Security\Guard\Firewall Symfony\Component\Security\Guard\Firewall ========================================= Classes ------- | | | | --- | --- | | [GuardAuthenticationListener](firewall/guardauthenticationlistener "Symfony\Component\Security\Guard\Firewall\GuardAuthenticationListener") | Authentication listener for the "guard" system. | symfony GuardAuthenticatorHandler GuardAuthenticatorHandler ========================== class **GuardAuthenticatorHandler** A utility class that does much of the *work* during the guard authentication process. By having the logic here instead of the listener, more of the process can be called directly (e.g. for manual authentication) or overridden. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [EventDispatcherInterface](../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $eventDispatcher = null, array $statelessProviderKeys = array()) | | | | [authenticateWithToken](#method_authenticateWithToken)([TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Authenticates the given token in the system. | | | Response|null | [handleAuthenticationSuccess](#method_handleAuthenticationSuccess)([TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") $guardAuthenticator, string $providerKey) Returns the "on success" response for the given GuardAuthenticator. | | | Response|null | [authenticateUserAndHandleSuccess](#method_authenticateUserAndHandleSuccess)([UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") $authenticator, string $providerKey) Convenience method for authenticating the user and returning the Response *if any* for success. | | | Response|null | [handleAuthenticationFailure](#method_handleAuthenticationFailure)([AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authenticationException, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") $guardAuthenticator, string $providerKey) Handles an authentication failure and returns the Response for the GuardAuthenticator. | | | | [setSessionAuthenticationStrategy](#method_setSessionAuthenticationStrategy)([SessionAuthenticationStrategyInterface](../http/session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. | | Details ------- ### \_\_construct([TokenStorageInterface](../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [EventDispatcherInterface](../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $eventDispatcher = null, array $statelessProviderKeys = array()) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [EventDispatcherInterface](../../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $eventDispatcher | | | array | $statelessProviderKeys | | ### authenticateWithToken([TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Authenticates the given token in the system. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | ### Response|null handleAuthenticationSuccess([TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") $guardAuthenticator, string $providerKey) Returns the "on success" response for the given GuardAuthenticator. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") | $guardAuthenticator | | | string | $providerKey | | #### Return Value | | | | --- | --- | | Response|null | | ### Response|null authenticateUserAndHandleSuccess([UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") $authenticator, string $providerKey) Convenience method for authenticating the user and returning the Response *if any* for success. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") | $authenticator | | | string | $providerKey | | #### Return Value | | | | --- | --- | | Response|null | | ### Response|null handleAuthenticationFailure([AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authenticationException, [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") $guardAuthenticator, string $providerKey) Handles an authentication failure and returns the Response for the GuardAuthenticator. #### Parameters | | | | | --- | --- | --- | | [AuthenticationException](../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authenticationException | | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticatorInterface](authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface") | $guardAuthenticator | | | string | $providerKey | | #### Return Value | | | | --- | --- | | Response|null | | ### setSessionAuthenticationStrategy([SessionAuthenticationStrategyInterface](../http/session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") $sessionStrategy) Call this method if your authentication token is stored to a session. #### Parameters | | | | | --- | --- | --- | | [SessionAuthenticationStrategyInterface](../http/session/sessionauthenticationstrategyinterface "Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface") | $sessionStrategy | |
programming_docs
symfony PostAuthenticationGuardToken PostAuthenticationGuardToken ============================= class **PostAuthenticationGuardToken** extends [AbstractToken](../../core/authentication/token/abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") implements [GuardTokenInterface](guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") Used as an "authenticated" token, though it could be set to not-authenticated later. If you're using Guard authentication, you *must* use a class that implements GuardTokenInterface as your authenticated token (like this class). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey, array $roles) | | | [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getUsername](#method_getUsername)() Returns the username. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAuthenticated](#method_setAuthenticated)($authenticated) Sets the authenticated flag. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_eraseCredentials "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [AbstractToken](../../core/authentication/token/abstracttoken#method___toString "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getCredentials](#method_getCredentials)() This is meant to be only an authenticated token, where credentials have already been used and are thus cleared. | | | string | [getProviderKey](#method_getProviderKey)() Returns the provider (firewall) key. | | Details ------- ### \_\_construct([UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey, array $roles) #### Parameters | | | | | --- | --- | --- | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | The user! | | string | $providerKey | The provider (firewall) key | | array | $roles | An array of roles | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($authenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $authenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### mixed getCredentials() This is meant to be only an authenticated token, where credentials have already been used and are thus cleared. {@inheritdoc} #### Return Value | | | | --- | --- | | mixed | The user credentials | ### string getProviderKey() Returns the provider (firewall) key. #### Return Value | | | | --- | --- | | string | | symfony PreAuthenticationGuardToken PreAuthenticationGuardToken ============================ class **PreAuthenticationGuardToken** extends [AbstractToken](../../core/authentication/token/abstracttoken "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") implements [GuardTokenInterface](guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") The token used by the guard auth system before authentication. The GuardAuthenticationListener creates this, which is then consumed immediately by the GuardAuthenticationProvider. If authentication is successful, a different authenticated token is returned Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(mixed $credentials, string $guardProviderKey) | | | [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [getUsername](#method_getUsername)() Returns the username. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAuthenticated](#method_setAuthenticated)($authenticated) Sets the authenticated flag. | | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_eraseCredentials "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [serialize](#method_serialize)() {@inheritdoc} | from [AbstractToken](../../core/authentication/token/abstracttoken#method_serialize "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | from [AbstractToken](../../core/authentication/token/abstracttoken#method_unserialize "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [AbstractToken](../../core/authentication/token/abstracttoken#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [AbstractToken](../../core/authentication/token/abstracttoken#method___toString "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | | [getGuardProviderKey](#method_getGuardProviderKey)() | | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials, which might be an array of anything you wanted to put in there (e.g. username, password, favoriteColor). | | Details ------- ### \_\_construct(mixed $credentials, string $guardProviderKey) #### Parameters | | | | | --- | --- | --- | | mixed | $credentials | | | string | $guardProviderKey | Unique key that bind this token to a specific AuthenticatorInterface | ### [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated($authenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | | $authenticated | | ### eraseCredentials() Removes sensitive information from the token. ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value | ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### getGuardProviderKey() ### mixed getCredentials() Returns the user credentials, which might be an array of anything you wanted to put in there (e.g. username, password, favoriteColor). #### Return Value | | | | --- | --- | | mixed | The user credentials | symfony GuardTokenInterface GuardTokenInterface ==================== interface **GuardTokenInterface** implements [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") A marker interface that both guard tokens implement. Any tokens passed to GuardAuthenticationProvider (i.e. any tokens that are handled by the guard auth system) must implement this interface. Methods ------- | | | | | --- | --- | --- | | string | [\_\_toString](#method___toString)() Returns a string representation of the Token. | from [TokenInterface](../../core/authentication/token/tokeninterface#method___toString "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] | [getRoles](#method_getRoles)() Returns the user roles. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_getRoles "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | mixed | [getCredentials](#method_getCredentials)() Returns the user credentials. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_getCredentials "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | string|object | [getUser](#method_getUser)() Returns a user representation. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_getUser "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | | [setUser](#method_setUser)(string|object $user) Sets the user in the token. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_setUser "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | string | [getUsername](#method_getUsername)() Returns the username. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_getUsername "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | bool | [isAuthenticated](#method_isAuthenticated)() Returns whether the user is authenticated or not. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_isAuthenticated "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | | [setAuthenticated](#method_setAuthenticated)(bool $isAuthenticated) Sets the authenticated flag. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_setAuthenticated "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | | [eraseCredentials](#method_eraseCredentials)() Removes sensitive information from the token. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_eraseCredentials "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | array | [getAttributes](#method_getAttributes)() Returns the token attributes. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_getAttributes "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | | [setAttributes](#method_setAttributes)(array $attributes) Sets the token attributes. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_setAttributes "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | bool | [hasAttribute](#method_hasAttribute)(string $name) Returns true if the attribute exists. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_hasAttribute "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | mixed | [getAttribute](#method_getAttribute)(string $name) Returns an attribute value. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_getAttribute "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | | | [setAttribute](#method_setAttribute)(string $name, mixed $value) Sets an attribute. | from [TokenInterface](../../core/authentication/token/tokeninterface#method_setAttribute "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | Details ------- ### string \_\_toString() Returns a string representation of the Token. This is only to be used for debugging purposes. #### Return Value | | | | --- | --- | | string | | ### [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] getRoles() Returns the user roles. #### Return Value | | | | --- | --- | | [Role](../../core/role/role "Symfony\Component\Security\Core\Role\Role")[] | An array of Role instances | ### mixed getCredentials() Returns the user credentials. #### Return Value | | | | --- | --- | | mixed | The user credentials | ### string|object getUser() Returns a user representation. #### Return Value | | | | --- | --- | | string|object | Can be a UserInterface instance, an object implementing a \_\_toString method, or the username as a regular string | #### See also | | | | --- | --- | | [AbstractToken::setUser](../../core/authentication/token/abstracttoken#method_setUser "Symfony\Component\Security\Core\Authentication\Token\AbstractToken") | | ### setUser(string|object $user) Sets the user in the token. The user can be a UserInterface instance, or an object implementing a \_\_toString method or the username as a regular string. #### Parameters | | | | | --- | --- | --- | | string|object | $user | The user | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getUsername() Returns the username. #### Return Value | | | | --- | --- | | string | | ### bool isAuthenticated() Returns whether the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the token has been authenticated, false otherwise | ### setAuthenticated(bool $isAuthenticated) Sets the authenticated flag. #### Parameters | | | | | --- | --- | --- | | bool | $isAuthenticated | The authenticated flag | ### eraseCredentials() Removes sensitive information from the token. ### array getAttributes() Returns the token attributes. #### Return Value | | | | --- | --- | | array | The token attributes | ### setAttributes(array $attributes) Sets the token attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | The token attributes | ### bool hasAttribute(string $name) Returns true if the attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute exists, false otherwise | ### mixed getAttribute(string $name) Returns an attribute value. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | mixed | The attribute value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When attribute doesn't exist for this token | ### setAttribute(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $value | The attribute value |
programming_docs
symfony GuardAuthenticationProvider GuardAuthenticationProvider ============================ class **GuardAuthenticationProvider** implements [AuthenticationProviderInterface](../../core/authentication/provider/authenticationproviderinterface "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface") Responsible for accepting the PreAuthenticationGuardToken and calling the correct authenticator to retrieve the authenticated token. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable|[AuthenticatorInterface](../authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")[] $guardAuthenticators, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, string $providerKey, [UserCheckerInterface](../../core/user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker) | | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | [authenticate](#method_authenticate)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Finds the correct authenticator for the token and calls it. | | | bool | [supports](#method_supports)([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. | | Details ------- ### \_\_construct(iterable|[AuthenticatorInterface](../authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")[] $guardAuthenticators, [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") $userProvider, string $providerKey, [UserCheckerInterface](../../core/user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") $userChecker) #### Parameters | | | | | --- | --- | --- | | iterable|[AuthenticatorInterface](../authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")[] | $guardAuthenticators | The authenticators, with keys that match what's passed to GuardAuthenticationListener | | [UserProviderInterface](../../core/user/userproviderinterface "Symfony\Component\Security\Core\User\UserProviderInterface") | $userProvider | The user provider | | string | $providerKey | The provider (i.e. firewall) key | | [UserCheckerInterface](../../core/user/usercheckerinterface "Symfony\Component\Security\Core\User\UserCheckerInterface") | $userChecker | | ### [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") authenticate([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Finds the correct authenticator for the token and calls it. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | The TokenInterface instance to authenticate | #### Return Value | | | | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | An authenticated TokenInterface instance, never null | ### bool supports([TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") $token) Checks whether this provider supports the given token. #### Parameters | | | | | --- | --- | --- | | [TokenInterface](../../core/authentication/token/tokeninterface "Symfony\Component\Security\Core\Authentication\Token\TokenInterface") | $token | | #### Return Value | | | | --- | --- | | bool | true if the implementation supports the Token, false otherwise | symfony GuardAuthenticationListener GuardAuthenticationListener ============================ class **GuardAuthenticationListener** implements [ListenerInterface](../../http/firewall/listenerinterface "Symfony\Component\Security\Http\Firewall\ListenerInterface") Authentication listener for the "guard" system. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([GuardAuthenticatorHandler](../guardauthenticatorhandler "Symfony\Component\Security\Guard\GuardAuthenticatorHandler") $guardHandler, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, iterable|[AuthenticatorInterface](../authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")[] $guardAuthenticators, LoggerInterface $logger = null) | | | | [handle](#method_handle)([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Iterates over each authenticator to see if each wants to authenticate the request. | | | | [setRememberMeServices](#method_setRememberMeServices)([RememberMeServicesInterface](../../http/rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Should be called if this listener will support remember me. | | Details ------- ### \_\_construct([GuardAuthenticatorHandler](../guardauthenticatorhandler "Symfony\Component\Security\Guard\GuardAuthenticatorHandler") $guardHandler, [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") $authenticationManager, string $providerKey, iterable|[AuthenticatorInterface](../authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")[] $guardAuthenticators, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [GuardAuthenticatorHandler](../guardauthenticatorhandler "Symfony\Component\Security\Guard\GuardAuthenticatorHandler") | $guardHandler | The Guard handler | | [AuthenticationManagerInterface](../../core/authentication/authenticationmanagerinterface "Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface") | $authenticationManager | An AuthenticationManagerInterface instance | | string | $providerKey | The provider (i.e. firewall) key | | iterable|[AuthenticatorInterface](../authenticatorinterface "Symfony\Component\Security\Guard\AuthenticatorInterface")[] | $guardAuthenticators | The authenticators, with keys that match what's passed to GuardAuthenticationProvider | | LoggerInterface | $logger | A LoggerInterface instance | ### handle([GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") $event) Iterates over each authenticator to see if each wants to authenticate the request. #### Parameters | | | | | --- | --- | --- | | [GetResponseEvent](../../../httpkernel/event/getresponseevent "Symfony\Component\HttpKernel\Event\GetResponseEvent") | $event | | ### setRememberMeServices([RememberMeServicesInterface](../../http/rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") $rememberMeServices) Should be called if this listener will support remember me. #### Parameters | | | | | --- | --- | --- | | [RememberMeServicesInterface](../../http/rememberme/remembermeservicesinterface "Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface") | $rememberMeServices | | symfony AbstractFormLoginAuthenticator AbstractFormLoginAuthenticator =============================== abstract class **AbstractFormLoginAuthenticator** extends [AbstractGuardAuthenticator](../abstractguardauthenticator "Symfony\Component\Security\Guard\AbstractGuardAuthenticator") A base class to make form login authentication easier! Methods ------- | | | | | --- | --- | --- | | [GuardTokenInterface](../token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") | [createAuthenticatedToken](#method_createAuthenticatedToken)([UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey) Shortcut to create a PostAuthenticationGuardToken for you, if you don't really care about which authenticated token you're using. | from [AbstractGuardAuthenticator](../abstractguardauthenticator#method_createAuthenticatedToken "Symfony\Component\Security\Guard\AbstractGuardAuthenticator") | | string | [getLoginUrl](#method_getLoginUrl)() Return the URL to the login page. | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | [onAuthenticationFailure](#method_onAuthenticationFailure)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) Override to change what happens after a bad username/password is submitted. | | | bool | [supportsRememberMe](#method_supportsRememberMe)() Does this method support remember me cookies? | | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | [start](#method_start)([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Override to control what happens when the user hits a secure page but isn't logged in yet. | | Details ------- ### [GuardTokenInterface](../token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") createAuthenticatedToken([UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") $user, string $providerKey) Shortcut to create a PostAuthenticationGuardToken for you, if you don't really care about which authenticated token you're using. #### Parameters | | | | | --- | --- | --- | | [UserInterface](../../core/user/userinterface "Symfony\Component\Security\Core\User\UserInterface") | $user | | | string | $providerKey | The provider (i.e. firewall) key | #### Return Value | | | | --- | --- | | [GuardTokenInterface](../token/guardtokeninterface "Symfony\Component\Security\Guard\Token\GuardTokenInterface") | | ### abstract protected string getLoginUrl() Return the URL to the login page. #### Return Value | | | | --- | --- | | string | | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null onAuthenticationFailure([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $exception) Override to change what happens after a bad username/password is submitted. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $exception | | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response")|null | | ### bool supportsRememberMe() Does this method support remember me cookies? Remember me cookie will be set if *all* of the following are met: A) This method returns true B) The remember\_me key under your firewall is configured C) The "remember me" functionality is activated. This is usually done by having a \_remember\_me checkbox in your form, but can be configured by the "always\_remember\_me" and "remember\_me\_parameter" parameters under the "remember\_me" firewall key D) The onAuthenticationSuccess method returns a Response object #### Return Value | | | | --- | --- | | bool | | ### [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") start([Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") $authException = null) Override to control what happens when the user hits a secure page but isn't logged in yet. #### Parameters | | | | | --- | --- | --- | | [Request](../../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | The request that resulted in an AuthenticationException | | [AuthenticationException](../../core/exception/authenticationexception "Symfony\Component\Security\Core\Exception\AuthenticationException") | $authException | The exception that started the authentication process | #### Return Value | | | | --- | --- | | [Response](../../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | | symfony Symfony\Component\ExpressionLanguage\Node Symfony\Component\ExpressionLanguage\Node ========================================= Classes ------- | | | | --- | --- | | [ArgumentsNode](node/argumentsnode "Symfony\Component\ExpressionLanguage\Node\ArgumentsNode") | | | [ArrayNode](node/arraynode "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | | | [BinaryNode](node/binarynode "Symfony\Component\ExpressionLanguage\Node\BinaryNode") | | | [ConditionalNode](node/conditionalnode "Symfony\Component\ExpressionLanguage\Node\ConditionalNode") | | | [ConstantNode](node/constantnode "Symfony\Component\ExpressionLanguage\Node\ConstantNode") | | | [FunctionNode](node/functionnode "Symfony\Component\ExpressionLanguage\Node\FunctionNode") | | | [GetAttrNode](node/getattrnode "Symfony\Component\ExpressionLanguage\Node\GetAttrNode") | | | [NameNode](node/namenode "Symfony\Component\ExpressionLanguage\Node\NameNode") | | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | Represents a node in the AST. | | [UnaryNode](node/unarynode "Symfony\Component\ExpressionLanguage\Node\UnaryNode") | | symfony ExpressionFunction ExpressionFunction =================== class **ExpressionFunction** Represents a function that can be used in an expression. A function is defined by two PHP callables. The callables are used by the language to compile and/or evaluate the function. The "compiler" function is used at compilation time and must return a PHP representation of the function call (it receives the function arguments as arguments). The "evaluator" function is used for expression evaluation and must return the value of the function call based on the values defined for the expression (it receives the values as a first argument and the function arguments as remaining arguments). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, callable $compiler, callable $evaluator) | | | | [getName](#method_getName)() | | | | [getCompiler](#method_getCompiler)() | | | | [getEvaluator](#method_getEvaluator)() | | | static [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | [fromPhp](#method_fromPhp)(string $phpFunctionName, string|null $expressionFunctionName = null) Creates an ExpressionFunction from a PHP function name. | | Details ------- ### \_\_construct(string $name, callable $compiler, callable $evaluator) #### Parameters | | | | | --- | --- | --- | | string | $name | The function name | | callable | $compiler | A callable able to compile the function | | callable | $evaluator | A callable able to evaluate the function | ### getName() ### getCompiler() ### getEvaluator() ### static [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") fromPhp(string $phpFunctionName, string|null $expressionFunctionName = null) Creates an ExpressionFunction from a PHP function name. #### Parameters | | | | | --- | --- | --- | | string | $phpFunctionName | The PHP function name | | string|null | $expressionFunctionName | The expression function name (default: same than the PHP function name) | #### Return Value | | | | --- | --- | | [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if given PHP function name does not exist | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if given PHP function name is in namespace and expression function name is not defined | symfony Parser Parser ======= class **Parser** Parsers a token stream. This parser implements a "Precedence climbing" algorithm. Constants --------- | | | | --- | --- | | OPERATOR\_LEFT | | | OPERATOR\_RIGHT | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $functions) | | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | [parse](#method_parse)([TokenStream](tokenstream "Symfony\Component\ExpressionLanguage\TokenStream") $stream, array $names = array()) Converts a token stream to a node tree. | | | | [parseExpression](#method_parseExpression)($precedence = 0) | | | | [getPrimary](#method_getPrimary)() | | | | [parseConditionalExpression](#method_parseConditionalExpression)($expr) | | | | [parsePrimaryExpression](#method_parsePrimaryExpression)() | | | | [parseArrayExpression](#method_parseArrayExpression)() | | | | [parseHashExpression](#method_parseHashExpression)() | | | | [parsePostfixExpression](#method_parsePostfixExpression)($node) | | | | [parseArguments](#method_parseArguments)() Parses arguments. | | Details ------- ### \_\_construct(array $functions) #### Parameters | | | | | --- | --- | --- | | array | $functions | | ### [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") parse([TokenStream](tokenstream "Symfony\Component\ExpressionLanguage\TokenStream") $stream, array $names = array()) Converts a token stream to a node tree. The valid names is an array where the values are the names that the user can use in an expression. If the variable name in the compiled PHP code must be different, define it as the key. For instance, ['this' => 'container'] means that the variable 'container' can be used in the expression but the compiled code will use 'this'. #### Parameters | | | | | --- | --- | --- | | [TokenStream](tokenstream "Symfony\Component\ExpressionLanguage\TokenStream") | $stream | A token stream instance | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | A node tree | #### Exceptions | | | | --- | --- | | [SyntaxError](syntaxerror "Symfony\Component\ExpressionLanguage\SyntaxError") | | ### parseExpression($precedence = 0) #### Parameters | | | | | --- | --- | --- | | | $precedence | | ### protected getPrimary() ### protected parseConditionalExpression($expr) #### Parameters | | | | | --- | --- | --- | | | $expr | | ### parsePrimaryExpression() ### parseArrayExpression() ### parseHashExpression() ### parsePostfixExpression($node) #### Parameters | | | | | --- | --- | --- | | | $node | | ### parseArguments() Parses arguments.
programming_docs
symfony ExpressionLanguage ExpressionLanguage =================== class **ExpressionLanguage** Allows to compile and evaluate expressions written in your own DSL. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $functions | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(CacheItemPoolInterface $cache = null, array $providers = array()) | | | string | [compile](#method_compile)([Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. | | | mixed | [evaluate](#method_evaluate)([Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. | | | [ParsedExpression](parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | [parse](#method_parse)([Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. | | | | [register](#method_register)(string $name, callable $compiler, callable $evaluator) Registers a function. | | | | [addFunction](#method_addFunction)([ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) | | | | [registerProvider](#method_registerProvider)([ExpressionFunctionProviderInterface](expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | | | | [registerFunctions](#method_registerFunctions)() | | Details ------- ### \_\_construct(CacheItemPoolInterface $cache = null, array $providers = array()) #### Parameters | | | | | --- | --- | --- | | CacheItemPoolInterface | $cache | | | array | $providers | | ### string compile([Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. #### Parameters | | | | | --- | --- | --- | | [Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | string | The compiled PHP source code | ### mixed evaluate([Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $values | An array of values | #### Return Value | | | | --- | --- | | mixed | The result of the evaluation of the expression | ### [ParsedExpression](parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") parse([Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to parse | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | [ParsedExpression](parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | A ParsedExpression instance | ### register(string $name, callable $compiler, callable $evaluator) Registers a function. #### Parameters | | | | | --- | --- | --- | | string | $name | The function name | | callable | $compiler | A callable able to compile the function | | callable | $evaluator | A callable able to evaluate the function | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | when registering a function after calling evaluate(), compile() or parse() | #### See also | | | | --- | --- | | [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | | ### addFunction([ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | $function | | ### registerProvider([ExpressionFunctionProviderInterface](expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected registerFunctions() symfony SerializedParsedExpression SerializedParsedExpression =========================== class **SerializedParsedExpression** extends [ParsedExpression](parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") Represents an already parsed expression. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $expression | | from [Expression](expression#property_expression "Symfony\Component\ExpressionLanguage\Expression") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $expression, [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $nodes) | | | string | [\_\_toString](#method___toString)() Gets the expression. | from [Expression](expression#method___toString "Symfony\Component\ExpressionLanguage\Expression") | | | [getNodes](#method_getNodes)() | | Details ------- ### \_\_construct(string $expression, [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $nodes) #### Parameters | | | | | --- | --- | --- | | string | $expression | | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | $nodes | A Node representing the expression | ### string \_\_toString() Gets the expression. #### Return Value | | | | --- | --- | | string | The expression | ### getNodes() symfony TokenStream TokenStream ============ class **TokenStream** Represents a token stream. Properties ---------- | | | | | | --- | --- | --- | --- | | | $current | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $tokens, string $expression = '') | | | string | [\_\_toString](#method___toString)() Returns a string representation of the token stream. | | | | [next](#method_next)() Sets the pointer to the next token and returns the old one. | | | | [expect](#method_expect)(array|int $type, string|null $value = null, string|null $message = null) Tests a token. | | | bool | [isEOF](#method_isEOF)() Checks if end of stream was reached. | | | string | [getExpression](#method_getExpression)() | | Details ------- ### \_\_construct(array $tokens, string $expression = '') #### Parameters | | | | | --- | --- | --- | | array | $tokens | | | string | $expression | | ### string \_\_toString() Returns a string representation of the token stream. #### Return Value | | | | --- | --- | | string | | ### next() Sets the pointer to the next token and returns the old one. ### expect(array|int $type, string|null $value = null, string|null $message = null) Tests a token. #### Parameters | | | | | --- | --- | --- | | array|int | $type | The type to test | | string|null | $value | The token value | | string|null | $message | The syntax error message | ### bool isEOF() Checks if end of stream was reached. #### Return Value | | | | --- | --- | | bool | | ### string getExpression() #### Return Value | | | | --- | --- | | string | | symfony ParsedExpression ParsedExpression ================= class **ParsedExpression** extends [Expression](expression "Symfony\Component\ExpressionLanguage\Expression") Represents an already parsed expression. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $expression | | from [Expression](expression#property_expression "Symfony\Component\ExpressionLanguage\Expression") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $expression, [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $nodes) | | | string | [\_\_toString](#method___toString)() Gets the expression. | from [Expression](expression#method___toString "Symfony\Component\ExpressionLanguage\Expression") | | | [getNodes](#method_getNodes)() | | Details ------- ### \_\_construct(string $expression, [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $nodes) #### Parameters | | | | | --- | --- | --- | | string | $expression | | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | $nodes | A Node representing the expression | ### string \_\_toString() Gets the expression. #### Return Value | | | | --- | --- | | string | The expression | ### getNodes() symfony Compiler Compiler ========= class **Compiler** Compiles a node to PHP code. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $functions) | | | | [getFunction](#method_getFunction)($name) | | | string | [getSource](#method_getSource)() Gets the current PHP code after compilation. | | | | [reset](#method_reset)() | | | $this | [compile](#method_compile)([Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $node) Compiles a node. | | | | [subcompile](#method_subcompile)([Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $node) | | | $this | [raw](#method_raw)(string $string) Adds a raw string to the compiled code. | | | $this | [string](#method_string)(string $value) Adds a quoted string to the compiled code. | | | $this | [repr](#method_repr)(mixed $value) Returns a PHP representation of a given value. | | Details ------- ### \_\_construct(array $functions) #### Parameters | | | | | --- | --- | --- | | array | $functions | | ### getFunction($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### string getSource() Gets the current PHP code after compilation. #### Return Value | | | | --- | --- | | string | The PHP code | ### reset() ### $this compile([Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $node) Compiles a node. #### Parameters | | | | | --- | --- | --- | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | $node | | #### Return Value | | | | --- | --- | | $this | | ### subcompile([Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") $node) #### Parameters | | | | | --- | --- | --- | | [Node](node/node "Symfony\Component\ExpressionLanguage\Node\Node") | $node | | ### $this raw(string $string) Adds a raw string to the compiled code. #### Parameters | | | | | --- | --- | --- | | string | $string | The string | #### Return Value | | | | --- | --- | | $this | | ### $this string(string $value) Adds a quoted string to the compiled code. #### Parameters | | | | | --- | --- | --- | | string | $value | The string | #### Return Value | | | | --- | --- | | $this | | ### $this repr(mixed $value) Returns a PHP representation of a given value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to convert | #### Return Value | | | | --- | --- | | $this | | symfony Expression Expression =========== class **Expression** Represents an expression. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $expression | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $expression) | | | string | [\_\_toString](#method___toString)() Gets the expression. | | Details ------- ### \_\_construct(string $expression) #### Parameters | | | | | --- | --- | --- | | string | $expression | | ### string \_\_toString() Gets the expression. #### Return Value | | | | --- | --- | | string | The expression | symfony Lexer Lexer ====== class **Lexer** Lexes an expression. Methods ------- | | | | | --- | --- | --- | | [TokenStream](tokenstream "Symfony\Component\ExpressionLanguage\TokenStream") | [tokenize](#method_tokenize)(string $expression) Tokenizes an expression. | | Details ------- ### [TokenStream](tokenstream "Symfony\Component\ExpressionLanguage\TokenStream") tokenize(string $expression) Tokenizes an expression. #### Parameters | | | | | --- | --- | --- | | string | $expression | The expression to tokenize | #### Return Value | | | | --- | --- | | [TokenStream](tokenstream "Symfony\Component\ExpressionLanguage\TokenStream") | A token stream instance | #### Exceptions | | | | --- | --- | | [SyntaxError](syntaxerror "Symfony\Component\ExpressionLanguage\SyntaxError") | | symfony ExpressionFunctionProviderInterface ExpressionFunctionProviderInterface ==================================== interface **ExpressionFunctionProviderInterface** Methods ------- | | | | | --- | --- | --- | | [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] | [getFunctions](#method_getFunctions)() | | Details ------- ### [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] getFunctions() #### Return Value | | | | --- | --- | | [ExpressionFunction](expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] | An array of Function instances | symfony Token Token ====== class **Token** Represents a Token. Constants --------- | | | | --- | --- | | EOF\_TYPE | | | NAME\_TYPE | | | NUMBER\_TYPE | | | STRING\_TYPE | | | OPERATOR\_TYPE | | | PUNCTUATION\_TYPE | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $value | | | | | $type | | | | | $cursor | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $type, string|int|float|null $value, int|null $cursor) | | | string | [\_\_toString](#method___toString)() Returns a string representation of the token. | | | bool | [test](#method_test)(array|int $type, string|null $value = null) Tests the current token for a type and/or a value. | | Details ------- ### \_\_construct(string $type, string|int|float|null $value, int|null $cursor) #### Parameters | | | | | --- | --- | --- | | string | $type | The type of the token (self::\*\_TYPE) | | string|int|float|null | $value | The token value | | int|null | $cursor | The cursor position in the source | ### string \_\_toString() Returns a string representation of the token. #### Return Value | | | | --- | --- | | string | A string representation of the token | ### bool test(array|int $type, string|null $value = null) Tests the current token for a type and/or a value. #### Parameters | | | | | --- | --- | --- | | array|int | $type | The type to test | | string|null | $value | The token value | #### Return Value | | | | --- | --- | | bool | | symfony SyntaxError SyntaxError ============ class **SyntaxError** extends [LogicException](http://php.net/LogicException) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, int $cursor = 0, string $expression = '', string $subject = null, array $proposals = null) | | Details ------- ### \_\_construct(string $message, int $cursor = 0, string $expression = '', string $subject = null, array $proposals = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $cursor | | | string | $expression | | | string | $subject | | | array | $proposals | | symfony Node Node ===== class **Node** Represents a node in the AST. Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | | | | $attributes | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $nodes = array(), array $attributes = array()) | | | | [\_\_toString](#method___toString)() | | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | | | | [dumpString](#method_dumpString)($value) | | | | [isHash](#method_isHash)(array $value) | | Details ------- ### \_\_construct(array $nodes = array(), array $attributes = array()) #### Parameters | | | | | --- | --- | --- | | array | $nodes | An array of nodes | | array | $attributes | An array of attributes | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | symfony BinaryNode BinaryNode =========== class **BinaryNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $operator, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $left, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $right) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct(string $operator, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $left, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $right) #### Parameters | | | | | --- | --- | --- | | string | $operator | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $left | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $right | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | |
programming_docs
symfony ArgumentsNode ArgumentsNode ============== class **ArgumentsNode** extends [ArrayNode](arraynode "Symfony\Component\ExpressionLanguage\Node\ArrayNode") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | | protected | $index | | from [ArrayNode](arraynode#property_index "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | from [ArrayNode](arraynode#method___construct "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) Compiles the node to PHP. | | | | [evaluate](#method_evaluate)($functions, $values) | from [ArrayNode](arraynode#method_evaluate "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | | | [addElement](#method_addElement)([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $value, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $key = null) | from [ArrayNode](arraynode#method_addElement "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | | | [getKeyValuePairs](#method_getKeyValuePairs)() | from [ArrayNode](arraynode#method_getKeyValuePairs "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | | | [compileArguments](#method_compileArguments)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler, $withKeys = true) | from [ArrayNode](arraynode#method_compileArguments "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | Details ------- ### \_\_construct() ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) Compiles the node to PHP. #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | ### addElement([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $value, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $key = null) #### Parameters | | | | | --- | --- | --- | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $value | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $key | | ### protected getKeyValuePairs() ### protected compileArguments([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler, $withKeys = true) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | | | $withKeys | | symfony FunctionNode FunctionNode ============= class **FunctionNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $arguments) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct(string $name, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $arguments) #### Parameters | | | | | --- | --- | --- | | string | $name | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $arguments | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | symfony ConstantNode ConstantNode ============= class **ConstantNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($value, bool $isIdentifier = false) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct($value, bool $isIdentifier = false) #### Parameters | | | | | --- | --- | --- | | | $value | | | bool | $isIdentifier | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | symfony ConditionalNode ConditionalNode ================ class **ConditionalNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $expr1, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $expr2, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $expr3) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $expr1, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $expr2, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $expr3) #### Parameters | | | | | --- | --- | --- | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $expr1 | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $expr2 | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $expr3 | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | symfony GetAttrNode GetAttrNode ============ class **GetAttrNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Constants --------- | | | | --- | --- | | PROPERTY\_CALL | | | METHOD\_CALL | | | ARRAY\_CALL | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $node, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $attribute, [ArrayNode](arraynode "Symfony\Component\ExpressionLanguage\Node\ArrayNode") $arguments, int $type) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $node, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $attribute, [ArrayNode](arraynode "Symfony\Component\ExpressionLanguage\Node\ArrayNode") $arguments, int $type) #### Parameters | | | | | --- | --- | --- | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $node | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $attribute | | | [ArrayNode](arraynode "Symfony\Component\ExpressionLanguage\Node\ArrayNode") | $arguments | | | int | $type | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | symfony NameNode NameNode ========= class **NameNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct(string $name) #### Parameters | | | | | --- | --- | --- | | string | $name | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | symfony ArrayNode ArrayNode ========== class **ArrayNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | | protected | $index | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) Compiles the node to PHP. | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | | | [addElement](#method_addElement)([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $value, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $key = null) | | | | [getKeyValuePairs](#method_getKeyValuePairs)() | | | | [compileArguments](#method_compileArguments)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler, $withKeys = true) | | Details ------- ### \_\_construct() ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) Compiles the node to PHP. #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | | ### addElement([Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $value, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $key = null) #### Parameters | | | | | --- | --- | --- | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $value | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $key | | ### protected getKeyValuePairs() ### protected compileArguments([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler, $withKeys = true) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | | | $withKeys | | symfony UnaryNode UnaryNode ========== class **UnaryNode** extends [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") Properties ---------- | | | | | | --- | --- | --- | --- | | | $nodes | | from [Node](node#property_nodes "Symfony\Component\ExpressionLanguage\Node\Node") | | | $attributes | | from [Node](node#property_attributes "Symfony\Component\ExpressionLanguage\Node\Node") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $operator, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $node) | | | | [\_\_toString](#method___toString)() | from [Node](node#method___toString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [compile](#method_compile)([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) | | | | [evaluate](#method_evaluate)($functions, $values) | | | | [toArray](#method_toArray)() | | | | [dump](#method_dump)() | from [Node](node#method_dump "Symfony\Component\ExpressionLanguage\Node\Node") | | | [dumpString](#method_dumpString)($value) | from [Node](node#method_dumpString "Symfony\Component\ExpressionLanguage\Node\Node") | | | [isHash](#method_isHash)(array $value) | from [Node](node#method_isHash "Symfony\Component\ExpressionLanguage\Node\Node") | Details ------- ### \_\_construct(string $operator, [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") $node) #### Parameters | | | | | --- | --- | --- | | string | $operator | | | [Node](node "Symfony\Component\ExpressionLanguage\Node\Node") | $node | | ### \_\_toString() ### compile([Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") $compiler) #### Parameters | | | | | --- | --- | --- | | [Compiler](../compiler "Symfony\Component\ExpressionLanguage\Compiler") | $compiler | | ### evaluate($functions, $values) #### Parameters | | | | | --- | --- | --- | | | $functions | | | | $values | | ### toArray() ### dump() ### protected dumpString($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### protected isHash(array $value) #### Parameters | | | | | --- | --- | --- | | array | $value | |
programming_docs
symfony Symfony\Component\Ldap\Exception Symfony\Component\Ldap\Exception ================================ Classes ------- | | | | --- | --- | | [ConnectionException](exception/connectionexception "Symfony\Component\Ldap\Exception\ConnectionException") | ConnectionException is throw if binding to ldap can not be established. | | [DriverNotFoundException](exception/drivernotfoundexception "Symfony\Component\Ldap\Exception\DriverNotFoundException") | LdapException is throw if php ldap module is not loaded. | | [LdapException](exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | LdapException is throw if php ldap module is not loaded. | | [NotBoundException](exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | NotBoundException is thrown if the connection with the LDAP server is not yet bound. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Ldap\Exception\ExceptionInterface")* | Base ExceptionInterface for the Ldap component. | symfony Symfony\Component\Ldap\Adapter Symfony\Component\Ldap\Adapter ============================== Namespaces ---------- [Symfony\Component\Ldap\Adapter\ExtLdap](adapter/extldap) Classes ------- | | | | --- | --- | | [AbstractConnection](adapter/abstractconnection "Symfony\Component\Ldap\Adapter\AbstractConnection") | | | [AbstractQuery](adapter/abstractquery "Symfony\Component\Ldap\Adapter\AbstractQuery") | | Interfaces ---------- | | | | --- | --- | | *[AdapterInterface](adapter/adapterinterface "Symfony\Component\Ldap\Adapter\AdapterInterface")* | | | *[CollectionInterface](adapter/collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")* | | | *[ConnectionInterface](adapter/connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface")* | | | *[EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface")* | Entry manager interface. | | *[QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface")* | | symfony LdapInterface LdapInterface ============== interface **LdapInterface** Ldap interface. Constants --------- | | | | --- | --- | | ESCAPE\_FILTER | | | ESCAPE\_DN | | Methods ------- | | | | | --- | --- | --- | | | [bind](#method_bind)(string $dn = null, string $password = null) Return a connection bound to the ldap. | | | [QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | [query](#method_query)(string $dn, string $query, array $options = array()) Queries a ldap server for entries matching the given criteria. | | | [EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | [getEntryManager](#method_getEntryManager)() | | | string | [escape](#method_escape)(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. | | Details ------- ### bind(string $dn = null, string $password = null) Return a connection bound to the ldap. #### Parameters | | | | | --- | --- | --- | | string | $dn | A LDAP dn | | string | $password | A password | #### Exceptions | | | | --- | --- | | [ConnectionException](exception/connectionexception "Symfony\Component\Ldap\Exception\ConnectionException") | if dn / password could not be bound | ### [QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") query(string $dn, string $query, array $options = array()) Queries a ldap server for entries matching the given criteria. #### Parameters | | | | | --- | --- | --- | | string | $dn | | | string | $query | | | array | $options | | #### Return Value | | | | --- | --- | | [QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | | ### [EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") getEntryManager() #### Return Value | | | | --- | --- | | [EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | | ### string escape(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. #### Parameters | | | | | --- | --- | --- | | string | $subject | | | string | $ignore | | | int | $flags | | #### Return Value | | | | --- | --- | | string | | symfony Ldap Ldap ===== class **Ldap** implements [LdapInterface](ldapinterface "Symfony\Component\Ldap\LdapInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([AdapterInterface](adapter/adapterinterface "Symfony\Component\Ldap\Adapter\AdapterInterface") $adapter) | | | | [bind](#method_bind)(string $dn = null, string $password = null) Return a connection bound to the ldap. | | | [QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | [query](#method_query)(string $dn, string $query, array $options = array()) Queries a ldap server for entries matching the given criteria. | | | [EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | [getEntryManager](#method_getEntryManager)() | | | string | [escape](#method_escape)(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. | | | static [Ldap](ldap "Symfony\Component\Ldap\Ldap") | [create](#method_create)(string $adapter, array $config = array()) Creates a new Ldap instance. | | Details ------- ### \_\_construct([AdapterInterface](adapter/adapterinterface "Symfony\Component\Ldap\Adapter\AdapterInterface") $adapter) #### Parameters | | | | | --- | --- | --- | | [AdapterInterface](adapter/adapterinterface "Symfony\Component\Ldap\Adapter\AdapterInterface") | $adapter | | ### bind(string $dn = null, string $password = null) Return a connection bound to the ldap. #### Parameters | | | | | --- | --- | --- | | string | $dn | A LDAP dn | | string | $password | A password | #### Exceptions | | | | --- | --- | | [ConnectionException](exception/connectionexception "Symfony\Component\Ldap\Exception\ConnectionException") | if dn / password could not be bound | ### [QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") query(string $dn, string $query, array $options = array()) Queries a ldap server for entries matching the given criteria. #### Parameters | | | | | --- | --- | --- | | string | $dn | | | string | $query | | | array | $options | | #### Return Value | | | | --- | --- | | [QueryInterface](adapter/queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | | ### [EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") getEntryManager() #### Return Value | | | | --- | --- | | [EntryManagerInterface](adapter/entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | | ### string escape(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. #### Parameters | | | | | --- | --- | --- | | string | $subject | | | string | $ignore | | | int | $flags | | #### Return Value | | | | --- | --- | | string | | ### static [Ldap](ldap "Symfony\Component\Ldap\Ldap") create(string $adapter, array $config = array()) Creates a new Ldap instance. #### Parameters | | | | | --- | --- | --- | | string | $adapter | The adapter name | | array | $config | The adapter's configuration | #### Return Value | | | | --- | --- | | [Ldap](ldap "Symfony\Component\Ldap\Ldap") | | symfony Entry Entry ====== class **Entry** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $dn, array $attributes = array()) | | | string | [getDn](#method_getDn)() Returns the entry's DN. | | | bool | [hasAttribute](#method_hasAttribute)($name) Returns whether an attribute exists. | | | array|null | [getAttribute](#method_getAttribute)($name) Returns a specific attribute's value. | | | array | [getAttributes](#method_getAttributes)() Returns the complete list of attributes. | | | | [setAttribute](#method_setAttribute)(string $name, array $value) Sets a value for the given attribute. | | | | [removeAttribute](#method_removeAttribute)(string $name) Removes a given attribute. | | Details ------- ### \_\_construct(string $dn, array $attributes = array()) #### Parameters | | | | | --- | --- | --- | | string | $dn | | | array | $attributes | | ### string getDn() Returns the entry's DN. #### Return Value | | | | --- | --- | | string | | ### bool hasAttribute($name) Returns whether an attribute exists. #### Parameters | | | | | --- | --- | --- | | | $name | string The name of the attribute | #### Return Value | | | | --- | --- | | bool | | ### array|null getAttribute($name) Returns a specific attribute's value. As LDAP can return multiple values for a single attribute, this value is returned as an array. #### Parameters | | | | | --- | --- | --- | | | $name | string The name of the attribute | #### Return Value | | | | --- | --- | | array|null | | ### array getAttributes() Returns the complete list of attributes. #### Return Value | | | | --- | --- | | array | | ### setAttribute(string $name, array $value) Sets a value for the given attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | array | $value | | ### removeAttribute(string $name) Removes a given attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | symfony AbstractConnection AbstractConnection =================== abstract class **AbstractConnection** implements [ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $config | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $config = array()) | | | | [configureOptions](#method_configureOptions)([OptionsResolver](../../optionsresolver/optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") $resolver) Configures the adapter's options. | | Details ------- ### \_\_construct(array $config = array()) #### Parameters | | | | | --- | --- | --- | | array | $config | | ### protected configureOptions([OptionsResolver](../../optionsresolver/optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") $resolver) Configures the adapter's options. #### Parameters | | | | | --- | --- | --- | | [OptionsResolver](../../optionsresolver/optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") | $resolver | An OptionsResolver instance | symfony EntryManagerInterface EntryManagerInterface ====================== interface **EntryManagerInterface** Entry manager interface. Methods ------- | | | | | --- | --- | --- | | | [add](#method_add)([Entry](../entry "Symfony\Component\Ldap\Entry") $entry) Adds a new entry in the Ldap server. | | | | [update](#method_update)([Entry](../entry "Symfony\Component\Ldap\Entry") $entry) Updates an entry from the Ldap server. | | | | [rename](#method_rename)([Entry](../entry "Symfony\Component\Ldap\Entry") $entry, string $newRdn, bool $removeOldRdn = true) Renames an entry on the Ldap server. | | | | [remove](#method_remove)([Entry](../entry "Symfony\Component\Ldap\Entry") $entry) Removes an entry from the Ldap server. | | Details ------- ### add([Entry](../entry "Symfony\Component\Ldap\Entry") $entry) Adds a new entry in the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../entry "Symfony\Component\Ldap\Entry") | $entry | | #### Exceptions | | | | --- | --- | | [NotBoundException](../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### update([Entry](../entry "Symfony\Component\Ldap\Entry") $entry) Updates an entry from the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../entry "Symfony\Component\Ldap\Entry") | $entry | | #### Exceptions | | | | --- | --- | | [NotBoundException](../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### rename([Entry](../entry "Symfony\Component\Ldap\Entry") $entry, string $newRdn, bool $removeOldRdn = true) Renames an entry on the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../entry "Symfony\Component\Ldap\Entry") | $entry | | | string | $newRdn | | | bool | $removeOldRdn | | ### remove([Entry](../entry "Symfony\Component\Ldap\Entry") $entry) Removes an entry from the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../entry "Symfony\Component\Ldap\Entry") | $entry | | #### Exceptions | | | | --- | --- | | [NotBoundException](../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | symfony Symfony\Component\Ldap\Adapter\ExtLdap Symfony\Component\Ldap\Adapter\ExtLdap ====================================== Classes ------- | | | | --- | --- | | [Adapter](extldap/adapter "Symfony\Component\Ldap\Adapter\ExtLdap\Adapter") | | | [Collection](extldap/collection "Symfony\Component\Ldap\Adapter\ExtLdap\Collection") | | | [Connection](extldap/connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") | | | [ConnectionOptions](extldap/connectionoptions "Symfony\Component\Ldap\Adapter\ExtLdap\ConnectionOptions") | A class representing the Ldap extension's options, which can be used with ldap\_set\_option or ldap\_get\_option. | | [EntryManager](extldap/entrymanager "Symfony\Component\Ldap\Adapter\ExtLdap\EntryManager") | | | [Query](extldap/query "Symfony\Component\Ldap\Adapter\ExtLdap\Query") | | symfony CollectionInterface CollectionInterface ==================== interface **CollectionInterface** implements [Countable](http://php.net/Countable), [IteratorAggregate](http://php.net/IteratorAggregate), [ArrayAccess](http://php.net/ArrayAccess) Methods ------- | | | | | --- | --- | --- | | [Entry](../entry "Symfony\Component\Ldap\Entry")[] | [toArray](#method_toArray)() | | Details ------- ### [Entry](../entry "Symfony\Component\Ldap\Entry")[] toArray() #### Return Value | | | | --- | --- | | [Entry](../entry "Symfony\Component\Ldap\Entry")[] | | symfony AdapterInterface AdapterInterface ================= interface **AdapterInterface** Methods ------- | | | | | --- | --- | --- | | [ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") | [getConnection](#method_getConnection)() Returns the current connection. | | | [QueryInterface](queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | [createQuery](#method_createQuery)(string $dn, string $query, array $options = array()) Creates a new Query. | | | [EntryManagerInterface](entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | [getEntryManager](#method_getEntryManager)() Fetches the entry manager instance. | | | string | [escape](#method_escape)(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. | | Details ------- ### [ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") getConnection() Returns the current connection. #### Return Value | | | | --- | --- | | [ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") | | ### [QueryInterface](queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") createQuery(string $dn, string $query, array $options = array()) Creates a new Query. #### Parameters | | | | | --- | --- | --- | | string | $dn | | | string | $query | | | array | $options | | #### Return Value | | | | --- | --- | | [QueryInterface](queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | | ### [EntryManagerInterface](entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") getEntryManager() Fetches the entry manager instance. #### Return Value | | | | --- | --- | | [EntryManagerInterface](entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | | ### string escape(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. #### Parameters | | | | | --- | --- | --- | | string | $subject | | | string | $ignore | | | int | $flags | | #### Return Value | | | | --- | --- | | string | | symfony AbstractQuery AbstractQuery ============== abstract class **AbstractQuery** implements [QueryInterface](queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $connection | | | | protected | $dn | | | | protected | $query | | | | protected | $options | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") $connection, string $dn, string $query, array $options = array()) | | Details ------- ### \_\_construct([ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") $connection, string $dn, string $query, array $options = array()) #### Parameters | | | | | --- | --- | --- | | [ConnectionInterface](connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") | $connection | | | string | $dn | | | string | $query | | | array | $options | | symfony ConnectionInterface ConnectionInterface ==================== interface **ConnectionInterface** Methods ------- | | | | | --- | --- | --- | | bool | [isBound](#method_isBound)() Checks whether the connection was already bound or not. | | | | [bind](#method_bind)(string $dn = null, string $password = null) Binds the connection against a DN and password. | | Details ------- ### bool isBound() Checks whether the connection was already bound or not. #### Return Value | | | | --- | --- | | bool | | ### bind(string $dn = null, string $password = null) Binds the connection against a DN and password. #### Parameters | | | | | --- | --- | --- | | string | $dn | The user's DN | | string | $password | The associated password | symfony QueryInterface QueryInterface =============== interface **QueryInterface** Constants --------- | | | | --- | --- | | DEREF\_NEVER | | | DEREF\_SEARCHING | | | DEREF\_FINDING | | | DEREF\_ALWAYS | | | SCOPE\_BASE | | | SCOPE\_ONE | | | SCOPE\_SUB | | Methods ------- | | | | | --- | --- | --- | | [CollectionInterface](collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")|[Entry](../entry "Symfony\Component\Ldap\Entry")[] | [execute](#method_execute)() Executes a query and returns the list of Ldap entries. | | Details ------- ### [CollectionInterface](collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")|[Entry](../entry "Symfony\Component\Ldap\Entry")[] execute() Executes a query and returns the list of Ldap entries. #### Return Value | | | | --- | --- | | [CollectionInterface](collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")|[Entry](../entry "Symfony\Component\Ldap\Entry")[] | | #### Exceptions | | | | --- | --- | | [NotBoundException](../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | |
programming_docs
symfony Collection Collection =========== class **Collection** implements [CollectionInterface](../collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") $connection, [Query](query "Symfony\Component\Ldap\Adapter\ExtLdap\Query") $search) | | | [Entry](../../entry "Symfony\Component\Ldap\Entry")[] | [toArray](#method_toArray)() | | | | [count](#method_count)() | | | | [getIterator](#method_getIterator)() | | | | [offsetExists](#method_offsetExists)($offset) | | | | [offsetGet](#method_offsetGet)($offset) | | | | [offsetSet](#method_offsetSet)($offset, $value) | | | | [offsetUnset](#method_offsetUnset)($offset) | | Details ------- ### \_\_construct([Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") $connection, [Query](query "Symfony\Component\Ldap\Adapter\ExtLdap\Query") $search) #### Parameters | | | | | --- | --- | --- | | [Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") | $connection | | | [Query](query "Symfony\Component\Ldap\Adapter\ExtLdap\Query") | $search | | ### [Entry](../../entry "Symfony\Component\Ldap\Entry")[] toArray() #### Return Value | | | | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry")[] | | ### count() ### getIterator() ### offsetExists($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | ### offsetGet($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | ### offsetSet($offset, $value) #### Parameters | | | | | --- | --- | --- | | | $offset | | | | $value | | ### offsetUnset($offset) #### Parameters | | | | | --- | --- | --- | | | $offset | | symfony ConnectionOptions ConnectionOptions ================== class **ConnectionOptions** A class representing the Ldap extension's options, which can be used with ldap\_set\_option or ldap\_get\_option. Constants --------- | | | | --- | --- | | API\_INFO | | | DEREF | | | SIZELIMIT | | | TIMELIMIT | | | REFERRALS | | | RESTART | | | PROTOCOL\_VERSION | | | SERVER\_CONTROLS | | | CLIENT\_CONTROLS | | | API\_FEATURE\_INFO | | | HOST\_NAME | | | ERROR\_NUMBER | | | ERROR\_STRING | | | MATCHED\_DN | | | DEBUG\_LEVEL | | | NETWORK\_TIMEOUT | | | X\_SASL\_MECH | | | X\_SASL\_REALM | | | X\_SASL\_AUTHCID | | | X\_SASL\_AUTHZID | | Methods ------- | | | | | --- | --- | --- | | static | [getOptionName](#method_getOptionName)($name) | | | static int | [getOption](#method_getOption)(string $name) Fetches an option's corresponding constant value from an option name. | | | static | [isOption](#method_isOption)($name) | | Details ------- ### static getOptionName($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### static int getOption(string $name) Fetches an option's corresponding constant value from an option name. The option name can either be in snake or camel case. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | int | | #### Exceptions | | | | --- | --- | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### static isOption($name) #### Parameters | | | | | --- | --- | --- | | | $name | | symfony Adapter Adapter ======== class **Adapter** implements [AdapterInterface](../adapterinterface "Symfony\Component\Ldap\Adapter\AdapterInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $config = array()) | | | [ConnectionInterface](../connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") | [getConnection](#method_getConnection)() Returns the current connection. | | | [EntryManagerInterface](../entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | [getEntryManager](#method_getEntryManager)() Fetches the entry manager instance. | | | [QueryInterface](../queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | [createQuery](#method_createQuery)(string $dn, string $query, array $options = array()) Creates a new Query. | | | string | [escape](#method_escape)(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. | | Details ------- ### \_\_construct(array $config = array()) #### Parameters | | | | | --- | --- | --- | | array | $config | | ### [ConnectionInterface](../connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") getConnection() Returns the current connection. #### Return Value | | | | --- | --- | | [ConnectionInterface](../connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") | | ### [EntryManagerInterface](../entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") getEntryManager() Fetches the entry manager instance. #### Return Value | | | | --- | --- | | [EntryManagerInterface](../entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") | | ### [QueryInterface](../queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") createQuery(string $dn, string $query, array $options = array()) Creates a new Query. #### Parameters | | | | | --- | --- | --- | | string | $dn | | | string | $query | | | array | $options | | #### Return Value | | | | --- | --- | | [QueryInterface](../queryinterface "Symfony\Component\Ldap\Adapter\QueryInterface") | | ### string escape(string $subject, string $ignore = '', int $flags = 0) Escape a string for use in an LDAP filter or DN. #### Parameters | | | | | --- | --- | --- | | string | $subject | | | string | $ignore | | | int | $flags | | #### Return Value | | | | --- | --- | | string | | symfony EntryManager EntryManager ============= class **EntryManager** implements [EntryManagerInterface](../entrymanagerinterface "Symfony\Component\Ldap\Adapter\EntryManagerInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") $connection) | | | | [add](#method_add)([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry) Adds a new entry in the Ldap server. | | | | [update](#method_update)([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry) Updates an entry from the Ldap server. | | | | [remove](#method_remove)([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry) Removes an entry from the Ldap server. | | | | [addAttributeValues](#method_addAttributeValues)([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry, string $attribute, array $values) Adds values to an entry's multi-valued attribute from the LDAP server. | | | | [removeAttributeValues](#method_removeAttributeValues)([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry, string $attribute, array $values) Removes values from an entry's multi-valued attribute from the LDAP server. | | | | [rename](#method_rename)([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry, string $newRdn, bool $removeOldRdn = true) Renames an entry on the Ldap server. | | Details ------- ### \_\_construct([Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") $connection) #### Parameters | | | | | --- | --- | --- | | [Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") | $connection | | ### add([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry) Adds a new entry in the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry") | $entry | | #### Exceptions | | | | --- | --- | | [NotBoundException](../../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### update([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry) Updates an entry from the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry") | $entry | | #### Exceptions | | | | --- | --- | | [NotBoundException](../../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### remove([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry) Removes an entry from the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry") | $entry | | #### Exceptions | | | | --- | --- | | [NotBoundException](../../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### addAttributeValues([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry, string $attribute, array $values) Adds values to an entry's multi-valued attribute from the LDAP server. #### Parameters | | | | | --- | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry") | $entry | | | string | $attribute | | | array | $values | | #### Exceptions | | | | --- | --- | | [NotBoundException](../../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### removeAttributeValues([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry, string $attribute, array $values) Removes values from an entry's multi-valued attribute from the LDAP server. #### Parameters | | | | | --- | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry") | $entry | | | string | $attribute | | | array | $values | | #### Exceptions | | | | --- | --- | | [NotBoundException](../../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### rename([Entry](../../entry "Symfony\Component\Ldap\Entry") $entry, string $newRdn, bool $removeOldRdn = true) Renames an entry on the Ldap server. #### Parameters | | | | | --- | --- | --- | | [Entry](../../entry "Symfony\Component\Ldap\Entry") | $entry | | | string | $newRdn | | | bool | $removeOldRdn | | symfony Query Query ====== class **Query** extends [AbstractQuery](../abstractquery "Symfony\Component\Ldap\Adapter\AbstractQuery") Properties ---------- | | | | | | --- | --- | --- | --- | | protected [Connection](connection "Symfony\Component\Ldap\Adapter\ExtLdap\Connection") | $connection | | | | protected | $dn | | from [AbstractQuery](../abstractquery#property_dn "Symfony\Component\Ldap\Adapter\AbstractQuery") | | protected | $query | | from [AbstractQuery](../abstractquery#property_query "Symfony\Component\Ldap\Adapter\AbstractQuery") | | protected | $options | | from [AbstractQuery](../abstractquery#property_options "Symfony\Component\Ldap\Adapter\AbstractQuery") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ConnectionInterface](../connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") $connection, string $dn, string $query, array $options = array()) | | | | [\_\_destruct](#method___destruct)() | | | [CollectionInterface](../collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")|[Entry](../../entry "Symfony\Component\Ldap\Entry")[] | [execute](#method_execute)() Executes a query and returns the list of Ldap entries. | | | resource | [getResource](#method_getResource)() Returns a LDAP search resource. | | Details ------- ### \_\_construct([ConnectionInterface](../connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") $connection, string $dn, string $query, array $options = array()) #### Parameters | | | | | --- | --- | --- | | [ConnectionInterface](../connectioninterface "Symfony\Component\Ldap\Adapter\ConnectionInterface") | $connection | | | string | $dn | | | string | $query | | | array | $options | | ### \_\_destruct() ### [CollectionInterface](../collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")|[Entry](../../entry "Symfony\Component\Ldap\Entry")[] execute() Executes a query and returns the list of Ldap entries. #### Return Value | | | | --- | --- | | [CollectionInterface](../collectioninterface "Symfony\Component\Ldap\Adapter\CollectionInterface")|[Entry](../../entry "Symfony\Component\Ldap\Entry")[] | | #### Exceptions | | | | --- | --- | | [NotBoundException](../../exception/notboundexception "Symfony\Component\Ldap\Exception\NotBoundException") | | | [LdapException](../../exception/ldapexception "Symfony\Component\Ldap\Exception\LdapException") | | ### resource getResource() Returns a LDAP search resource. #### Return Value | | | | --- | --- | | resource | | symfony Connection Connection =========== class **Connection** extends [AbstractConnection](../abstractconnection "Symfony\Component\Ldap\Adapter\AbstractConnection") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $config | | from [AbstractConnection](../abstractconnection#property_config "Symfony\Component\Ldap\Adapter\AbstractConnection") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $config = array()) | from [AbstractConnection](../abstractconnection#method___construct "Symfony\Component\Ldap\Adapter\AbstractConnection") | | | [configureOptions](#method_configureOptions)([OptionsResolver](../../../optionsresolver/optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") $resolver) Configures the adapter's options. | | | | [\_\_destruct](#method___destruct)() | | | bool | [isBound](#method_isBound)() Checks whether the connection was already bound or not. | | | | [bind](#method_bind)(string $dn = null, string $password = null) Binds the connection against a DN and password. | | | resource | [getResource](#method_getResource)() Returns a link resource. | | | | [setOption](#method_setOption)($name, $value) | | | | [getOption](#method_getOption)($name) | | Details ------- ### \_\_construct(array $config = array()) #### Parameters | | | | | --- | --- | --- | | array | $config | | ### protected configureOptions([OptionsResolver](../../../optionsresolver/optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") $resolver) Configures the adapter's options. #### Parameters | | | | | --- | --- | --- | | [OptionsResolver](../../../optionsresolver/optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") | $resolver | An OptionsResolver instance | ### \_\_destruct() ### bool isBound() Checks whether the connection was already bound or not. #### Return Value | | | | --- | --- | | bool | | ### bind(string $dn = null, string $password = null) Binds the connection against a DN and password. #### Parameters | | | | | --- | --- | --- | | string | $dn | The user's DN | | string | $password | The associated password | ### resource getResource() Returns a link resource. #### Return Value | | | | --- | --- | | resource | | ### setOption($name, $value) #### Parameters | | | | | --- | --- | --- | | | $name | | | | $value | | ### getOption($name) #### Parameters | | | | | --- | --- | --- | | | $name | | symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Base ExceptionInterface for the Ldap component. symfony ConnectionException ConnectionException ==================== class **ConnectionException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Ldap\Exception\ExceptionInterface") ConnectionException is throw if binding to ldap can not be established. symfony DriverNotFoundException DriverNotFoundException ======================== class **DriverNotFoundException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Ldap\Exception\ExceptionInterface") LdapException is throw if php ldap module is not loaded. symfony LdapException LdapException ============== class **LdapException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Ldap\Exception\ExceptionInterface") LdapException is throw if php ldap module is not loaded. symfony NotBoundException NotBoundException ================== class **NotBoundException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Ldap\Exception\ExceptionInterface") NotBoundException is thrown if the connection with the LDAP server is not yet bound. symfony PropertyListExtractorInterface PropertyListExtractorInterface =============================== interface **PropertyListExtractorInterface** Extracts the list of properties available for the given class. Methods ------- | | | | | --- | --- | --- | | string[]|null | [getProperties](#method_getProperties)(string $class, array $context = array()) Gets the list of properties available for the given class. | | Details ------- ### string[]|null getProperties(string $class, array $context = array()) Gets the list of properties available for the given class. #### Parameters | | | | | --- | --- | --- | | string | $class | | | array | $context | | #### Return Value | | | | --- | --- | | string[]|null | | symfony Symfony\Component\PropertyInfo\Util Symfony\Component\PropertyInfo\Util =================================== Classes ------- | | | | --- | --- | | [PhpDocTypeHelper](util/phpdoctypehelper "Symfony\Component\PropertyInfo\Util\PhpDocTypeHelper") | Transforms a php doc type to a {@link Type} instance. | symfony Type Type ===== class **Type** Type value object (immutable). Constants --------- | | | | --- | --- | | BUILTIN\_TYPE\_INT | | | BUILTIN\_TYPE\_FLOAT | | | BUILTIN\_TYPE\_STRING | | | BUILTIN\_TYPE\_BOOL | | | BUILTIN\_TYPE\_RESOURCE | | | BUILTIN\_TYPE\_OBJECT | | | BUILTIN\_TYPE\_ARRAY | | | BUILTIN\_TYPE\_NULL | | | BUILTIN\_TYPE\_CALLABLE | | | BUILTIN\_TYPE\_ITERABLE | | Properties ---------- | | | | | | --- | --- | --- | --- | | static string[] | $builtinTypes | List of PHP builtin types. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $builtinType, bool $nullable = false, string $class = null, bool $collection = false, [Type](type "Symfony\Component\PropertyInfo\Type") $collectionKeyType = null, [Type](type "Symfony\Component\PropertyInfo\Type") $collectionValueType = null) | | | string | [getBuiltinType](#method_getBuiltinType)() Gets built-in type. | | | bool | [isNullable](#method_isNullable)() | | | string|null | [getClassName](#method_getClassName)() Gets the class name. | | | bool | [isCollection](#method_isCollection)() | | | [Type](type "Symfony\Component\PropertyInfo\Type")|null | [getCollectionKeyType](#method_getCollectionKeyType)() Gets collection key type. | | | [Type](type "Symfony\Component\PropertyInfo\Type")|null | [getCollectionValueType](#method_getCollectionValueType)() Gets collection value type. | | Details ------- ### \_\_construct(string $builtinType, bool $nullable = false, string $class = null, bool $collection = false, [Type](type "Symfony\Component\PropertyInfo\Type") $collectionKeyType = null, [Type](type "Symfony\Component\PropertyInfo\Type") $collectionValueType = null) #### Parameters | | | | | --- | --- | --- | | string | $builtinType | | | bool | $nullable | | | string | $class | | | bool | $collection | | | [Type](type "Symfony\Component\PropertyInfo\Type") | $collectionKeyType | | | [Type](type "Symfony\Component\PropertyInfo\Type") | $collectionValueType | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getBuiltinType() Gets built-in type. Can be bool, int, float, string, array, object, resource, null, callback or iterable. #### Return Value | | | | --- | --- | | string | | ### bool isNullable() #### Return Value | | | | --- | --- | | bool | | ### string|null getClassName() Gets the class name. Only applicable if the built-in type is object. #### Return Value | | | | --- | --- | | string|null | | ### bool isCollection() #### Return Value | | | | --- | --- | | bool | | ### [Type](type "Symfony\Component\PropertyInfo\Type")|null getCollectionKeyType() Gets collection key type. Only applicable for a collection type. #### Return Value | | | | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")|null | | ### [Type](type "Symfony\Component\PropertyInfo\Type")|null getCollectionValueType() Gets collection value type. Only applicable for a collection type. #### Return Value | | | | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")|null | |
programming_docs
symfony PropertyInfoExtractorInterface PropertyInfoExtractorInterface =============================== interface **PropertyInfoExtractorInterface** implements [PropertyTypeExtractorInterface](propertytypeextractorinterface "Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface"), [PropertyDescriptionExtractorInterface](propertydescriptionextractorinterface "Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface"), [PropertyAccessExtractorInterface](propertyaccessextractorinterface "Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface"), [PropertyListExtractorInterface](propertylistextractorinterface "Symfony\Component\PropertyInfo\PropertyListExtractorInterface") Gets info about PHP class properties. A convenient interface inheriting all specific info interfaces. Methods ------- | | | | | --- | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | [getTypes](#method_getTypes)(string $class, string $property, array $context = array()) Gets types of a property. | from [PropertyTypeExtractorInterface](propertytypeextractorinterface#method_getTypes "Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface") | | string|null | [getShortDescription](#method_getShortDescription)(string $class, string $property, array $context = array()) Gets the short description of the property. | from [PropertyDescriptionExtractorInterface](propertydescriptionextractorinterface#method_getShortDescription "Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface") | | string|null | [getLongDescription](#method_getLongDescription)(string $class, string $property, array $context = array()) Gets the long description of the property. | from [PropertyDescriptionExtractorInterface](propertydescriptionextractorinterface#method_getLongDescription "Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface") | | bool|null | [isReadable](#method_isReadable)(string $class, string $property, array $context = array()) Is the property readable? | from [PropertyAccessExtractorInterface](propertyaccessextractorinterface#method_isReadable "Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface") | | bool|null | [isWritable](#method_isWritable)(string $class, string $property, array $context = array()) Is the property writable? | from [PropertyAccessExtractorInterface](propertyaccessextractorinterface#method_isWritable "Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface") | | string[]|null | [getProperties](#method_getProperties)(string $class, array $context = array()) Gets the list of properties available for the given class. | from [PropertyListExtractorInterface](propertylistextractorinterface#method_getProperties "Symfony\Component\PropertyInfo\PropertyListExtractorInterface") | Details ------- ### [Type](type "Symfony\Component\PropertyInfo\Type")[]|null getTypes(string $class, string $property, array $context = array()) Gets types of a property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | | ### string|null getShortDescription(string $class, string $property, array $context = array()) Gets the short description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### string|null getLongDescription(string $class, string $property, array $context = array()) Gets the long description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### bool|null isWritable(string $class, string $property, array $context = array()) Is the property writable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### string[]|null getProperties(string $class, array $context = array()) Gets the list of properties available for the given class. #### Parameters | | | | | --- | --- | --- | | string | $class | | | array | $context | | #### Return Value | | | | --- | --- | | string[]|null | | symfony PropertyTypeExtractorInterface PropertyTypeExtractorInterface =============================== interface **PropertyTypeExtractorInterface** Type Extractor Interface. Methods ------- | | | | | --- | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | [getTypes](#method_getTypes)(string $class, string $property, array $context = array()) Gets types of a property. | | Details ------- ### [Type](type "Symfony\Component\PropertyInfo\Type")[]|null getTypes(string $class, string $property, array $context = array()) Gets types of a property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | | symfony PropertyInfoExtractor PropertyInfoExtractor ====================== class **PropertyInfoExtractor** implements [PropertyInfoExtractorInterface](propertyinfoextractorinterface "Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface") Default {see PropertyInfoExtractorInterface} implementation. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $listExtractors = array(), iterable $typeExtractors = array(), iterable $descriptionExtractors = array(), iterable $accessExtractors = array()) | | | string[]|null | [getProperties](#method_getProperties)(string $class, array $context = array()) Gets the list of properties available for the given class. | | | string|null | [getShortDescription](#method_getShortDescription)(string $class, string $property, array $context = array()) Gets the short description of the property. | | | string|null | [getLongDescription](#method_getLongDescription)(string $class, string $property, array $context = array()) Gets the long description of the property. | | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | [getTypes](#method_getTypes)(string $class, string $property, array $context = array()) Gets types of a property. | | | bool|null | [isReadable](#method_isReadable)(string $class, string $property, array $context = array()) Is the property readable? | | | bool|null | [isWritable](#method_isWritable)(string $class, string $property, array $context = array()) Is the property writable? | | Details ------- ### \_\_construct(iterable $listExtractors = array(), iterable $typeExtractors = array(), iterable $descriptionExtractors = array(), iterable $accessExtractors = array()) #### Parameters | | | | | --- | --- | --- | | iterable | $listExtractors | | | iterable | $typeExtractors | | | iterable | $descriptionExtractors | | | iterable | $accessExtractors | | ### string[]|null getProperties(string $class, array $context = array()) Gets the list of properties available for the given class. #### Parameters | | | | | --- | --- | --- | | string | $class | | | array | $context | | #### Return Value | | | | --- | --- | | string[]|null | | ### string|null getShortDescription(string $class, string $property, array $context = array()) Gets the short description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### string|null getLongDescription(string $class, string $property, array $context = array()) Gets the long description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### [Type](type "Symfony\Component\PropertyInfo\Type")[]|null getTypes(string $class, string $property, array $context = array()) Gets types of a property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | | ### bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### bool|null isWritable(string $class, string $property, array $context = array()) Is the property writable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | symfony PropertyAccessExtractorInterface PropertyAccessExtractorInterface ================================= interface **PropertyAccessExtractorInterface** Guesses if the property can be accessed or mutated. Methods ------- | | | | | --- | --- | --- | | bool|null | [isReadable](#method_isReadable)(string $class, string $property, array $context = array()) Is the property readable? | | | bool|null | [isWritable](#method_isWritable)(string $class, string $property, array $context = array()) Is the property writable? | | Details ------- ### bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### bool|null isWritable(string $class, string $property, array $context = array()) Is the property writable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | symfony PropertyInfoCacheExtractor PropertyInfoCacheExtractor =========================== class **PropertyInfoCacheExtractor** implements [PropertyInfoExtractorInterface](propertyinfoextractorinterface "Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface") Adds a PSR-6 cache layer on top of an extractor. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([PropertyInfoExtractorInterface](propertyinfoextractorinterface "Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface") $propertyInfoExtractor, CacheItemPoolInterface $cacheItemPool) | | | bool|null | [isReadable](#method_isReadable)(string $class, string $property, array $context = array()) Is the property readable? | | | bool|null | [isWritable](#method_isWritable)(string $class, string $property, array $context = array()) Is the property writable? | | | string|null | [getShortDescription](#method_getShortDescription)(string $class, string $property, array $context = array()) Gets the short description of the property. | | | string|null | [getLongDescription](#method_getLongDescription)(string $class, string $property, array $context = array()) Gets the long description of the property. | | | string[]|null | [getProperties](#method_getProperties)(string $class, array $context = array()) Gets the list of properties available for the given class. | | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | [getTypes](#method_getTypes)(string $class, string $property, array $context = array()) Gets types of a property. | | Details ------- ### \_\_construct([PropertyInfoExtractorInterface](propertyinfoextractorinterface "Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface") $propertyInfoExtractor, CacheItemPoolInterface $cacheItemPool) #### Parameters | | | | | --- | --- | --- | | [PropertyInfoExtractorInterface](propertyinfoextractorinterface "Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface") | $propertyInfoExtractor | | | CacheItemPoolInterface | $cacheItemPool | | ### bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### bool|null isWritable(string $class, string $property, array $context = array()) Is the property writable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### string|null getShortDescription(string $class, string $property, array $context = array()) Gets the short description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### string|null getLongDescription(string $class, string $property, array $context = array()) Gets the long description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### string[]|null getProperties(string $class, array $context = array()) Gets the list of properties available for the given class. #### Parameters | | | | | --- | --- | --- | | string | $class | | | array | $context | | #### Return Value | | | | --- | --- | | string[]|null | | ### [Type](type "Symfony\Component\PropertyInfo\Type")[]|null getTypes(string $class, string $property, array $context = array()) Gets types of a property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | [Type](type "Symfony\Component\PropertyInfo\Type")[]|null | | symfony Symfony\Component\PropertyInfo\DependencyInjection Symfony\Component\PropertyInfo\DependencyInjection ================================================== Classes ------- | | | | --- | --- | | [PropertyInfoPass](dependencyinjection/propertyinfopass "Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass") | Adds extractors to the property\_info service. | symfony PropertyDescriptionExtractorInterface PropertyDescriptionExtractorInterface ====================================== interface **PropertyDescriptionExtractorInterface** Guesses the property's human readable description. Methods ------- | | | | | --- | --- | --- | | string|null | [getShortDescription](#method_getShortDescription)(string $class, string $property, array $context = array()) Gets the short description of the property. | | | string|null | [getLongDescription](#method_getLongDescription)(string $class, string $property, array $context = array()) Gets the long description of the property. | | Details ------- ### string|null getShortDescription(string $class, string $property, array $context = array()) Gets the short description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### string|null getLongDescription(string $class, string $property, array $context = array()) Gets the long description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | symfony Symfony\Component\PropertyInfo\Extractor Symfony\Component\PropertyInfo\Extractor ======================================== Classes ------- | | | | --- | --- | | [PhpDocExtractor](extractor/phpdocextractor "Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor") | Extracts data using a PHPDoc parser. | | [ReflectionExtractor](extractor/reflectionextractor "Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor") | Extracts data using the reflection API. | | [SerializerExtractor](extractor/serializerextractor "Symfony\Component\PropertyInfo\Extractor\SerializerExtractor") | Lists available properties using Symfony Serializer Component metadata. | symfony PhpDocTypeHelper PhpDocTypeHelper ================= class **PhpDocTypeHelper** Transforms a php doc type to a {@link Type} instance. Methods ------- | | | | | --- | --- | --- | | array | [getTypes](#method_getTypes)(Type $varType) Creates a {see Type} from a PHPDoc type. | | Details ------- ### array getTypes(Type $varType) Creates a {see Type} from a PHPDoc type. #### Parameters | | | | | --- | --- | --- | | Type | $varType | | #### Return Value | | | | --- | --- | | array | | symfony ReflectionExtractor ReflectionExtractor ==================== class **ReflectionExtractor** implements [PropertyListExtractorInterface](../propertylistextractorinterface "Symfony\Component\PropertyInfo\PropertyListExtractorInterface"), [PropertyTypeExtractorInterface](../propertytypeextractorinterface "Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface"), [PropertyAccessExtractorInterface](../propertyaccessextractorinterface "Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface") Extracts data using the reflection API. Properties ---------- | | | | | | --- | --- | --- | --- | | static | $defaultMutatorPrefixes | | | | static | $defaultAccessorPrefixes | | | | static | $defaultArrayMutatorPrefixes | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null, bool $enableConstructorExtraction = true) | | | string[]|null | [getProperties](#method_getProperties)(string $class, array $context = array()) Gets the list of properties available for the given class. | | | [Type](../type "Symfony\Component\PropertyInfo\Type")[]|null | [getTypes](#method_getTypes)(string $class, string $property, array $context = array()) Gets types of a property. | | | bool|null | [isReadable](#method_isReadable)(string $class, string $property, array $context = array()) Is the property readable? | | | bool|null | [isWritable](#method_isWritable)(string $class, string $property, array $context = array()) Is the property writable? | | Details ------- ### \_\_construct(array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null, bool $enableConstructorExtraction = true) #### Parameters | | | | | --- | --- | --- | | array | $mutatorPrefixes | | | array | $accessorPrefixes | | | array | $arrayMutatorPrefixes | | | bool | $enableConstructorExtraction | | ### string[]|null getProperties(string $class, array $context = array()) Gets the list of properties available for the given class. #### Parameters | | | | | --- | --- | --- | | string | $class | | | array | $context | | #### Return Value | | | | --- | --- | | string[]|null | | ### [Type](../type "Symfony\Component\PropertyInfo\Type")[]|null getTypes(string $class, string $property, array $context = array()) Gets types of a property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | [Type](../type "Symfony\Component\PropertyInfo\Type")[]|null | | ### bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | | ### bool|null isWritable(string $class, string $property, array $context = array()) Is the property writable? #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | bool|null | |
programming_docs
symfony PhpDocExtractor PhpDocExtractor ================ class **PhpDocExtractor** implements [PropertyDescriptionExtractorInterface](../propertydescriptionextractorinterface "Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface"), [PropertyTypeExtractorInterface](../propertytypeextractorinterface "Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface") Extracts data using a PHPDoc parser. Constants --------- | | | | --- | --- | | PROPERTY | | | ACCESSOR | | | MUTATOR | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null) | | | string|null | [getShortDescription](#method_getShortDescription)(string $class, string $property, array $context = array()) Gets the short description of the property. | | | string|null | [getLongDescription](#method_getLongDescription)(string $class, string $property, array $context = array()) Gets the long description of the property. | | | [Type](../type "Symfony\Component\PropertyInfo\Type")[]|null | [getTypes](#method_getTypes)(string $class, string $property, array $context = array()) Gets types of a property. | | Details ------- ### \_\_construct(DocBlockFactoryInterface $docBlockFactory = null, array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null) #### Parameters | | | | | --- | --- | --- | | DocBlockFactoryInterface | $docBlockFactory | | | array | $mutatorPrefixes | | | array | $accessorPrefixes | | | array | $arrayMutatorPrefixes | | ### string|null getShortDescription(string $class, string $property, array $context = array()) Gets the short description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### string|null getLongDescription(string $class, string $property, array $context = array()) Gets the long description of the property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | string|null | | ### [Type](../type "Symfony\Component\PropertyInfo\Type")[]|null getTypes(string $class, string $property, array $context = array()) Gets types of a property. #### Parameters | | | | | --- | --- | --- | | string | $class | | | string | $property | | | array | $context | | #### Return Value | | | | --- | --- | | [Type](../type "Symfony\Component\PropertyInfo\Type")[]|null | | symfony SerializerExtractor SerializerExtractor ==================== class **SerializerExtractor** implements [PropertyListExtractorInterface](../propertylistextractorinterface "Symfony\Component\PropertyInfo\PropertyListExtractorInterface") Lists available properties using Symfony Serializer Component metadata. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ClassMetadataFactoryInterface](../../serializer/mapping/factory/classmetadatafactoryinterface "Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface") $classMetadataFactory) | | | string[]|null | [getProperties](#method_getProperties)(string $class, array $context = array()) Gets the list of properties available for the given class. | | Details ------- ### \_\_construct([ClassMetadataFactoryInterface](../../serializer/mapping/factory/classmetadatafactoryinterface "Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface") $classMetadataFactory) #### Parameters | | | | | --- | --- | --- | | [ClassMetadataFactoryInterface](../../serializer/mapping/factory/classmetadatafactoryinterface "Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface") | $classMetadataFactory | | ### string[]|null getProperties(string $class, array $context = array()) Gets the list of properties available for the given class. #### Parameters | | | | | --- | --- | --- | | string | $class | | | array | $context | | #### Return Value | | | | --- | --- | | string[]|null | | symfony PropertyInfoPass PropertyInfoPass ================= class **PropertyInfoPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Adds extractors to the property\_info service. Traits ------ | | | | --- | --- | | [PriorityTaggedServiceTrait](../../dependencyinjection/compiler/prioritytaggedservicetrait "Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait") | Trait that allows a generic method to find and sort service by priority option in the tag. | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $propertyInfoService = 'property\_info', string $listExtractorTag = 'property\_info.list\_extractor', string $typeExtractorTag = 'property\_info.type\_extractor', string $descriptionExtractorTag = 'property\_info.description\_extractor', string $accessExtractorTag = 'property\_info.access\_extractor') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $propertyInfoService = 'property\_info', string $listExtractorTag = 'property\_info.list\_extractor', string $typeExtractorTag = 'property\_info.type\_extractor', string $descriptionExtractorTag = 'property\_info.description\_extractor', string $accessExtractorTag = 'property\_info.access\_extractor') #### Parameters | | | | | --- | --- | --- | | string | $propertyInfoService | | | string | $listExtractorTag | | | string | $typeExtractorTag | | | string | $descriptionExtractorTag | | | string | $accessExtractorTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony EventSubscriberInterface EventSubscriberInterface ========================= interface **EventSubscriberInterface** An EventSubscriber knows himself what events he is interested in. If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes {@link getSubscribedEvents} and registers the subscriber as a listener for all returned events. Methods ------- | | | | | --- | --- | --- | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | Details ------- ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | symfony EventDispatcher EventDispatcher ================ class **EventDispatcher** implements [EventDispatcherInterface](eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") The EventDispatcherInterface is the central point of Symfony's event listener system. Listeners are registered on the manager and events are dispatched through the manager. Methods ------- | | | | | --- | --- | --- | | [Event](event "Symfony\Component\EventDispatcher\Event") | [dispatch](#method_dispatch)(string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. | | | array | [getListeners](#method_getListeners)(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. | | | int|null | [getListenerPriority](#method_getListenerPriority)(string $eventName, callable $listener) Gets the listener priority for a specific event. | | | bool | [hasListeners](#method_hasListeners)(string $eventName = null) Checks whether an event has any registered listeners. | | | | [addListener](#method_addListener)(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. | | | | [removeListener](#method_removeListener)(string $eventName, callable $listener) Removes an event listener from the specified events. | | | | [addSubscriber](#method_addSubscriber)([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. | | | | [removeSubscriber](#method_removeSubscriber)([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) | | | | [doDispatch](#method_doDispatch)(callable[] $listeners, string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event) Triggers the listeners of an event. | | Details ------- ### [Event](event "Symfony\Component\EventDispatcher\Event") dispatch(string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. | | [Event](event "Symfony\Component\EventDispatcher\Event") | $event | The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created | #### Return Value | | | | --- | --- | | [Event](event "Symfony\Component\EventDispatcher\Event") | | ### array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | array | The event listeners for the specified event, or all event listeners by event name | ### int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | | callable | $listener | The listener | #### Return Value | | | | --- | --- | | int|null | The event listener priority | ### bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | bool | true if the specified event has any listeners, false otherwise | ### addListener(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to listen on | | callable | $listener | The listener | | int | $priority | The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) | ### removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to remove a listener from | | callable | $listener | The listener to remove | ### addSubscriber([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events. #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### removeSubscriber([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### protected doDispatch(callable[] $listeners, string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event) Triggers the listeners of an event. This method can be overridden to add functionality that is executed for each listener. #### Parameters | | | | | --- | --- | --- | | callable[] | $listeners | The event listeners | | string | $eventName | The name of the event to dispatch | | [Event](event "Symfony\Component\EventDispatcher\Event") | $event | The event object to pass to the event handlers/listeners | symfony ImmutableEventDispatcher ImmutableEventDispatcher ========================= class **ImmutableEventDispatcher** implements [EventDispatcherInterface](eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") A read-only proxy for an event dispatcher. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([EventDispatcherInterface](eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) | | | [Event](event "Symfony\Component\EventDispatcher\Event") | [dispatch](#method_dispatch)(string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. | | | | [addListener](#method_addListener)(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. | | | | [addSubscriber](#method_addSubscriber)([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. | | | | [removeListener](#method_removeListener)(string $eventName, callable $listener) Removes an event listener from the specified events. | | | | [removeSubscriber](#method_removeSubscriber)([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) | | | array | [getListeners](#method_getListeners)(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. | | | int|null | [getListenerPriority](#method_getListenerPriority)(string $eventName, callable $listener) Gets the listener priority for a specific event. | | | bool | [hasListeners](#method_hasListeners)(string $eventName = null) Checks whether an event has any registered listeners. | | Details ------- ### \_\_construct([EventDispatcherInterface](eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) #### Parameters | | | | | --- | --- | --- | | [EventDispatcherInterface](eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### [Event](event "Symfony\Component\EventDispatcher\Event") dispatch(string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. | | [Event](event "Symfony\Component\EventDispatcher\Event") | $event | The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created | #### Return Value | | | | --- | --- | | [Event](event "Symfony\Component\EventDispatcher\Event") | | ### addListener(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to listen on | | callable | $listener | The listener | | int | $priority | The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) | ### addSubscriber([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events. #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to remove a listener from | | callable | $listener | The listener to remove | ### removeSubscriber([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | array | The event listeners for the specified event, or all event listeners by event name | ### int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | | callable | $listener | The listener | #### Return Value | | | | --- | --- | | int|null | The event listener priority | ### bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | bool | true if the specified event has any listeners, false otherwise | symfony GenericEvent GenericEvent ============= class **GenericEvent** extends [Event](event "Symfony\Component\EventDispatcher\Event") implements [ArrayAccess](http://php.net/ArrayAccess), [IteratorAggregate](http://php.net/IteratorAggregate) Event encapsulation class. Encapsulates events thus decoupling the observer from the subject they encapsulate. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $subject | | | | protected | $arguments | | | Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)(mixed $subject = null, array $arguments = array()) Encapsulate an event with $subject and $args. | | | mixed | [getSubject](#method_getSubject)() Getter for subject property. | | | mixed | [getArgument](#method_getArgument)(string $key) Get argument by key. | | | $this | [setArgument](#method_setArgument)(string $key, mixed $value) Add argument to event. | | | array | [getArguments](#method_getArguments)() Getter for all arguments. | | | $this | [setArguments](#method_setArguments)(array $args = array()) Set args property. | | | bool | [hasArgument](#method_hasArgument)(string $key) Has argument. | | | mixed | [offsetGet](#method_offsetGet)(string $key) ArrayAccess for argument getter. | | | | [offsetSet](#method_offsetSet)(string $key, mixed $value) ArrayAccess for argument setter. | | | | [offsetUnset](#method_offsetUnset)(string $key) ArrayAccess for unset argument. | | | bool | [offsetExists](#method_offsetExists)(string $key) ArrayAccess has argument. | | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() IteratorAggregate for iterating over the object like an array. | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct(mixed $subject = null, array $arguments = array()) Encapsulate an event with $subject and $args. #### Parameters | | | | | --- | --- | --- | | mixed | $subject | The subject of the event, usually an object or a callable | | array | $arguments | Arguments to store in the event | ### mixed getSubject() Getter for subject property. #### Return Value | | | | --- | --- | | mixed | $subject The observer subject | ### mixed getArgument(string $key) Get argument by key. #### Parameters | | | | | --- | --- | --- | | string | $key | Key | #### Return Value | | | | --- | --- | | mixed | Contents of array key | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if key is not found | ### $this setArgument(string $key, mixed $value) Add argument to event. #### Parameters | | | | | --- | --- | --- | | string | $key | Argument name | | mixed | $value | Value | #### Return Value | | | | --- | --- | | $this | | ### array getArguments() Getter for all arguments. #### Return Value | | | | --- | --- | | array | | ### $this setArguments(array $args = array()) Set args property. #### Parameters | | | | | --- | --- | --- | | array | $args | Arguments | #### Return Value | | | | --- | --- | | $this | | ### bool hasArgument(string $key) Has argument. #### Parameters | | | | | --- | --- | --- | | string | $key | Key of arguments array | #### Return Value | | | | --- | --- | | bool | | ### mixed offsetGet(string $key) ArrayAccess for argument getter. #### Parameters | | | | | --- | --- | --- | | string | $key | Array key | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if key does not exist in $this->args | ### offsetSet(string $key, mixed $value) ArrayAccess for argument setter. #### Parameters | | | | | --- | --- | --- | | string | $key | Array key to set | | mixed | $value | Value | ### offsetUnset(string $key) ArrayAccess for unset argument. #### Parameters | | | | | --- | --- | --- | | string | $key | Array key | ### bool offsetExists(string $key) ArrayAccess has argument. #### Parameters | | | | | --- | --- | --- | | string | $key | Array key | #### Return Value | | | | --- | --- | | bool | | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() IteratorAggregate for iterating over the object like an array. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | |
programming_docs
symfony EventDispatcherInterface EventDispatcherInterface ========================= interface **EventDispatcherInterface** The EventDispatcherInterface is the central point of Symfony's event listener system. Listeners are registered on the manager and events are dispatched through the manager. Methods ------- | | | | | --- | --- | --- | | [Event](event "Symfony\Component\EventDispatcher\Event") | [dispatch](#method_dispatch)(string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. | | | | [addListener](#method_addListener)(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. | | | | [addSubscriber](#method_addSubscriber)([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. | | | | [removeListener](#method_removeListener)(string $eventName, callable $listener) Removes an event listener from the specified events. | | | | [removeSubscriber](#method_removeSubscriber)([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) | | | array | [getListeners](#method_getListeners)(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. | | | int|null | [getListenerPriority](#method_getListenerPriority)(string $eventName, callable $listener) Gets the listener priority for a specific event. | | | bool | [hasListeners](#method_hasListeners)(string $eventName = null) Checks whether an event has any registered listeners. | | Details ------- ### [Event](event "Symfony\Component\EventDispatcher\Event") dispatch(string $eventName, [Event](event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. | | [Event](event "Symfony\Component\EventDispatcher\Event") | $event | The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created | #### Return Value | | | | --- | --- | | [Event](event "Symfony\Component\EventDispatcher\Event") | | ### addListener(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to listen on | | callable | $listener | The listener | | int | $priority | The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) | ### addSubscriber([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events. #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to remove a listener from | | callable | $listener | The listener to remove | ### removeSubscriber([EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | array | The event listeners for the specified event, or all event listeners by event name | ### int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | | callable | $listener | The listener | #### Return Value | | | | --- | --- | | int|null | The event listener priority | ### bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | bool | true if the specified event has any listeners, false otherwise | symfony Event Event ====== class **Event** Event is the base class for classes containing event data. This class contains no event data. It is used by events that do not pass state information to an event handler when an event is raised. You can call the method stopPropagation() to abort the execution of further listeners in your event listener. Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). symfony Symfony\Component\EventDispatcher\DependencyInjection Symfony\Component\EventDispatcher\DependencyInjection ===================================================== Classes ------- | | | | --- | --- | | [ExtractingEventDispatcher](dependencyinjection/extractingeventdispatcher "Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher") | | | [RegisterListenersPass](dependencyinjection/registerlistenerspass "Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass") | Compiler pass to register tagged services for an event dispatcher. | symfony Symfony\Component\EventDispatcher\Debug Symfony\Component\EventDispatcher\Debug ======================================= Classes ------- | | | | --- | --- | | [TraceableEventDispatcher](debug/traceableeventdispatcher "Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher") | Collects some data about event listeners. | | [WrappedListener](debug/wrappedlistener "Symfony\Component\EventDispatcher\Debug\WrappedListener") | | Interfaces ---------- | | | | --- | --- | | *[TraceableEventDispatcherInterface](debug/traceableeventdispatcherinterface "Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface")* deprecated | | symfony ExtractingEventDispatcher ExtractingEventDispatcher ========================== class **ExtractingEventDispatcher** extends [EventDispatcher](../eventdispatcher "Symfony\Component\EventDispatcher\EventDispatcher") implements [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | | $listeners | | | | static | $subscriber | | | Methods ------- | | | | | --- | --- | --- | | [Event](../event "Symfony\Component\EventDispatcher\Event") | [dispatch](#method_dispatch)(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. | from [EventDispatcher](../eventdispatcher#method_dispatch "Symfony\Component\EventDispatcher\EventDispatcher") | | array | [getListeners](#method_getListeners)(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. | from [EventDispatcher](../eventdispatcher#method_getListeners "Symfony\Component\EventDispatcher\EventDispatcher") | | int|null | [getListenerPriority](#method_getListenerPriority)(string $eventName, callable $listener) Gets the listener priority for a specific event. | from [EventDispatcher](../eventdispatcher#method_getListenerPriority "Symfony\Component\EventDispatcher\EventDispatcher") | | bool | [hasListeners](#method_hasListeners)(string $eventName = null) Checks whether an event has any registered listeners. | from [EventDispatcher](../eventdispatcher#method_hasListeners "Symfony\Component\EventDispatcher\EventDispatcher") | | | [addListener](#method_addListener)(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. | | | | [removeListener](#method_removeListener)(string $eventName, callable $listener) Removes an event listener from the specified events. | from [EventDispatcher](../eventdispatcher#method_removeListener "Symfony\Component\EventDispatcher\EventDispatcher") | | | [addSubscriber](#method_addSubscriber)([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. | from [EventDispatcher](../eventdispatcher#method_addSubscriber "Symfony\Component\EventDispatcher\EventDispatcher") | | | [removeSubscriber](#method_removeSubscriber)([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) | from [EventDispatcher](../eventdispatcher#method_removeSubscriber "Symfony\Component\EventDispatcher\EventDispatcher") | | | [doDispatch](#method_doDispatch)(callable[] $listeners, string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event) Triggers the listeners of an event. | from [EventDispatcher](../eventdispatcher#method_doDispatch "Symfony\Component\EventDispatcher\EventDispatcher") | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | Details ------- ### [Event](../event "Symfony\Component\EventDispatcher\Event") dispatch(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created | #### Return Value | | | | --- | --- | | [Event](../event "Symfony\Component\EventDispatcher\Event") | | ### array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | array | The event listeners for the specified event, or all event listeners by event name | ### int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | | callable | $listener | The listener | #### Return Value | | | | --- | --- | | int|null | The event listener priority | ### bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | bool | true if the specified event has any listeners, false otherwise | ### addListener(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to listen on | | callable | $listener | The listener | | int | $priority | The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) | ### removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to remove a listener from | | callable | $listener | The listener to remove | ### addSubscriber([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events. #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### removeSubscriber([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### protected doDispatch(callable[] $listeners, string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event) Triggers the listeners of an event. This method can be overridden to add functionality that is executed for each listener. #### Parameters | | | | | --- | --- | --- | | callable[] | $listeners | The event listeners | | string | $eventName | The name of the event to dispatch | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | The event object to pass to the event handlers/listeners | ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | symfony RegisterListenersPass RegisterListenersPass ====================== class **RegisterListenersPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Compiler pass to register tagged services for an event dispatcher. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $dispatcherService | | | | protected | $listenerTag | | | | protected | $subscriberTag | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $dispatcherService = 'event\_dispatcher', string $listenerTag = 'kernel.event\_listener', string $subscriberTag = 'kernel.event\_subscriber') | | | | [setHotPathEvents](#method_setHotPathEvents)(array $hotPathEvents, $tagName = 'container.hot\_path') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $dispatcherService = 'event\_dispatcher', string $listenerTag = 'kernel.event\_listener', string $subscriberTag = 'kernel.event\_subscriber') #### Parameters | | | | | --- | --- | --- | | string | $dispatcherService | | | string | $listenerTag | | | string | $subscriberTag | | ### setHotPathEvents(array $hotPathEvents, $tagName = 'container.hot\_path') #### Parameters | | | | | --- | --- | --- | | array | $hotPathEvents | | | | $tagName | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony TraceableEventDispatcherInterface deprecated TraceableEventDispatcherInterface deprecated ============================================= interface **TraceableEventDispatcherInterface** implements [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") deprecated | since | Symfony 4.1 | Methods ------- | | | | | --- | --- | --- | | [Event](../event "Symfony\Component\EventDispatcher\Event") | [dispatch](#method_dispatch)(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. | from [EventDispatcherInterface](../eventdispatcherinterface#method_dispatch "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | | [addListener](#method_addListener)(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. | from [EventDispatcherInterface](../eventdispatcherinterface#method_addListener "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | | [addSubscriber](#method_addSubscriber)([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. | from [EventDispatcherInterface](../eventdispatcherinterface#method_addSubscriber "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | | [removeListener](#method_removeListener)(string $eventName, callable $listener) Removes an event listener from the specified events. | from [EventDispatcherInterface](../eventdispatcherinterface#method_removeListener "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | | [removeSubscriber](#method_removeSubscriber)([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) | from [EventDispatcherInterface](../eventdispatcherinterface#method_removeSubscriber "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | array | [getListeners](#method_getListeners)(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. | from [EventDispatcherInterface](../eventdispatcherinterface#method_getListeners "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | int|null | [getListenerPriority](#method_getListenerPriority)(string $eventName, callable $listener) Gets the listener priority for a specific event. | from [EventDispatcherInterface](../eventdispatcherinterface#method_getListenerPriority "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | bool | [hasListeners](#method_hasListeners)(string $eventName = null) Checks whether an event has any registered listeners. | from [EventDispatcherInterface](../eventdispatcherinterface#method_hasListeners "Symfony\Component\EventDispatcher\EventDispatcherInterface") | | array | [getCalledListeners](#method_getCalledListeners)() Gets the called listeners. | | | array | [getNotCalledListeners](#method_getNotCalledListeners)() Gets the not called listeners. | | | | [reset](#method_reset)() Resets the trace. | | Details ------- ### [Event](../event "Symfony\Component\EventDispatcher\Event") dispatch(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created | #### Return Value | | | | --- | --- | | [Event](../event "Symfony\Component\EventDispatcher\Event") | | ### addListener(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to listen on | | callable | $listener | The listener | | int | $priority | The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) | ### addSubscriber([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events. #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to remove a listener from | | callable | $listener | The listener to remove | ### removeSubscriber([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | array | The event listeners for the specified event, or all event listeners by event name | ### int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | | callable | $listener | The listener | #### Return Value | | | | --- | --- | | int|null | The event listener priority | ### bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | bool | true if the specified event has any listeners, false otherwise | ### array getCalledListeners() Gets the called listeners. #### Return Value | | | | --- | --- | | array | An array of called listeners | ### array getNotCalledListeners() Gets the not called listeners. #### Return Value | | | | --- | --- | | array | An array of not called listeners | ### reset() Resets the trace.
programming_docs
symfony TraceableEventDispatcher TraceableEventDispatcher ========================= class **TraceableEventDispatcher** implements [TraceableEventDispatcherInterface](traceableeventdispatcherinterface "Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface") Collects some data about event listeners. This event dispatcher delegates the dispatching to another one. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $logger | | | | protected | $stopwatch | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher, [Stopwatch](../../stopwatch/stopwatch "Symfony\Component\Stopwatch\Stopwatch") $stopwatch, LoggerInterface $logger = null) | | | | [addListener](#method_addListener)(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. | | | | [addSubscriber](#method_addSubscriber)([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. | | | | [removeListener](#method_removeListener)(string $eventName, callable $listener) Removes an event listener from the specified events. | | | | [removeSubscriber](#method_removeSubscriber)([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) | | | array | [getListeners](#method_getListeners)(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. | | | int|null | [getListenerPriority](#method_getListenerPriority)(string $eventName, callable $listener) Gets the listener priority for a specific event. | | | bool | [hasListeners](#method_hasListeners)(string $eventName = null) Checks whether an event has any registered listeners. | | | [Event](../event "Symfony\Component\EventDispatcher\Event") | [dispatch](#method_dispatch)(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. | | | array | [getCalledListeners](#method_getCalledListeners)() Gets the called listeners. | | | array | [getNotCalledListeners](#method_getNotCalledListeners)() Gets the not called listeners. | | | array | [getOrphanedEvents](#method_getOrphanedEvents)() | | | | [reset](#method_reset)() Resets the trace. | | | mixed | [\_\_call](#method___call)(string $method, array $arguments) Proxies all method calls to the original event dispatcher. | | | | [preDispatch](#method_preDispatch)(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event) Called before dispatching the event. | | | | [postDispatch](#method_postDispatch)(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event) Called after dispatching the event. | | Details ------- ### \_\_construct([EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher, [Stopwatch](../../stopwatch/stopwatch "Symfony\Component\Stopwatch\Stopwatch") $stopwatch, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | [Stopwatch](../../stopwatch/stopwatch "Symfony\Component\Stopwatch\Stopwatch") | $stopwatch | | | LoggerInterface | $logger | | ### addListener(string $eventName, callable $listener, int $priority = 0) Adds an event listener that listens on the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to listen on | | callable | $listener | The listener | | int | $priority | The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) | ### addSubscriber([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) Adds an event subscriber. The subscriber is asked for all the events he is interested in and added as a listener for these events. #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### removeListener(string $eventName, callable $listener) Removes an event listener from the specified events. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event to remove a listener from | | callable | $listener | The listener to remove | ### removeSubscriber([EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") $subscriber) #### Parameters | | | | | --- | --- | --- | | [EventSubscriberInterface](../eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") | $subscriber | | ### array getListeners(string $eventName = null) Gets the listeners of a specific event or all listeners sorted by descending priority. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | array | The event listeners for the specified event, or all event listeners by event name | ### int|null getListenerPriority(string $eventName, callable $listener) Gets the listener priority for a specific event. Returns null if the event or the listener does not exist. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | | callable | $listener | The listener | #### Return Value | | | | --- | --- | | int|null | The event listener priority | ### bool hasListeners(string $eventName = null) Checks whether an event has any registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event | #### Return Value | | | | --- | --- | | bool | true if the specified event has any listeners, false otherwise | ### [Event](../event "Symfony\Component\EventDispatcher\Event") dispatch(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event = null) Dispatches an event to all registered listeners. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | The event to pass to the event handlers/listeners If not supplied, an empty Event instance is created | #### Return Value | | | | --- | --- | | [Event](../event "Symfony\Component\EventDispatcher\Event") | | ### array getCalledListeners() Gets the called listeners. #### Return Value | | | | --- | --- | | array | An array of called listeners | ### array getNotCalledListeners() Gets the not called listeners. #### Return Value | | | | --- | --- | | array | An array of not called listeners | ### array getOrphanedEvents() #### Return Value | | | | --- | --- | | array | | ### reset() Resets the trace. ### mixed \_\_call(string $method, array $arguments) Proxies all method calls to the original event dispatcher. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name | | array | $arguments | The method arguments | #### Return Value | | | | --- | --- | | mixed | | ### protected preDispatch(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event) Called before dispatching the event. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event name | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | The event | ### protected postDispatch(string $eventName, [Event](../event "Symfony\Component\EventDispatcher\Event") $event) Called after dispatching the event. #### Parameters | | | | | --- | --- | --- | | string | $eventName | The event name | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | The event | symfony WrappedListener WrappedListener ================ class **WrappedListener** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($listener, $name, [Stopwatch](../../stopwatch/stopwatch "Symfony\Component\Stopwatch\Stopwatch") $stopwatch, [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) | | | | [getWrappedListener](#method_getWrappedListener)() | | | | [wasCalled](#method_wasCalled)() | | | | [stoppedPropagation](#method_stoppedPropagation)() | | | | [getPretty](#method_getPretty)() | | | | [getInfo](#method_getInfo)($eventName) | | | | [\_\_invoke](#method___invoke)([Event](../event "Symfony\Component\EventDispatcher\Event") $event, $eventName, [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) | | Details ------- ### \_\_construct($listener, $name, [Stopwatch](../../stopwatch/stopwatch "Symfony\Component\Stopwatch\Stopwatch") $stopwatch, [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null) #### Parameters | | | | | --- | --- | --- | | | $listener | | | | $name | | | [Stopwatch](../../stopwatch/stopwatch "Symfony\Component\Stopwatch\Stopwatch") | $stopwatch | | | [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### getWrappedListener() ### wasCalled() ### stoppedPropagation() ### getPretty() ### getInfo($eventName) #### Parameters | | | | | --- | --- | --- | | | $eventName | | ### \_\_invoke([Event](../event "Symfony\Component\EventDispatcher\Event") $event, $eventName, [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) #### Parameters | | | | | --- | --- | --- | | [Event](../event "Symfony\Component\EventDispatcher\Event") | $event | | | | $eventName | | | [EventDispatcherInterface](../eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | symfony Inflector Inflector ========== class **Inflector** Converts words between singular and plural forms. Methods ------- | | | | | --- | --- | --- | | static string|array | [singularize](#method_singularize)(string $plural) Returns the singular form of a word. | | Details ------- ### static string|array singularize(string $plural) Returns the singular form of a word. If the method can't determine the form with certainty, an array of the possible singulars is returned. #### Parameters | | | | | --- | --- | --- | | string | $plural | A word in plural form | #### Return Value | | | | --- | --- | | string|array | The singular form or an array of possible singular forms | symfony Symfony\Component\Lock\Strategy Symfony\Component\Lock\Strategy =============================== Classes ------- | | | | --- | --- | | [ConsensusStrategy](strategy/consensusstrategy "Symfony\Component\Lock\Strategy\ConsensusStrategy") | ConsensusStrategy is a StrategyInterface implementation where strictly more than 50% items should be successful. | | [UnanimousStrategy](strategy/unanimousstrategy "Symfony\Component\Lock\Strategy\UnanimousStrategy") | UnanimousStrategy is a StrategyInterface implementation where 100% of elements should be successful. | Interfaces ---------- | | | | --- | --- | | *[StrategyInterface](strategy/strategyinterface "Symfony\Component\Lock\Strategy\StrategyInterface")* | StrategyInterface defines an interface to indicate when a quorum is met and can be met. | symfony Symfony\Component\Lock\Exception Symfony\Component\Lock\Exception ================================ Classes ------- | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Lock\Exception\InvalidArgumentException") | | | [LockAcquiringException](exception/lockacquiringexception "Symfony\Component\Lock\Exception\LockAcquiringException") | LockAcquiringException is thrown when an issue happens during the acquisition of a lock. | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | LockConflictedException is thrown when a lock is acquired by someone else. | | [LockExpiredException](exception/lockexpiredexception "Symfony\Component\Lock\Exception\LockExpiredException") | LockExpiredException is thrown when a lock may conflict due to a TTL expiration. | | [LockReleasingException](exception/lockreleasingexception "Symfony\Component\Lock\Exception\LockReleasingException") | LockReleasingException is thrown when an issue happens during the release of a lock. | | [LockStorageException](exception/lockstorageexception "Symfony\Component\Lock\Exception\LockStorageException") | LockStorageException is thrown when an issue happens during the manipulation of a lock in a store. | | [NotSupportedException](exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | NotSupportedException is thrown when an unsupported method is called. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface")* | Base ExceptionInterface for the Lock Component. | symfony StoreInterface StoreInterface =============== interface **StoreInterface** StoreInterface defines an interface to manipulate a lock store. Methods ------- | | | | | --- | --- | --- | | | [save](#method_save)([Key](key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [putOffExpiration](#method_putOffExpiration)([Key](key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | | [delete](#method_delete)([Key](key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | bool | [exists](#method_exists)([Key](key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### save([Key](key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### putOffExpiration([Key](key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](key "Symfony\Component\Lock\Key") | $key | | ### bool exists([Key](key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | | symfony LockInterface LockInterface ============== interface **LockInterface** LockInterface defines an interface to manipulate the status of a lock. Methods ------- | | | | | --- | --- | --- | | bool | [acquire](#method_acquire)(bool $blocking = false) Acquires the lock. If the lock is acquired by someone else, the parameter `blocking` determines whether or not the call should block until the release of the lock. | | | | [refresh](#method_refresh)() Increase the duration of an acquired lock. | | | bool | [isAcquired](#method_isAcquired)() Returns whether or not the lock is acquired. | | | | [release](#method_release)() Release the lock. | | | bool | [isExpired](#method_isExpired)() | | | float|null | [getRemainingLifetime](#method_getRemainingLifetime)() Returns the remaining lifetime. | | Details ------- ### bool acquire(bool $blocking = false) Acquires the lock. If the lock is acquired by someone else, the parameter `blocking` determines whether or not the call should block until the release of the lock. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether or not the Lock should wait for the release of someone else | #### Return Value | | | | --- | --- | | bool | whether or not the lock had been acquired | #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | If the lock is acquired by someone else in blocking mode | | [LockAcquiringException](exception/lockacquiringexception "Symfony\Component\Lock\Exception\LockAcquiringException") | If the lock can not be acquired | ### refresh() Increase the duration of an acquired lock. #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | If the lock is acquired by someone else | | [LockAcquiringException](exception/lockacquiringexception "Symfony\Component\Lock\Exception\LockAcquiringException") | If the lock can not be refreshed | ### bool isAcquired() Returns whether or not the lock is acquired. #### Return Value | | | | --- | --- | | bool | | ### release() Release the lock. #### Exceptions | | | | --- | --- | | [LockReleasingException](exception/lockreleasingexception "Symfony\Component\Lock\Exception\LockReleasingException") | If the lock can not be released | ### bool isExpired() #### Return Value | | | | --- | --- | | bool | | ### float|null getRemainingLifetime() Returns the remaining lifetime. #### Return Value | | | | --- | --- | | float|null | Remaining lifetime in seconds. Null when the lock won't expire. | symfony Factory Factory ======== class **Factory** implements LoggerAwareInterface Factory provides method to create locks. Traits ------ | | | | --- | --- | | LoggerAwareTrait | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([StoreInterface](storeinterface "Symfony\Component\Lock\StoreInterface") $store) | | | [Lock](lock "Symfony\Component\Lock\Lock") | [createLock](#method_createLock)(string $resource, float|null $ttl = 300.0, bool $autoRelease = true) Creates a lock for the given resource. | | Details ------- ### \_\_construct([StoreInterface](storeinterface "Symfony\Component\Lock\StoreInterface") $store) #### Parameters | | | | | --- | --- | --- | | [StoreInterface](storeinterface "Symfony\Component\Lock\StoreInterface") | $store | | ### [Lock](lock "Symfony\Component\Lock\Lock") createLock(string $resource, float|null $ttl = 300.0, bool $autoRelease = true) Creates a lock for the given resource. #### Parameters | | | | | --- | --- | --- | | string | $resource | The resource to lock | | float|null | $ttl | Maximum expected lock duration in seconds | | bool | $autoRelease | Whether to automatically release the lock or not when the lock instance is destroyed | #### Return Value | | | | --- | --- | | [Lock](lock "Symfony\Component\Lock\Lock") | |
programming_docs
symfony Key Key ==== class **Key** Key is a container for the state of the locks in stores. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resource) | | | | [\_\_toString](#method___toString)() | | | bool | [hasState](#method_hasState)(string $stateKey) | | | void | [setState](#method_setState)(string $stateKey, $state) | | | void | [removeState](#method_removeState)(string $stateKey) | | | | [getState](#method_getState)(string $stateKey) | | | | [resetLifetime](#method_resetLifetime)() | | | | [reduceLifetime](#method_reduceLifetime)(float $ttl) | | | float|null | [getRemainingLifetime](#method_getRemainingLifetime)() Returns the remaining lifetime. | | | bool | [isExpired](#method_isExpired)() | | Details ------- ### \_\_construct(string $resource) #### Parameters | | | | | --- | --- | --- | | string | $resource | | ### \_\_toString() ### bool hasState(string $stateKey) #### Parameters | | | | | --- | --- | --- | | string | $stateKey | | #### Return Value | | | | --- | --- | | bool | | ### void setState(string $stateKey, $state) #### Parameters | | | | | --- | --- | --- | | string | $stateKey | | | | $state | | #### Return Value | | | | --- | --- | | void | | ### void removeState(string $stateKey) #### Parameters | | | | | --- | --- | --- | | string | $stateKey | | #### Return Value | | | | --- | --- | | void | | ### getState(string $stateKey) #### Parameters | | | | | --- | --- | --- | | string | $stateKey | | ### resetLifetime() ### reduceLifetime(float $ttl) #### Parameters | | | | | --- | --- | --- | | float | $ttl | the expiration delay of locks in seconds | ### float|null getRemainingLifetime() Returns the remaining lifetime. #### Return Value | | | | --- | --- | | float|null | Remaining lifetime in seconds. Null when the key won't expire. | ### bool isExpired() #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\Lock\Store Symfony\Component\Lock\Store ============================ Classes ------- | | | | --- | --- | | [CombinedStore](store/combinedstore "Symfony\Component\Lock\Store\CombinedStore") | CombinedStore is a StoreInterface implementation able to manage and synchronize several StoreInterfaces. | | [FlockStore](store/flockstore "Symfony\Component\Lock\Store\FlockStore") | FlockStore is a StoreInterface implementation using the FileSystem flock. | | [MemcachedStore](store/memcachedstore "Symfony\Component\Lock\Store\MemcachedStore") | MemcachedStore is a StoreInterface implementation using Memcached as store engine. | | [RedisStore](store/redisstore "Symfony\Component\Lock\Store\RedisStore") | RedisStore is a StoreInterface implementation using Redis as store engine. | | [RetryTillSaveStore](store/retrytillsavestore "Symfony\Component\Lock\Store\RetryTillSaveStore") | RetryTillSaveStore is a StoreInterface implementation which decorate a non blocking StoreInterface to provide a blocking storage. | | [SemaphoreStore](store/semaphorestore "Symfony\Component\Lock\Store\SemaphoreStore") | SemaphoreStore is a StoreInterface implementation using Semaphore as store engine. | | [StoreFactory](store/storefactory "Symfony\Component\Lock\Store\StoreFactory") | StoreFactory create stores and connections. | symfony Lock Lock ===== class **Lock** implements [LockInterface](lockinterface "Symfony\Component\Lock\LockInterface"), LoggerAwareInterface Lock is the default implementation of the LockInterface. Traits ------ | | | | --- | --- | | LoggerAwareTrait | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Key](key "Symfony\Component\Lock\Key") $key, [StoreInterface](storeinterface "Symfony\Component\Lock\StoreInterface") $store, float $ttl = null, bool $autoRelease = true) | | | | [\_\_destruct](#method___destruct)() Automatically releases the underlying lock when the object is destructed. | | | bool | [acquire](#method_acquire)(bool $blocking = false) Acquires the lock. If the lock is acquired by someone else, the parameter `blocking` determines whether or not the call should block until the release of the lock. | | | | [refresh](#method_refresh)($ttl = null) Increase the duration of an acquired lock. | | | bool | [isAcquired](#method_isAcquired)() Returns whether or not the lock is acquired. | | | | [release](#method_release)() Release the lock. | | | bool | [isExpired](#method_isExpired)() | | | float|null | [getRemainingLifetime](#method_getRemainingLifetime)() Returns the remaining lifetime. | | Details ------- ### \_\_construct([Key](key "Symfony\Component\Lock\Key") $key, [StoreInterface](storeinterface "Symfony\Component\Lock\StoreInterface") $store, float $ttl = null, bool $autoRelease = true) #### Parameters | | | | | --- | --- | --- | | [Key](key "Symfony\Component\Lock\Key") | $key | Resource to lock | | [StoreInterface](storeinterface "Symfony\Component\Lock\StoreInterface") | $store | Store used to handle lock persistence | | float | $ttl | Maximum expected lock duration in seconds | | bool | $autoRelease | Whether to automatically release the lock or not when the lock instance is destroyed | ### \_\_destruct() Automatically releases the underlying lock when the object is destructed. ### bool acquire(bool $blocking = false) Acquires the lock. If the lock is acquired by someone else, the parameter `blocking` determines whether or not the call should block until the release of the lock. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether or not the Lock should wait for the release of someone else | #### Return Value | | | | --- | --- | | bool | whether or not the lock had been acquired | #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | If the lock is acquired by someone else in blocking mode | | [LockAcquiringException](exception/lockacquiringexception "Symfony\Component\Lock\Exception\LockAcquiringException") | If the lock can not be acquired | ### refresh($ttl = null) Increase the duration of an acquired lock. #### Parameters | | | | | --- | --- | --- | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | If the lock is acquired by someone else | | [LockAcquiringException](exception/lockacquiringexception "Symfony\Component\Lock\Exception\LockAcquiringException") | If the lock can not be refreshed | ### bool isAcquired() Returns whether or not the lock is acquired. #### Return Value | | | | --- | --- | | bool | | ### release() Release the lock. #### Exceptions | | | | --- | --- | | [LockReleasingException](exception/lockreleasingexception "Symfony\Component\Lock\Exception\LockReleasingException") | If the lock can not be released | ### bool isExpired() #### Return Value | | | | --- | --- | | bool | | ### float|null getRemainingLifetime() Returns the remaining lifetime. #### Return Value | | | | --- | --- | | float|null | Remaining lifetime in seconds. Null when the lock won't expire. | symfony LockAcquiringException LockAcquiringException ======================= class **LockAcquiringException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") LockAcquiringException is thrown when an issue happens during the acquisition of a lock. symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Base ExceptionInterface for the Lock Component. symfony LockReleasingException LockReleasingException ======================= class **LockReleasingException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") LockReleasingException is thrown when an issue happens during the release of a lock. symfony LockConflictedException LockConflictedException ======================== class **LockConflictedException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") LockConflictedException is thrown when a lock is acquired by someone else. symfony NotSupportedException NotSupportedException ====================== class **NotSupportedException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") NotSupportedException is thrown when an unsupported method is called. symfony LockStorageException LockStorageException ===================== class **LockStorageException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") LockStorageException is thrown when an issue happens during the manipulation of a lock in a store. symfony LockExpiredException LockExpiredException ===================== class **LockExpiredException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Lock\Exception\ExceptionInterface") LockExpiredException is thrown when a lock may conflict due to a TTL expiration. symfony FlockStore FlockStore =========== class **FlockStore** implements [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") FlockStore is a StoreInterface implementation using the FileSystem flock. Original implementation in \Symfony\Component\Filesystem\LockHandler. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $lockPath = null) | | | | [save](#method_save)([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [putOffExpiration](#method_putOffExpiration)([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | | [delete](#method_delete)([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | bool | [exists](#method_exists)([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### \_\_construct(string $lockPath = null) #### Parameters | | | | | --- | --- | --- | | string | $lockPath | the directory to store the lock, defaults to the system's temporary directory | #### Exceptions | | | | --- | --- | | [LockStorageException](../exception/lockstorageexception "Symfony\Component\Lock\Exception\LockStorageException") | If the lock directory doesn’t exist or is not writable | ### save([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### putOffExpiration([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | ### bool exists([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | | symfony SemaphoreStore SemaphoreStore =============== class **SemaphoreStore** implements [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") SemaphoreStore is a StoreInterface implementation using Semaphore as store engine. Methods ------- | | | | | --- | --- | --- | | static bool | [isSupported](#method_isSupported)() Returns whether or not the store is supported. | | | | [\_\_construct](#method___construct)() | | | | [save](#method_save)([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [delete](#method_delete)([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | | [putOffExpiration](#method_putOffExpiration)([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | bool | [exists](#method_exists)([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### static bool isSupported() Returns whether or not the store is supported. #### Return Value | | | | --- | --- | | bool | | ### \_\_construct() ### save([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | ### putOffExpiration([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### bool exists([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | | symfony MemcachedStore MemcachedStore =============== class **MemcachedStore** implements [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") MemcachedStore is a StoreInterface implementation using Memcached as store engine. Methods ------- | | | | | --- | --- | --- | | static | [isSupported](#method_isSupported)() | | | | [\_\_construct](#method___construct)(Memcached $memcached, int $initialTtl = 300) | | | | [save](#method_save)([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [putOffExpiration](#method_putOffExpiration)([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | | [delete](#method_delete)([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | bool | [exists](#method_exists)([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### static isSupported() ### \_\_construct(Memcached $memcached, int $initialTtl = 300) #### Parameters | | | | | --- | --- | --- | | Memcached | $memcached | | | int | $initialTtl | the expiration delay of locks in seconds | ### save([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### putOffExpiration([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | ### bool exists([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony RetryTillSaveStore RetryTillSaveStore =================== class **RetryTillSaveStore** implements [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface"), LoggerAwareInterface RetryTillSaveStore is a StoreInterface implementation which decorate a non blocking StoreInterface to provide a blocking storage. Traits ------ | | | | --- | --- | | LoggerAwareTrait | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") $decorated, int $retrySleep = 100, int $retryCount = PHP\_INT\_MAX) | | | | [save](#method_save)([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [putOffExpiration](#method_putOffExpiration)([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | | [delete](#method_delete)([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | bool | [exists](#method_exists)([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### \_\_construct([StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") $decorated, int $retrySleep = 100, int $retryCount = PHP\_INT\_MAX) #### Parameters | | | | | --- | --- | --- | | [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") | $decorated | The decorated StoreInterface | | int | $retrySleep | Duration in ms between 2 retry | | int | $retryCount | Maximum amount of retry | ### save([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### putOffExpiration([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | ### bool exists([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | | symfony CombinedStore CombinedStore ============== class **CombinedStore** implements [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface"), LoggerAwareInterface CombinedStore is a StoreInterface implementation able to manage and synchronize several StoreInterfaces. Traits ------ | | | | --- | --- | | LoggerAwareTrait | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $stores, [StrategyInterface](../strategy/strategyinterface "Symfony\Component\Lock\Strategy\StrategyInterface") $strategy) | | | | [save](#method_save)([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [putOffExpiration](#method_putOffExpiration)([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | | [delete](#method_delete)([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | bool | [exists](#method_exists)([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### \_\_construct(array $stores, [StrategyInterface](../strategy/strategyinterface "Symfony\Component\Lock\Strategy\StrategyInterface") $strategy) #### Parameters | | | | | --- | --- | --- | | array | $stores | The list of synchronized stores | | [StrategyInterface](../strategy/strategyinterface "Symfony\Component\Lock\Strategy\StrategyInterface") | $strategy | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Lock\Exception\InvalidArgumentException") | | ### save([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### putOffExpiration([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | ### bool exists([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | | symfony StoreFactory StoreFactory ============= class **StoreFactory** StoreFactory create stores and connections. Methods ------- | | | | | --- | --- | --- | | static [RedisStore](redisstore "Symfony\Component\Lock\Store\RedisStore")|[MemcachedStore](memcachedstore "Symfony\Component\Lock\Store\MemcachedStore") | [createStore](#method_createStore)(Redis|RedisArray|RedisCluster|Client|Memcached $connection) | | Details ------- ### static [RedisStore](redisstore "Symfony\Component\Lock\Store\RedisStore")|[MemcachedStore](memcachedstore "Symfony\Component\Lock\Store\MemcachedStore") createStore(Redis|RedisArray|RedisCluster|Client|Memcached $connection) #### Parameters | | | | | --- | --- | --- | | Redis|RedisArray|RedisCluster|Client|Memcached | $connection | | #### Return Value | | | | --- | --- | | [RedisStore](redisstore "Symfony\Component\Lock\Store\RedisStore")|[MemcachedStore](memcachedstore "Symfony\Component\Lock\Store\MemcachedStore") | | symfony RedisStore RedisStore =========== class **RedisStore** implements [StoreInterface](../storeinterface "Symfony\Component\Lock\StoreInterface") RedisStore is a StoreInterface implementation using Redis as store engine. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(Redis|RedisArray|RedisCluster|Client $redisClient, float $initialTtl = 300.0) | | | | [save](#method_save)([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. | | | | [waitAndSave](#method_waitAndSave)([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. | | | | [putOffExpiration](#method_putOffExpiration)([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. | | | | [delete](#method_delete)([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. | | | bool | [exists](#method_exists)([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. | | Details ------- ### \_\_construct(Redis|RedisArray|RedisCluster|Client $redisClient, float $initialTtl = 300.0) #### Parameters | | | | | --- | --- | --- | | Redis|RedisArray|RedisCluster|Client | $redisClient | | | float | $initialTtl | the expiration delay of locks in seconds | ### save([Key](../key "Symfony\Component\Lock\Key") $key) Stores the resource if it's not locked by someone else. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | ### waitAndSave([Key](../key "Symfony\Component\Lock\Key") $key) Waits until a key becomes free, then stores the resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### putOffExpiration([Key](../key "Symfony\Component\Lock\Key") $key, $ttl) Extends the ttl of a resource. If the store does not support this feature it should throw a NotSupportedException. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | | | $ttl | | #### Exceptions | | | | --- | --- | | [LockConflictedException](../exception/lockconflictedexception "Symfony\Component\Lock\Exception\LockConflictedException") | | | [NotSupportedException](../exception/notsupportedexception "Symfony\Component\Lock\Exception\NotSupportedException") | | ### delete([Key](../key "Symfony\Component\Lock\Key") $key) Removes a resource from the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | ### bool exists([Key](../key "Symfony\Component\Lock\Key") $key) Returns whether or not the resource exists in the storage. #### Parameters | | | | | --- | --- | --- | | [Key](../key "Symfony\Component\Lock\Key") | $key | | #### Return Value | | | | --- | --- | | bool | | symfony StrategyInterface StrategyInterface ================== interface **StrategyInterface** StrategyInterface defines an interface to indicate when a quorum is met and can be met. Methods ------- | | | | | --- | --- | --- | | bool | [isMet](#method_isMet)(int $numberOfSuccess, int $numberOfItems) Returns whether or not the quorum is met. | | | bool | [canBeMet](#method_canBeMet)(int $numberOfFailure, int $numberOfItems) Returns whether or not the quorum *could* be met. | | Details ------- ### bool isMet(int $numberOfSuccess, int $numberOfItems) Returns whether or not the quorum is met. #### Parameters | | | | | --- | --- | --- | | int | $numberOfSuccess | | | int | $numberOfItems | | #### Return Value | | | | --- | --- | | bool | | ### bool canBeMet(int $numberOfFailure, int $numberOfItems) Returns whether or not the quorum *could* be met. This method does not mean the quorum *would* be met for sure, but can be useful to stop a process early when you known there is no chance to meet the quorum. #### Parameters | | | | | --- | --- | --- | | int | $numberOfFailure | | | int | $numberOfItems | | #### Return Value | | | | --- | --- | | bool | | symfony UnanimousStrategy UnanimousStrategy ================== class **UnanimousStrategy** implements [StrategyInterface](strategyinterface "Symfony\Component\Lock\Strategy\StrategyInterface") UnanimousStrategy is a StrategyInterface implementation where 100% of elements should be successful. Methods ------- | | | | | --- | --- | --- | | bool | [isMet](#method_isMet)(int $numberOfSuccess, int $numberOfItems) Returns whether or not the quorum is met. | | | bool | [canBeMet](#method_canBeMet)(int $numberOfFailure, int $numberOfItems) Returns whether or not the quorum *could* be met. | | Details ------- ### bool isMet(int $numberOfSuccess, int $numberOfItems) Returns whether or not the quorum is met. #### Parameters | | | | | --- | --- | --- | | int | $numberOfSuccess | | | int | $numberOfItems | | #### Return Value | | | | --- | --- | | bool | | ### bool canBeMet(int $numberOfFailure, int $numberOfItems) Returns whether or not the quorum *could* be met. This method does not mean the quorum *would* be met for sure, but can be useful to stop a process early when you known there is no chance to meet the quorum. #### Parameters | | | | | --- | --- | --- | | int | $numberOfFailure | | | int | $numberOfItems | | #### Return Value | | | | --- | --- | | bool | | symfony ConsensusStrategy ConsensusStrategy ================== class **ConsensusStrategy** implements [StrategyInterface](strategyinterface "Symfony\Component\Lock\Strategy\StrategyInterface") ConsensusStrategy is a StrategyInterface implementation where strictly more than 50% items should be successful. Methods ------- | | | | | --- | --- | --- | | bool | [isMet](#method_isMet)(int $numberOfSuccess, int $numberOfItems) Returns whether or not the quorum is met. | | | bool | [canBeMet](#method_canBeMet)(int $numberOfFailure, int $numberOfItems) Returns whether or not the quorum *could* be met. | | Details ------- ### bool isMet(int $numberOfSuccess, int $numberOfItems) Returns whether or not the quorum is met. #### Parameters | | | | | --- | --- | --- | | int | $numberOfSuccess | | | int | $numberOfItems | | #### Return Value | | | | --- | --- | | bool | | ### bool canBeMet(int $numberOfFailure, int $numberOfItems) Returns whether or not the quorum *could* be met. This method does not mean the quorum *would* be met for sure, but can be useful to stop a process early when you known there is no chance to meet the quorum. #### Parameters | | | | | --- | --- | --- | | int | $numberOfFailure | | | int | $numberOfItems | | #### Return Value | | | | --- | --- | | bool | | symfony Filesystem Filesystem =========== class **Filesystem** Provides basic utility to manipulate the file system. Methods ------- | | | | | --- | --- | --- | | | [copy](#method_copy)(string $originFile, string $targetFile, bool $overwriteNewerFiles = false) Copies a file. | | | | [mkdir](#method_mkdir)(string|iterable $dirs, int $mode = 0777) Creates a directory recursively. | | | bool | [exists](#method_exists)(string|iterable $files) Checks the existence of files or directories. | | | | [touch](#method_touch)(string|iterable $files, int $time = null, int $atime = null) Sets access and modification time of file. | | | | [remove](#method_remove)(string|iterable $files) Removes files or directories. | | | | [chmod](#method_chmod)(string|iterable $files, int $mode, int $umask = 00, bool $recursive = false) Change mode for an array of files or directories. | | | | [chown](#method_chown)(string|iterable $files, string $user, bool $recursive = false) Change the owner of an array of files or directories. | | | | [chgrp](#method_chgrp)(string|iterable $files, string $group, bool $recursive = false) Change the group of an array of files or directories. | | | | [rename](#method_rename)(string $origin, string $target, bool $overwrite = false) Renames a file or a directory. | | | | [symlink](#method_symlink)(string $originDir, string $targetDir, bool $copyOnWindows = false) Creates a symbolic link or copy a directory. | | | | [hardlink](#method_hardlink)(string $originFile, string|string[] $targetFiles) Creates a hard link, or several hard links to a file. | | | string|null | [readlink](#method_readlink)(string $path, bool $canonicalize = false) Resolves links in paths. | | | string | [makePathRelative](#method_makePathRelative)(string $endPath, string $startPath) Given an existing path, convert it to a path relative to a given starting path. | | | | [mirror](#method_mirror)(string $originDir, string $targetDir, [Traversable](http://php.net/Traversable) $iterator = null, array $options = array()) Mirrors a directory to another. | | | bool | [isAbsolutePath](#method_isAbsolutePath)(string $file) Returns whether the file path is an absolute path. | | | string | [tempnam](#method_tempnam)(string $dir, string $prefix) Creates a temporary file with support for custom stream wrappers. | | | | [dumpFile](#method_dumpFile)(string $filename, string $content) Atomically dumps content into a file. | | | | [appendToFile](#method_appendToFile)(string $filename, string $content) Appends content to an existing file. | | | static | [handleError](#method_handleError)($type, $msg) | | Details ------- ### copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false) Copies a file. If the target file is older than the origin file, it's always overwritten. If the target file is newer, it is overwritten only when the $overwriteNewerFiles option is set to true. #### Parameters | | | | | --- | --- | --- | | string | $originFile | The original filename | | string | $targetFile | The target filename | | bool | $overwriteNewerFiles | If true, target files newer than origin files are overwritten | #### Exceptions | | | | --- | --- | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\Filesystem\Exception\FileNotFoundException") | When originFile doesn't exist | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When copy fails | ### mkdir(string|iterable $dirs, int $mode = 0777) Creates a directory recursively. #### Parameters | | | | | --- | --- | --- | | string|iterable | $dirs | The directory path | | int | $mode | The directory mode | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | On any directory creation failure | ### bool exists(string|iterable $files) Checks the existence of files or directories. #### Parameters | | | | | --- | --- | --- | | string|iterable | $files | A filename, an array of files, or a \Traversable instance to check | #### Return Value | | | | --- | --- | | bool | true if the file exists, false otherwise | ### touch(string|iterable $files, int $time = null, int $atime = null) Sets access and modification time of file. #### Parameters | | | | | --- | --- | --- | | string|iterable | $files | A filename, an array of files, or a \Traversable instance to create | | int | $time | The touch time as a Unix timestamp | | int | $atime | The access time as a Unix timestamp | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When touch fails | ### remove(string|iterable $files) Removes files or directories. #### Parameters | | | | | --- | --- | --- | | string|iterable | $files | A filename, an array of files, or a \Traversable instance to remove | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When removal fails | ### chmod(string|iterable $files, int $mode, int $umask = 00, bool $recursive = false) Change mode for an array of files or directories. #### Parameters | | | | | --- | --- | --- | | string|iterable | $files | A filename, an array of files, or a \Traversable instance to change mode | | int | $mode | The new mode (octal) | | int | $umask | The mode mask (octal) | | bool | $recursive | Whether change the mod recursively or not | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When the change fail | ### chown(string|iterable $files, string $user, bool $recursive = false) Change the owner of an array of files or directories. #### Parameters | | | | | --- | --- | --- | | string|iterable | $files | A filename, an array of files, or a \Traversable instance to change owner | | string | $user | The new owner user name | | bool | $recursive | Whether change the owner recursively or not | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When the change fail | ### chgrp(string|iterable $files, string $group, bool $recursive = false) Change the group of an array of files or directories. #### Parameters | | | | | --- | --- | --- | | string|iterable | $files | A filename, an array of files, or a \Traversable instance to change group | | string | $group | The group name | | bool | $recursive | Whether change the group recursively or not | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When the change fail | ### rename(string $origin, string $target, bool $overwrite = false) Renames a file or a directory. #### Parameters | | | | | --- | --- | --- | | string | $origin | The origin filename or directory | | string | $target | The new filename or directory | | bool | $overwrite | Whether to overwrite the target if it already exists | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When target file or directory already exists | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When origin cannot be renamed | ### symlink(string $originDir, string $targetDir, bool $copyOnWindows = false) Creates a symbolic link or copy a directory. #### Parameters | | | | | --- | --- | --- | | string | $originDir | The origin directory path | | string | $targetDir | The symbolic link name | | bool | $copyOnWindows | Whether to copy files if on Windows | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When symlink fails | ### hardlink(string $originFile, string|string[] $targetFiles) Creates a hard link, or several hard links to a file. #### Parameters | | | | | --- | --- | --- | | string | $originFile | The original file | | string|string[] | $targetFiles | The target file(s) | #### Exceptions | | | | --- | --- | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\Filesystem\Exception\FileNotFoundException") | When original file is missing or not a file | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When link fails, including if link already exists | ### string|null readlink(string $path, bool $canonicalize = false) Resolves links in paths. With $canonicalize = false (default) - if $path does not exist or is not a link, returns null - if $path is a link, returns the next direct target of the link without considering the existence of the target With $canonicalize = true - if $path does not exist, returns null - if $path exists, returns its absolute fully resolved final version #### Parameters | | | | | --- | --- | --- | | string | $path | A filesystem path | | bool | $canonicalize | Whether or not to return a canonicalized path | #### Return Value | | | | --- | --- | | string|null | | ### string makePathRelative(string $endPath, string $startPath) Given an existing path, convert it to a path relative to a given starting path. #### Parameters | | | | | --- | --- | --- | | string | $endPath | Absolute path of target | | string | $startPath | Absolute path where traversal begins | #### Return Value | | | | --- | --- | | string | Path of target relative to starting path | ### mirror(string $originDir, string $targetDir, [Traversable](http://php.net/Traversable) $iterator = null, array $options = array()) Mirrors a directory to another. Copies files and directories from the origin directory into the target directory. By default: * existing files in the target directory will be overwritten, except if they are newer (see the `override` option) * files in the target directory that do not exist in the source directory will not be deleted (see the `delete` option) #### Parameters | | | | | --- | --- | --- | | string | $originDir | The origin directory | | string | $targetDir | The target directory | | [Traversable](http://php.net/Traversable) | $iterator | Iterator that filters which files and directories to copy | | array | $options | An array of boolean options Valid options are: - $options['override'] If true, target files newer than origin files are overwritten (see copy(), defaults to false) - $options['copy\_on\_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false) - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | When file type is unknown | ### bool isAbsolutePath(string $file) Returns whether the file path is an absolute path. #### Parameters | | | | | --- | --- | --- | | string | $file | A file path | #### Return Value | | | | --- | --- | | bool | | ### string tempnam(string $dir, string $prefix) Creates a temporary file with support for custom stream wrappers. #### Parameters | | | | | --- | --- | --- | | string | $dir | The directory where the temporary filename will be created | | string | $prefix | The prefix of the generated temporary filename Note: Windows uses only the first three characters of prefix | #### Return Value | | | | --- | --- | | string | The new temporary filename (with path), or throw an exception on failure | ### dumpFile(string $filename, string $content) Atomically dumps content into a file. #### Parameters | | | | | --- | --- | --- | | string | $filename | The file to be written to | | string | $content | The data to write into the file | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | if the file cannot be written to | ### appendToFile(string $filename, string $content) Appends content to an existing file. #### Parameters | | | | | --- | --- | --- | | string | $filename | The file to which to append content | | string | $content | The content to append | #### Exceptions | | | | --- | --- | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | If the file is not writable | ### static handleError($type, $msg) #### Parameters | | | | | --- | --- | --- | | | $type | | | | $msg | |
programming_docs
symfony Symfony\Component\Filesystem\Exception Symfony\Component\Filesystem\Exception ====================================== Classes ------- | | | | --- | --- | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\Filesystem\Exception\FileNotFoundException") | Exception class thrown when a file couldn't be found. | | [IOException](exception/ioexception "Symfony\Component\Filesystem\Exception\IOException") | Exception class thrown when a filesystem operation failure happens. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Filesystem\Exception\InvalidArgumentException") | | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Filesystem\Exception\ExceptionInterface")* | Exception interface for all exceptions thrown by the component. | | *[IOExceptionInterface](exception/ioexceptioninterface "Symfony\Component\Filesystem\Exception\IOExceptionInterface")* | IOException interface for file and input/output stream related exceptions thrown by the component. | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Filesystem\Exception\ExceptionInterface") symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Exception interface for all exceptions thrown by the component. symfony IOException IOException ============ class **IOException** extends [RuntimeException](http://php.net/RuntimeException) implements [IOExceptionInterface](ioexceptioninterface "Symfony\Component\Filesystem\Exception\IOExceptionInterface") Exception class thrown when a filesystem operation failure happens. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, int $code = 0, [Exception](http://php.net/Exception) $previous = null, string $path = null) | | | string | [getPath](#method_getPath)() Returns the associated path for the exception. | | Details ------- ### \_\_construct(string $message, int $code = 0, [Exception](http://php.net/Exception) $previous = null, string $path = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $code | | | [Exception](http://php.net/Exception) | $previous | | | string | $path | | ### string getPath() Returns the associated path for the exception. #### Return Value | | | | --- | --- | | string | The path | symfony FileNotFoundException FileNotFoundException ====================== class **FileNotFoundException** extends [IOException](ioexception "Symfony\Component\Filesystem\Exception\IOException") Exception class thrown when a file couldn't be found. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message = null, int $code = 0, [Exception](http://php.net/Exception) $previous = null, string $path = null) | | | string | [getPath](#method_getPath)() Returns the associated path for the exception. | from [IOException](ioexception#method_getPath "Symfony\Component\Filesystem\Exception\IOException") | Details ------- ### \_\_construct(string $message = null, int $code = 0, [Exception](http://php.net/Exception) $previous = null, string $path = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $code | | | [Exception](http://php.net/Exception) | $previous | | | string | $path | | ### string getPath() Returns the associated path for the exception. #### Return Value | | | | --- | --- | | string | The path | symfony IOExceptionInterface IOExceptionInterface ===================== interface **IOExceptionInterface** implements [ExceptionInterface](exceptioninterface "Symfony\Component\Filesystem\Exception\ExceptionInterface") IOException interface for file and input/output stream related exceptions thrown by the component. Methods ------- | | | | | --- | --- | --- | | string | [getPath](#method_getPath)() Returns the associated path for the exception. | | Details ------- ### string getPath() Returns the associated path for the exception. #### Return Value | | | | --- | --- | | string | The path | symfony TemplateReferenceInterface TemplateReferenceInterface =========================== interface **TemplateReferenceInterface** Interface to be implemented by all templates. Methods ------- | | | | | --- | --- | --- | | array | [all](#method_all)() Gets the template parameters. | | | $this | [set](#method_set)(string $name, string $value) Sets a template parameter. | | | string | [get](#method_get)(string $name) Gets a template parameter. | | | string | [getPath](#method_getPath)() Returns the path to the template. | | | string | [getLogicalName](#method_getLogicalName)() Returns the "logical" template name. | | | string | [\_\_toString](#method___toString)() Returns the string representation as shortcut for getLogicalName(). | | Details ------- ### array all() Gets the template parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### $this set(string $name, string $value) Sets a template parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | string | $value | The parameter value | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the parameter name is not supported | ### string get(string $name) Gets a template parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | string | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the parameter name is not supported | ### string getPath() Returns the path to the template. By default, it just returns the template name. #### Return Value | | | | --- | --- | | string | A path to the template or a resource | ### string getLogicalName() Returns the "logical" template name. The template name acts as a unique identifier for the template. #### Return Value | | | | --- | --- | | string | The template name | ### string \_\_toString() Returns the string representation as shortcut for getLogicalName(). Alias of getLogicalName(). #### Return Value | | | | --- | --- | | string | The template name | symfony Symfony\Component\Templating\Storage Symfony\Component\Templating\Storage ==================================== Classes ------- | | | | --- | --- | | [FileStorage](storage/filestorage "Symfony\Component\Templating\Storage\FileStorage") | FileStorage represents a template stored on the filesystem. | | [Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") | Storage is the base class for all storage classes. | | [StringStorage](storage/stringstorage "Symfony\Component\Templating\Storage\StringStorage") | StringStorage represents a template stored in a string. | symfony Symfony\Component\Templating\Helper Symfony\Component\Templating\Helper =================================== Classes ------- | | | | --- | --- | | [Helper](helper/helper "Symfony\Component\Templating\Helper\Helper") | Helper is the base class for all helper classes. | | [SlotsHelper](helper/slotshelper "Symfony\Component\Templating\Helper\SlotsHelper") | SlotsHelper manages template slots. | Interfaces ---------- | | | | --- | --- | | *[HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface")* | HelperInterface is the interface all helpers must implement. | symfony Symfony\Component\Templating\Loader Symfony\Component\Templating\Loader =================================== Classes ------- | | | | --- | --- | | [CacheLoader](loader/cacheloader "Symfony\Component\Templating\Loader\CacheLoader") | CacheLoader is a loader that caches other loaders responses on the filesystem. | | [ChainLoader](loader/chainloader "Symfony\Component\Templating\Loader\ChainLoader") | ChainLoader is a loader that calls other loaders to load templates. | | [FilesystemLoader](loader/filesystemloader "Symfony\Component\Templating\Loader\FilesystemLoader") | FilesystemLoader is a loader that read templates from the filesystem. | | [Loader](loader/loader "Symfony\Component\Templating\Loader\Loader") | Loader is the base class for all template loader classes. | Interfaces ---------- | | | | --- | --- | | *[LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface")* | LoaderInterface is the interface all loaders must implement. | symfony TemplateNameParser TemplateNameParser =================== class **TemplateNameParser** implements [TemplateNameParserInterface](templatenameparserinterface "Symfony\Component\Templating\TemplateNameParserInterface") TemplateNameParser is the default implementation of TemplateNameParserInterface. This implementation takes everything as the template name and the extension for the engine. Methods ------- | | | | | --- | --- | --- | | [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | [parse](#method_parse)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Convert a template name to a TemplateReferenceInterface instance. | | Details ------- ### [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") parse(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Convert a template name to a TemplateReferenceInterface instance. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | A template | symfony StreamingEngineInterface StreamingEngineInterface ========================= interface **StreamingEngineInterface** StreamingEngineInterface provides a method that knows how to stream a template. Methods ------- | | | | | --- | --- | --- | | | [stream](#method_stream)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Streams a template. | | Details ------- ### stream(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Streams a template. The implementation should output the content directly to the client. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | | array | $parameters | An array of parameters to pass to the template | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the template cannot be rendered | | [LogicException](http://php.net/LogicException) | if the template cannot be streamed | symfony EngineInterface EngineInterface ================ interface **EngineInterface** EngineInterface is the interface each engine must implement. All methods rely on a template name. A template name is a "logical" name for the template, and as such it does not refer to a path on the filesystem (in fact, the template can be stored anywhere, like in a database). The methods should accept any name. If the name is not an instance of TemplateReferenceInterface, a TemplateNameParserInterface should be used to convert the name to a TemplateReferenceInterface instance. Each template loader uses the logical template name to look for the template. Methods ------- | | | | | --- | --- | --- | | string | [render](#method_render)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Renders a template. | | | bool | [exists](#method_exists)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if the template exists. | | | bool | [supports](#method_supports)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if this class is able to render the given template. | | Details ------- ### string render(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Renders a template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | | array | $parameters | An array of parameters to pass to the template | #### Return Value | | | | --- | --- | | string | The evaluated template as a string | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the template cannot be rendered | ### bool exists(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if the template exists. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | bool | true if the template exists, false otherwise | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the engine cannot handle the template name | ### bool supports(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if this class is able to render the given template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | bool | true if this class supports the given template, false otherwise | symfony PhpEngine PhpEngine ========== class **PhpEngine** implements [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface"), [ArrayAccess](http://php.net/ArrayAccess) PhpEngine is an engine able to render PHP templates. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $loader | | | | protected | $current | | | | protected [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface")[] | $helpers | | | | protected | $parents | | | | protected | $stack | | | | protected | $charset | | | | protected | $cache | | | | protected | $escapers | | | | static protected | $escaperCache | | | | protected | $globals | | | | protected | $parser | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TemplateNameParserInterface](templatenameparserinterface "Symfony\Component\Templating\TemplateNameParserInterface") $parser, [LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") $loader, array $helpers = array()) | | | string | [render](#method_render)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Renders a template. | | | bool | [exists](#method_exists)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if the template exists. | | | bool | [supports](#method_supports)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if this class is able to render the given template. | | | string|false | [evaluate](#method_evaluate)([Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") $template, array $parameters = array()) Evaluates a template. | | | [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") | [offsetGet](#method_offsetGet)(string $name) Gets a helper value. | | | bool | [offsetExists](#method_offsetExists)(string $name) Returns true if the helper is defined. | | | | [offsetSet](#method_offsetSet)([HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") $name, string $value) Sets a helper. | | | | [offsetUnset](#method_offsetUnset)(string $name) Removes a helper. | | | | [addHelpers](#method_addHelpers)(array $helpers) Adds some helpers. | | | | [setHelpers](#method_setHelpers)(array $helpers) Sets the helpers. | | | | [set](#method_set)([HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") $helper, string $alias = null) Sets a helper. | | | bool | [has](#method_has)(string $name) Returns true if the helper if defined. | | | [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") | [get](#method_get)(string $name) Gets a helper value. | | | | [extend](#method_extend)(string $template) Decorates the current template with another one. | | | string | [escape](#method_escape)(mixed $value, string $context = 'html') Escapes a string by using the current charset. | | | | [setCharset](#method_setCharset)(string $charset) Sets the charset to use. | | | string | [getCharset](#method_getCharset)() Gets the current charset. | | | | [setEscaper](#method_setEscaper)(string $context, callable $escaper) Adds an escaper for the given context. | | | callable | [getEscaper](#method_getEscaper)(string $context) Gets an escaper for a given context. | | | | [addGlobal](#method_addGlobal)(string $name, mixed $value) | | | array | [getGlobals](#method_getGlobals)() Returns the assigned globals. | | | | [initializeEscapers](#method_initializeEscapers)() Initializes the built-in escapers. | | | [LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") | [getLoader](#method_getLoader)() Gets the loader associated with this engine. | | | [Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") | [load](#method_load)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Loads the given template. | | Details ------- ### \_\_construct([TemplateNameParserInterface](templatenameparserinterface "Symfony\Component\Templating\TemplateNameParserInterface") $parser, [LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") $loader, array $helpers = array()) #### Parameters | | | | | --- | --- | --- | | [TemplateNameParserInterface](templatenameparserinterface "Symfony\Component\Templating\TemplateNameParserInterface") | $parser | A TemplateNameParserInterface instance | | [LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") | $loader | A loader instance | | array | $helpers | An array of helper instances | ### string render(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Renders a template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | | array | $parameters | An array of parameters to pass to the template | #### Return Value | | | | --- | --- | | string | The evaluated template as a string | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the template cannot be rendered | ### bool exists(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if the template exists. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | bool | true if the template exists, false otherwise | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the engine cannot handle the template name | ### bool supports(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if this class is able to render the given template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | bool | true if this class supports the given template, false otherwise | ### protected string|false evaluate([Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") $template, array $parameters = array()) Evaluates a template. #### Parameters | | | | | --- | --- | --- | | [Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") | $template | The template to render | | array | $parameters | An array of parameters to pass to the template | #### Return Value | | | | --- | --- | | string|false | The evaluated template, or false if the engine is unable to render the template | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") offsetGet(string $name) Gets a helper value. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") | The helper value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the helper is not defined | ### bool offsetExists(string $name) Returns true if the helper is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | bool | true if the helper is defined, false otherwise | ### offsetSet([HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") $name, string $value) Sets a helper. #### Parameters | | | | | --- | --- | --- | | [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") | $name | The helper instance | | string | $value | An alias | ### offsetUnset(string $name) Removes a helper. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### addHelpers(array $helpers) Adds some helpers. #### Parameters | | | | | --- | --- | --- | | array | $helpers | An array of helper | ### setHelpers(array $helpers) Sets the helpers. #### Parameters | | | | | --- | --- | --- | | array | $helpers | An array of helper | ### set([HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") $helper, string $alias = null) Sets a helper. #### Parameters | | | | | --- | --- | --- | | [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") | $helper | The helper instance | | string | $alias | An alias | ### bool has(string $name) Returns true if the helper if defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | bool | true if the helper is defined, false otherwise | ### [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") get(string $name) Gets a helper value. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | [HelperInterface](helper/helperinterface "Symfony\Component\Templating\Helper\HelperInterface") | The helper instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the helper is not defined | ### extend(string $template) Decorates the current template with another one. #### Parameters | | | | | --- | --- | --- | | string | $template | The decorator logical name | ### string escape(mixed $value, string $context = 'html') Escapes a string by using the current charset. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A variable to escape | | string | $context | The context name | #### Return Value | | | | --- | --- | | string | The escaped value | ### setCharset(string $charset) Sets the charset to use. #### Parameters | | | | | --- | --- | --- | | string | $charset | The charset | ### string getCharset() Gets the current charset. #### Return Value | | | | --- | --- | | string | The current charset | ### setEscaper(string $context, callable $escaper) Adds an escaper for the given context. #### Parameters | | | | | --- | --- | --- | | string | $context | The escaper context (html, js, ...) | | callable | $escaper | A PHP callable | ### callable getEscaper(string $context) Gets an escaper for a given context. #### Parameters | | | | | --- | --- | --- | | string | $context | The context name | #### Return Value | | | | --- | --- | | callable | $escaper A PHP callable | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### addGlobal(string $name, mixed $value) #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | ### array getGlobals() Returns the assigned globals. #### Return Value | | | | --- | --- | | array | | ### protected initializeEscapers() Initializes the built-in escapers. Each function specifies a way for applying a transformation to a string passed to it. The purpose is for the string to be "escaped" so it is suitable for the format it is being displayed in. For example, the string: "It's required that you enter a username & password.\n" If this were to be displayed as HTML it would be sensible to turn the ampersand into '&' and the apostrophe into '&aps;'. However if it were going to be used as a string in JavaScript to be displayed in an alert box it would be right to leave the string as-is, but c-escape the apostrophe and the new line. For each function there is a define to avoid problems with strings being incorrectly specified. ### [LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") getLoader() Gets the loader associated with this engine. #### Return Value | | | | --- | --- | | [LoaderInterface](loader/loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") | A LoaderInterface instance | ### protected [Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") load(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Loads the given template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | [Storage](storage/storage "Symfony\Component\Templating\Storage\Storage") | A Storage instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the template cannot be found |
programming_docs
symfony DelegatingEngine DelegatingEngine ================= class **DelegatingEngine** implements [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface"), [StreamingEngineInterface](streamingengineinterface "Symfony\Component\Templating\StreamingEngineInterface") DelegatingEngine selects an engine for a given template. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface")[] | $engines | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $engines = array()) | | | string | [render](#method_render)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Renders a template. | | | | [stream](#method_stream)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Streams a template. | | | bool | [exists](#method_exists)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if the template exists. | | | | [addEngine](#method_addEngine)([EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface") $engine) | | | bool | [supports](#method_supports)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if this class is able to render the given template. | | | [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface") | [getEngine](#method_getEngine)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Get an engine able to render the given template. | | Details ------- ### \_\_construct(array $engines = array()) #### Parameters | | | | | --- | --- | --- | | array | $engines | An array of EngineInterface instances to add | ### string render(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Renders a template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | | array | $parameters | An array of parameters to pass to the template | #### Return Value | | | | --- | --- | | string | The evaluated template as a string | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the template cannot be rendered | ### stream(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name, array $parameters = array()) Streams a template. The implementation should output the content directly to the client. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | | array | $parameters | An array of parameters to pass to the template | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the template cannot be rendered | | [LogicException](http://php.net/LogicException) | if the template cannot be streamed | ### bool exists(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if the template exists. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | bool | true if the template exists, false otherwise | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the engine cannot handle the template name | ### addEngine([EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface") $engine) #### Parameters | | | | | --- | --- | --- | | [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface") | $engine | | ### bool supports(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Returns true if this class is able to render the given template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | bool | true if this class supports the given template, false otherwise | ### [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface") getEngine(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Get an engine able to render the given template. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | [EngineInterface](engineinterface "Symfony\Component\Templating\EngineInterface") | The engine | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if no engine able to work with the template is found | symfony TemplateReference TemplateReference ================== class **TemplateReference** implements [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") Internal representation of a template. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name = null, string $engine = null) | | | string | [\_\_toString](#method___toString)() Returns the string representation as shortcut for getLogicalName(). | | | $this | [set](#method_set)(string $name, string $value) Sets a template parameter. | | | string | [get](#method_get)(string $name) Gets a template parameter. | | | array | [all](#method_all)() Gets the template parameters. | | | string | [getPath](#method_getPath)() Returns the path to the template. | | | string | [getLogicalName](#method_getLogicalName)() Returns the "logical" template name. | | Details ------- ### \_\_construct(string $name = null, string $engine = null) #### Parameters | | | | | --- | --- | --- | | string | $name | | | string | $engine | | ### string \_\_toString() Returns the string representation as shortcut for getLogicalName(). Alias of getLogicalName(). #### Return Value | | | | --- | --- | | string | The template name | ### $this set(string $name, string $value) Sets a template parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | string | $value | The parameter value | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the parameter name is not supported | ### string get(string $name) Gets a template parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | string | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the parameter name is not supported | ### array all() Gets the template parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### string getPath() Returns the path to the template. By default, it just returns the template name. #### Return Value | | | | --- | --- | | string | A path to the template or a resource | ### string getLogicalName() Returns the "logical" template name. The template name acts as a unique identifier for the template. #### Return Value | | | | --- | --- | | string | The template name | symfony TemplateNameParserInterface TemplateNameParserInterface ============================ interface **TemplateNameParserInterface** TemplateNameParserInterface converts template names to TemplateReferenceInterface instances. Methods ------- | | | | | --- | --- | --- | | [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | [parse](#method_parse)(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Convert a template name to a TemplateReferenceInterface instance. | | Details ------- ### [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") parse(string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $name) Convert a template name to a TemplateReferenceInterface instance. #### Parameters | | | | | --- | --- | --- | | string|[TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $name | A template name or a TemplateReferenceInterface instance | #### Return Value | | | | --- | --- | | [TemplateReferenceInterface](templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | A template | symfony Storage Storage ======== abstract class **Storage** Storage is the base class for all storage classes. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $template | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $template) | | | string | [\_\_toString](#method___toString)() Returns the object string representation. | | | string | [getContent](#method_getContent)() Returns the content of the template. | | Details ------- ### \_\_construct(string $template) #### Parameters | | | | | --- | --- | --- | | string | $template | The template name | ### string \_\_toString() Returns the object string representation. #### Return Value | | | | --- | --- | | string | The template name | ### abstract string getContent() Returns the content of the template. #### Return Value | | | | --- | --- | | string | The template content | symfony StringStorage StringStorage ============== class **StringStorage** extends [Storage](storage "Symfony\Component\Templating\Storage\Storage") StringStorage represents a template stored in a string. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $template | | from [Storage](storage#property_template "Symfony\Component\Templating\Storage\Storage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $template) | from [Storage](storage#method___construct "Symfony\Component\Templating\Storage\Storage") | | string | [\_\_toString](#method___toString)() Returns the object string representation. | from [Storage](storage#method___toString "Symfony\Component\Templating\Storage\Storage") | | string | [getContent](#method_getContent)() Returns the content of the template. | | Details ------- ### \_\_construct(string $template) #### Parameters | | | | | --- | --- | --- | | string | $template | The template name | ### string \_\_toString() Returns the object string representation. #### Return Value | | | | --- | --- | | string | The template name | ### string getContent() Returns the content of the template. #### Return Value | | | | --- | --- | | string | The template content | symfony FileStorage FileStorage ============ class **FileStorage** extends [Storage](storage "Symfony\Component\Templating\Storage\Storage") FileStorage represents a template stored on the filesystem. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $template | | from [Storage](storage#property_template "Symfony\Component\Templating\Storage\Storage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $template) | from [Storage](storage#method___construct "Symfony\Component\Templating\Storage\Storage") | | string | [\_\_toString](#method___toString)() Returns the object string representation. | from [Storage](storage#method___toString "Symfony\Component\Templating\Storage\Storage") | | string | [getContent](#method_getContent)() Returns the content of the template. | | Details ------- ### \_\_construct(string $template) #### Parameters | | | | | --- | --- | --- | | string | $template | The template name | ### string \_\_toString() Returns the object string representation. #### Return Value | | | | --- | --- | | string | The template name | ### string getContent() Returns the content of the template. #### Return Value | | | | --- | --- | | string | The template content | symfony FilesystemLoader FilesystemLoader ================= class **FilesystemLoader** extends [Loader](loader "Symfony\Component\Templating\Loader\Loader") FilesystemLoader is a loader that read templates from the filesystem. Properties ---------- | | | | | | --- | --- | --- | --- | | protected LoggerInterface|null | $logger | | from [Loader](loader#property_logger "Symfony\Component\Templating\Loader\Loader") | | protected | $templatePathPatterns | | | Methods ------- | | | | | --- | --- | --- | | | [setLogger](#method_setLogger)(LoggerInterface $logger) Sets the debug logger to use for this loader. | from [Loader](loader#method_setLogger "Symfony\Component\Templating\Loader\Loader") | | | [\_\_construct](#method___construct)(string|string[] $templatePathPatterns) | | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | [load](#method_load)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. | | | bool | [isFresh](#method_isFresh)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. | | | static bool | [isAbsolutePath](#method_isAbsolutePath)(string $file) Returns true if the file is an existing absolute path. | | Details ------- ### setLogger(LoggerInterface $logger) Sets the debug logger to use for this loader. #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | ### \_\_construct(string|string[] $templatePathPatterns) #### Parameters | | | | | --- | --- | --- | | string|string[] | $templatePathPatterns | An array of path patterns to look for templates | ### [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool load([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | | #### Return Value | | | | --- | --- | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | false if the template cannot be loaded, a Storage instance otherwise | ### bool isFresh([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | A template | | int | $time | The last modification time of the cached template (timestamp) | #### Return Value | | | | --- | --- | | bool | | ### static protected bool isAbsolutePath(string $file) Returns true if the file is an existing absolute path. #### Parameters | | | | | --- | --- | --- | | string | $file | A path | #### Return Value | | | | --- | --- | | bool | true if the path exists and is absolute, false otherwise | symfony ChainLoader ChainLoader ============ class **ChainLoader** extends [Loader](loader "Symfony\Component\Templating\Loader\Loader") ChainLoader is a loader that calls other loaders to load templates. Properties ---------- | | | | | | --- | --- | --- | --- | | protected LoggerInterface|null | $logger | | from [Loader](loader#property_logger "Symfony\Component\Templating\Loader\Loader") | | protected | $loaders | | | Methods ------- | | | | | --- | --- | --- | | | [setLogger](#method_setLogger)(LoggerInterface $logger) Sets the debug logger to use for this loader. | from [Loader](loader#method_setLogger "Symfony\Component\Templating\Loader\Loader") | | | [\_\_construct](#method___construct)(array $loaders = array()) | | | | [addLoader](#method_addLoader)([LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") $loader) Adds a loader instance. | | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | [load](#method_load)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. | | | bool | [isFresh](#method_isFresh)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. | | Details ------- ### setLogger(LoggerInterface $logger) Sets the debug logger to use for this loader. #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | ### \_\_construct(array $loaders = array()) #### Parameters | | | | | --- | --- | --- | | array | $loaders | An array of loader instances | ### addLoader([LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") $loader) Adds a loader instance. #### Parameters | | | | | --- | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") | $loader | | ### [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool load([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | | #### Return Value | | | | --- | --- | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | false if the template cannot be loaded, a Storage instance otherwise | ### bool isFresh([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | A template | | int | $time | The last modification time of the cached template (timestamp) | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony Loader Loader ======= abstract class **Loader** implements [LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") Loader is the base class for all template loader classes. Properties ---------- | | | | | | --- | --- | --- | --- | | protected LoggerInterface|null | $logger | | | Methods ------- | | | | | --- | --- | --- | | | [setLogger](#method_setLogger)(LoggerInterface $logger) Sets the debug logger to use for this loader. | | Details ------- ### setLogger(LoggerInterface $logger) Sets the debug logger to use for this loader. #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | symfony CacheLoader CacheLoader ============ class **CacheLoader** extends [Loader](loader "Symfony\Component\Templating\Loader\Loader") CacheLoader is a loader that caches other loaders responses on the filesystem. This cache only caches on disk to allow PHP accelerators to cache the opcodes. All other mechanism would imply the use of `eval()`. Properties ---------- | | | | | | --- | --- | --- | --- | | protected LoggerInterface|null | $logger | | from [Loader](loader#property_logger "Symfony\Component\Templating\Loader\Loader") | | protected | $loader | | | | protected | $dir | | | Methods ------- | | | | | --- | --- | --- | | | [setLogger](#method_setLogger)(LoggerInterface $logger) Sets the debug logger to use for this loader. | from [Loader](loader#method_setLogger "Symfony\Component\Templating\Loader\Loader") | | | [\_\_construct](#method___construct)([LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") $loader, string $dir) | | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | [load](#method_load)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. | | | bool | [isFresh](#method_isFresh)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. | | Details ------- ### setLogger(LoggerInterface $logger) Sets the debug logger to use for this loader. #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | ### \_\_construct([LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") $loader, string $dir) #### Parameters | | | | | --- | --- | --- | | [LoaderInterface](loaderinterface "Symfony\Component\Templating\Loader\LoaderInterface") | $loader | A Loader instance | | string | $dir | The directory where to store the cache files | ### [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool load([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | | #### Return Value | | | | --- | --- | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | false if the template cannot be loaded, a Storage instance otherwise | ### bool isFresh([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | A template | | int | $time | The last modification time of the cached template (timestamp) | #### Return Value | | | | --- | --- | | bool | | symfony LoaderInterface LoaderInterface ================ interface **LoaderInterface** LoaderInterface is the interface all loaders must implement. Methods ------- | | | | | --- | --- | --- | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | [load](#method_load)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. | | | bool | [isFresh](#method_isFresh)([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. | | Details ------- ### [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool load([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template) Loads a template. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | | #### Return Value | | | | --- | --- | | [Storage](../storage/storage "Symfony\Component\Templating\Storage\Storage")|bool | false if the template cannot be loaded, a Storage instance otherwise | ### bool isFresh([TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") $template, int $time) Returns true if the template is still fresh. #### Parameters | | | | | --- | --- | --- | | [TemplateReferenceInterface](../templatereferenceinterface "Symfony\Component\Templating\TemplateReferenceInterface") | $template | A template | | int | $time | The last modification time of the cached template (timestamp) | #### Return Value | | | | --- | --- | | bool | | symfony SlotsHelper SlotsHelper ============ class **SlotsHelper** extends [Helper](helper "Symfony\Component\Templating\Helper\Helper") SlotsHelper manages template slots. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $charset | | from [Helper](helper#property_charset "Symfony\Component\Templating\Helper\Helper") | | protected | $slots | | | | protected | $openSlots | | | Methods ------- | | | | | --- | --- | --- | | | [setCharset](#method_setCharset)(string $charset) Sets the default charset. | from [Helper](helper#method_setCharset "Symfony\Component\Templating\Helper\Helper") | | string | [getCharset](#method_getCharset)() Gets the default charset. | from [Helper](helper#method_getCharset "Symfony\Component\Templating\Helper\Helper") | | | [start](#method_start)(string $name) Starts a new slot. | | | | [stop](#method_stop)() Stops a slot. | | | bool | [has](#method_has)(string $name) Returns true if the slot exists. | | | string | [get](#method_get)(string $name, bool|string $default = false) Gets the slot value. | | | | [set](#method_set)(string $name, string $content) Sets a slot value. | | | bool | [output](#method_output)(string $name, bool|string $default = false) Outputs a slot. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setCharset(string $charset) Sets the default charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | The charset | ### string getCharset() Gets the default charset. #### Return Value | | | | --- | --- | | string | The default charset | ### start(string $name) Starts a new slot. This method starts an output buffer that will be closed when the stop() method is called. #### Parameters | | | | | --- | --- | --- | | string | $name | The slot name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if a slot with the same name is already started | ### stop() Stops a slot. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if no slot has been started | ### bool has(string $name) Returns true if the slot exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The slot name | #### Return Value | | | | --- | --- | | bool | | ### string get(string $name, bool|string $default = false) Gets the slot value. #### Parameters | | | | | --- | --- | --- | | string | $name | The slot name | | bool|string | $default | The default slot content | #### Return Value | | | | --- | --- | | string | The slot content | ### set(string $name, string $content) Sets a slot value. #### Parameters | | | | | --- | --- | --- | | string | $name | The slot name | | string | $content | The slot content | ### bool output(string $name, bool|string $default = false) Outputs a slot. #### Parameters | | | | | --- | --- | --- | | string | $name | The slot name | | bool|string | $default | The default slot content | #### Return Value | | | | --- | --- | | bool | true if the slot is defined or if a default content has been provided, false otherwise | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony Helper Helper ======= abstract class **Helper** implements [HelperInterface](helperinterface "Symfony\Component\Templating\Helper\HelperInterface") Helper is the base class for all helper classes. Most of the time, a Helper is an adapter around an existing class that exposes a read-only interface for templates. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $charset | | | Methods ------- | | | | | --- | --- | --- | | | [setCharset](#method_setCharset)(string $charset) Sets the default charset. | | | string | [getCharset](#method_getCharset)() Gets the default charset. | | Details ------- ### setCharset(string $charset) Sets the default charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | The charset | ### string getCharset() Gets the default charset. #### Return Value | | | | --- | --- | | string | The default charset | symfony HelperInterface HelperInterface ================ interface **HelperInterface** HelperInterface is the interface all helpers must implement. Methods ------- | | | | | --- | --- | --- | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | | | [setCharset](#method_setCharset)(string $charset) Sets the default charset. | | | string | [getCharset](#method_getCharset)() Gets the default charset. | | Details ------- ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | ### setCharset(string $charset) Sets the default charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | The charset | ### string getCharset() Gets the default charset. #### Return Value | | | | --- | --- | | string | The default charset | symfony HttpHeaderSerializer HttpHeaderSerializer ===================== class **HttpHeaderSerializer** Serializes a list of Link instances to a HTTP Link header. Methods ------- | | | | | --- | --- | --- | | string|null | [serialize](#method_serialize)(iterable $links) Builds the value of the "Link" HTTP header. | | Details ------- ### string|null serialize(iterable $links) Builds the value of the "Link" HTTP header. #### Parameters | | | | | --- | --- | --- | | iterable | $links | | #### Return Value | | | | --- | --- | | string|null | | symfony Symfony\Component\WebLink\EventListener Symfony\Component\WebLink\EventListener ======================================= Classes ------- | | | | --- | --- | | [AddLinkHeaderListener](eventlistener/addlinkheaderlistener "Symfony\Component\WebLink\EventListener\AddLinkHeaderListener") | Adds the Link HTTP header to the response. | symfony AddLinkHeaderListener AddLinkHeaderListener ====================== class **AddLinkHeaderListener** implements [EventSubscriberInterface](../../eventdispatcher/eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") Adds the Link HTTP header to the response. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | | [onKernelResponse](#method_onKernelResponse)([FilterResponseEvent](../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") $event) | | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | Details ------- ### \_\_construct() ### onKernelResponse([FilterResponseEvent](../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") $event) #### Parameters | | | | | --- | --- | --- | | [FilterResponseEvent](../../httpkernel/event/filterresponseevent "Symfony\Component\HttpKernel\Event\FilterResponseEvent") | $event | | ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | symfony PropertyPath PropertyPath ============= class **PropertyPath** implements [IteratorAggregate](http://php.net/IteratorAggregate), [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") Default implementation of {@link PropertyPathInterface}. Constants --------- | | | | --- | --- | | SINGULAR\_SEPARATOR | *Character used for separating between plural and singular of an element.* | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath")|string $propertyPath) Constructs a property path from a string. | | | string | [\_\_toString](#method___toString)() Returns the string representation of the property path. | | | int | [getLength](#method_getLength)() Returns the length of the property path, i.e. the number of elements. | | | [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath") | [getParent](#method_getParent)() Returns the parent property path. | | | [PropertyPathIteratorInterface](propertypathiteratorinterface "Symfony\Component\PropertyAccess\PropertyPathIteratorInterface") | [getIterator](#method_getIterator)() Returns a new iterator for this path. | | | array | [getElements](#method_getElements)() Returns the elements of the property path as array. | | | string | [getElement](#method_getElement)(int $index) Returns the element at the given index in the property path. | | | bool | [isProperty](#method_isProperty)(int $index) Returns whether the element at the given index is a property. | | | bool | [isIndex](#method_isIndex)(int $index) Returns whether the element at the given index is an array index. | | Details ------- ### \_\_construct([PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath")|string $propertyPath) Constructs a property path from a string. #### Parameters | | | | | --- | --- | --- | | [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath")|string | $propertyPath | The property path as string or instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the given path is not a string | | [InvalidPropertyPathException](exception/invalidpropertypathexception "Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException") | If the syntax of the property path is not valid | ### string \_\_toString() Returns the string representation of the property path. #### Return Value | | | | --- | --- | | string | The path as string | ### int getLength() Returns the length of the property path, i.e. the number of elements. #### Return Value | | | | --- | --- | | int | The path length | ### [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath") getParent() Returns the parent property path. The parent property path is the one that contains the same items as this one except for the last one. If this property path only contains one item, null is returned. #### Return Value | | | | --- | --- | | [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath") | The parent path or null | ### [PropertyPathIteratorInterface](propertypathiteratorinterface "Symfony\Component\PropertyAccess\PropertyPathIteratorInterface") getIterator() Returns a new iterator for this path. #### Return Value | | | | --- | --- | | [PropertyPathIteratorInterface](propertypathiteratorinterface "Symfony\Component\PropertyAccess\PropertyPathIteratorInterface") | | ### array getElements() Returns the elements of the property path as array. #### Return Value | | | | --- | --- | | array | An array of property/index names | ### string getElement(int $index) Returns the element at the given index in the property path. #### Parameters | | | | | --- | --- | --- | | int | $index | The index key | #### Return Value | | | | --- | --- | | string | A property or index name | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### bool isProperty(int $index) Returns whether the element at the given index is a property. #### Parameters | | | | | --- | --- | --- | | int | $index | The index in the property path | #### Return Value | | | | --- | --- | | bool | Whether the element at this index is a property | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### bool isIndex(int $index) Returns whether the element at the given index is an array index. #### Parameters | | | | | --- | --- | --- | | int | $index | The index in the property path | #### Return Value | | | | --- | --- | | bool | Whether the element at this index is an array index | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | symfony Symfony\Component\PropertyAccess\Exception Symfony\Component\PropertyAccess\Exception ========================================== Classes ------- | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") | Thrown when a property path is not available. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | Base InvalidArgumentException for the PropertyAccess component. | | [InvalidPropertyPathException](exception/invalidpropertypathexception "Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException") | Thrown when a property path is malformed. | | [NoSuchIndexException](exception/nosuchindexexception "Symfony\Component\PropertyAccess\Exception\NoSuchIndexException") | Thrown when an index cannot be found. | | [NoSuchPropertyException](exception/nosuchpropertyexception "Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException") | Thrown when a property cannot be found. | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | Base OutOfBoundsException for the PropertyAccess component. | | [RuntimeException](exception/runtimeexception "Symfony\Component\PropertyAccess\Exception\RuntimeException") | Base RuntimeException for the PropertyAccess component. | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException") | Thrown when a value does not match an expected type. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\PropertyAccess\Exception\ExceptionInterface")* | Marker interface for the PropertyAccess component. |
programming_docs
symfony PropertyAccessor PropertyAccessor ================= class **PropertyAccessor** implements [PropertyAccessorInterface](propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") Default implementation of {@link PropertyAccessorInterface}. Constants --------- | | | | --- | --- | | VALUE | | | REF | | | IS\_REF\_CHAINED | | | ACCESS\_HAS\_PROPERTY | | | ACCESS\_TYPE | | | ACCESS\_NAME | | | ACCESS\_REF | | | ACCESS\_ADDER | | | ACCESS\_REMOVER | | | ACCESS\_TYPE\_METHOD | | | ACCESS\_TYPE\_PROPERTY | | | ACCESS\_TYPE\_MAGIC | | | ACCESS\_TYPE\_ADDER\_AND\_REMOVER | | | ACCESS\_TYPE\_NOT\_FOUND | | | CACHE\_PREFIX\_READ | | | CACHE\_PREFIX\_WRITE | | | CACHE\_PREFIX\_PROPERTY\_PATH | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool $magicCall = false, bool $throwExceptionOnInvalidIndex = false, CacheItemPoolInterface $cacheItemPool = null) Should not be used by application code. Use {@link PropertyAccess::createPropertyAccessor()} instead. | | | mixed | [getValue](#method_getValue)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns the value at the end of the property path of the object graph. | | | | [setValue](#method_setValue)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath, mixed $value) Sets the value at the end of the property path of the object graph. | | | bool | [isReadable](#method_isReadable)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a property path can be read from an object graph. | | | bool | [isWritable](#method_isWritable)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a value can be written at a given property path. | | | static [AdapterInterface](../cache/adapter/adapterinterface "Symfony\Component\Cache\Adapter\AdapterInterface") | [createCache](#method_createCache)(string $namespace, int $defaultLifetime, string $version, LoggerInterface $logger = null) Creates the APCu adapter if applicable. | | Details ------- ### \_\_construct(bool $magicCall = false, bool $throwExceptionOnInvalidIndex = false, CacheItemPoolInterface $cacheItemPool = null) Should not be used by application code. Use {@link PropertyAccess::createPropertyAccessor()} instead. #### Parameters | | | | | --- | --- | --- | | bool | $magicCall | | | bool | $throwExceptionOnInvalidIndex | | | CacheItemPoolInterface | $cacheItemPool | | ### mixed getValue(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns the value at the end of the property path of the object graph. Example: ``` use Symfony\Component\PropertyAccess\PropertyAccess; $propertyAccessor = PropertyAccess::createPropertyAccessor(); echo $propertyAccessor->getValue($object, 'child.name); // equals echo $object->getChild()->getName(); ``` This method first tries to find a public getter for each property in the path. The name of the getter must be the camel-cased property name prefixed with "get", "is", or "has". If the getter does not exist, this method tries to find a public property. The value of the property is then returned. If none of them are found, an exception is thrown. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to traverse | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to read | #### Return Value | | | | --- | --- | | mixed | The value at the end of the property path | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | | [AccessException](exception/accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") | If a property/index does not exist or is not public | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException") | If a value within the path is neither object nor array | ### setValue(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath, mixed $value) Sets the value at the end of the property path of the object graph. Example: ``` use Symfony\Component\PropertyAccess\PropertyAccess; $propertyAccessor = PropertyAccess::createPropertyAccessor(); echo $propertyAccessor->setValue($object, 'child.name', 'Fabien'); // equals echo $object->getChild()->setName('Fabien'); ``` This method first tries to find a public setter for each property in the path. The name of the setter must be the camel-cased property name prefixed with "set". If the setter does not exist, this method tries to find a public property. The value of the property is then changed. If neither is found, an exception is thrown. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to modify | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to modify | | mixed | $value | The value to set at the end of the property path | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | | [AccessException](exception/accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") | If a property/index does not exist or is not public | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException") | If a value within the path is neither object nor array | ### bool isReadable(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a property path can be read from an object graph. Whenever this method returns true, {@link getValue()} is guaranteed not to throw an exception when called with the same arguments. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to check | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to check | #### Return Value | | | | --- | --- | | bool | Whether the property path can be read | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | ### bool isWritable(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a value can be written at a given property path. Whenever this method returns true, {@link setValue()} is guaranteed not to throw an exception when called with the same arguments. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to check | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to check | #### Return Value | | | | --- | --- | | bool | Whether the value can be set | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | ### static [AdapterInterface](../cache/adapter/adapterinterface "Symfony\Component\Cache\Adapter\AdapterInterface") createCache(string $namespace, int $defaultLifetime, string $version, LoggerInterface $logger = null) Creates the APCu adapter if applicable. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | int | $defaultLifetime | | | string | $version | | | LoggerInterface | $logger | | #### Return Value | | | | --- | --- | | [AdapterInterface](../cache/adapter/adapterinterface "Symfony\Component\Cache\Adapter\AdapterInterface") | | #### Exceptions | | | | --- | --- | | RuntimeException | When the Cache Component isn't available | symfony PropertyAccessorInterface PropertyAccessorInterface ========================== interface **PropertyAccessorInterface** Writes and reads values to/from an object/array graph. Methods ------- | | | | | --- | --- | --- | | | [setValue](#method_setValue)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath, mixed $value) Sets the value at the end of the property path of the object graph. | | | mixed | [getValue](#method_getValue)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns the value at the end of the property path of the object graph. | | | bool | [isWritable](#method_isWritable)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a value can be written at a given property path. | | | bool | [isReadable](#method_isReadable)(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a property path can be read from an object graph. | | Details ------- ### setValue(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath, mixed $value) Sets the value at the end of the property path of the object graph. Example: ``` use Symfony\Component\PropertyAccess\PropertyAccess; $propertyAccessor = PropertyAccess::createPropertyAccessor(); echo $propertyAccessor->setValue($object, 'child.name', 'Fabien'); // equals echo $object->getChild()->setName('Fabien'); ``` This method first tries to find a public setter for each property in the path. The name of the setter must be the camel-cased property name prefixed with "set". If the setter does not exist, this method tries to find a public property. The value of the property is then changed. If neither is found, an exception is thrown. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to modify | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to modify | | mixed | $value | The value to set at the end of the property path | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | | [AccessException](exception/accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") | If a property/index does not exist or is not public | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException") | If a value within the path is neither object nor array | ### mixed getValue(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns the value at the end of the property path of the object graph. Example: ``` use Symfony\Component\PropertyAccess\PropertyAccess; $propertyAccessor = PropertyAccess::createPropertyAccessor(); echo $propertyAccessor->getValue($object, 'child.name); // equals echo $object->getChild()->getName(); ``` This method first tries to find a public getter for each property in the path. The name of the getter must be the camel-cased property name prefixed with "get", "is", or "has". If the getter does not exist, this method tries to find a public property. The value of the property is then returned. If none of them are found, an exception is thrown. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to traverse | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to read | #### Return Value | | | | --- | --- | | mixed | The value at the end of the property path | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | | [AccessException](exception/accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") | If a property/index does not exist or is not public | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException") | If a value within the path is neither object nor array | ### bool isWritable(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a value can be written at a given property path. Whenever this method returns true, {@link setValue()} is guaranteed not to throw an exception when called with the same arguments. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to check | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to check | #### Return Value | | | | --- | --- | | bool | Whether the value can be set | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | ### bool isReadable(object|array $objectOrArray, string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $propertyPath) Returns whether a property path can be read from an object graph. Whenever this method returns true, {@link getValue()} is guaranteed not to throw an exception when called with the same arguments. #### Parameters | | | | | --- | --- | --- | | object|array | $objectOrArray | The object or array to check | | string|[PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $propertyPath | The property path to check | #### Return Value | | | | --- | --- | | bool | Whether the property path can be read | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\PropertyAccess\Exception\InvalidArgumentException") | If the property path is invalid | symfony PropertyAccessorBuilder PropertyAccessorBuilder ======================== class **PropertyAccessorBuilder** A configurable builder to create a PropertyAccessor. Methods ------- | | | | | --- | --- | --- | | $this | [enableMagicCall](#method_enableMagicCall)() Enables the use of "\_\_call" by the PropertyAccessor. | | | $this | [disableMagicCall](#method_disableMagicCall)() Disables the use of "\_\_call" by the PropertyAccessor. | | | bool | [isMagicCallEnabled](#method_isMagicCallEnabled)() | | | $this | [enableExceptionOnInvalidIndex](#method_enableExceptionOnInvalidIndex)() Enables exceptions when reading a non-existing index. | | | $this | [disableExceptionOnInvalidIndex](#method_disableExceptionOnInvalidIndex)() Disables exceptions when reading a non-existing index. | | | bool | [isExceptionOnInvalidIndexEnabled](#method_isExceptionOnInvalidIndexEnabled)() | | | [PropertyAccessorBuilder](propertyaccessorbuilder "Symfony\Component\PropertyAccess\PropertyAccessorBuilder") | [setCacheItemPool](#method_setCacheItemPool)(CacheItemPoolInterface $cacheItemPool = null) Sets a cache system. | | | CacheItemPoolInterface|null | [getCacheItemPool](#method_getCacheItemPool)() Gets the used cache system. | | | [PropertyAccessorInterface](propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") | [getPropertyAccessor](#method_getPropertyAccessor)() Builds and returns a new PropertyAccessor object. | | Details ------- ### $this enableMagicCall() Enables the use of "\_\_call" by the PropertyAccessor. #### Return Value | | | | --- | --- | | $this | | ### $this disableMagicCall() Disables the use of "\_\_call" by the PropertyAccessor. #### Return Value | | | | --- | --- | | $this | | ### bool isMagicCallEnabled() #### Return Value | | | | --- | --- | | bool | whether the use of "\_\_call" by the PropertyAccessor is enabled | ### $this enableExceptionOnInvalidIndex() Enables exceptions when reading a non-existing index. This has no influence on writing non-existing indices with PropertyAccessorInterface::setValue() which are always created on-the-fly. #### Return Value | | | | --- | --- | | $this | | ### $this disableExceptionOnInvalidIndex() Disables exceptions when reading a non-existing index. Instead, null is returned when calling PropertyAccessorInterface::getValue() on a non-existing index. #### Return Value | | | | --- | --- | | $this | | ### bool isExceptionOnInvalidIndexEnabled() #### Return Value | | | | --- | --- | | bool | whether an exception is thrown or null is returned when reading a non-existing index | ### [PropertyAccessorBuilder](propertyaccessorbuilder "Symfony\Component\PropertyAccess\PropertyAccessorBuilder") setCacheItemPool(CacheItemPoolInterface $cacheItemPool = null) Sets a cache system. #### Parameters | | | | | --- | --- | --- | | CacheItemPoolInterface | $cacheItemPool | | #### Return Value | | | | --- | --- | | [PropertyAccessorBuilder](propertyaccessorbuilder "Symfony\Component\PropertyAccess\PropertyAccessorBuilder") | The builder object | ### CacheItemPoolInterface|null getCacheItemPool() Gets the used cache system. #### Return Value | | | | --- | --- | | CacheItemPoolInterface|null | | ### [PropertyAccessorInterface](propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") getPropertyAccessor() Builds and returns a new PropertyAccessor object. #### Return Value | | | | --- | --- | | [PropertyAccessorInterface](propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") | The built PropertyAccessor | symfony PropertyPathInterface PropertyPathInterface ====================== interface **PropertyPathInterface** implements [Traversable](http://php.net/Traversable) A sequence of property names or array indices. Methods ------- | | | | | --- | --- | --- | | string | [\_\_toString](#method___toString)() Returns the string representation of the property path. | | | int | [getLength](#method_getLength)() Returns the length of the property path, i.e. the number of elements. | | | [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath") | [getParent](#method_getParent)() Returns the parent property path. | | | array | [getElements](#method_getElements)() Returns the elements of the property path as array. | | | string | [getElement](#method_getElement)(int $index) Returns the element at the given index in the property path. | | | bool | [isProperty](#method_isProperty)(int $index) Returns whether the element at the given index is a property. | | | bool | [isIndex](#method_isIndex)(int $index) Returns whether the element at the given index is an array index. | | Details ------- ### string \_\_toString() Returns the string representation of the property path. #### Return Value | | | | --- | --- | | string | The path as string | ### int getLength() Returns the length of the property path, i.e. the number of elements. #### Return Value | | | | --- | --- | | int | The path length | ### [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath") getParent() Returns the parent property path. The parent property path is the one that contains the same items as this one except for the last one. If this property path only contains one item, null is returned. #### Return Value | | | | --- | --- | | [PropertyPath](propertypath "Symfony\Component\PropertyAccess\PropertyPath") | The parent path or null | ### array getElements() Returns the elements of the property path as array. #### Return Value | | | | --- | --- | | array | An array of property/index names | ### string getElement(int $index) Returns the element at the given index in the property path. #### Parameters | | | | | --- | --- | --- | | int | $index | The index key | #### Return Value | | | | --- | --- | | string | A property or index name | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### bool isProperty(int $index) Returns whether the element at the given index is a property. #### Parameters | | | | | --- | --- | --- | | int | $index | The index in the property path | #### Return Value | | | | --- | --- | | bool | Whether the element at this index is a property | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### bool isIndex(int $index) Returns whether the element at the given index is an array index. #### Parameters | | | | | --- | --- | --- | | int | $index | The index in the property path | #### Return Value | | | | --- | --- | | bool | Whether the element at this index is an array index | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid |
programming_docs
symfony PropertyAccess PropertyAccess =============== class **PropertyAccess** Entry point of the PropertyAccess component. Methods ------- | | | | | --- | --- | --- | | static [PropertyAccessor](propertyaccessor "Symfony\Component\PropertyAccess\PropertyAccessor") | [createPropertyAccessor](#method_createPropertyAccessor)() Creates a property accessor with the default configuration. | | | static [PropertyAccessorBuilder](propertyaccessorbuilder "Symfony\Component\PropertyAccess\PropertyAccessorBuilder") | [createPropertyAccessorBuilder](#method_createPropertyAccessorBuilder)() | | Details ------- ### static [PropertyAccessor](propertyaccessor "Symfony\Component\PropertyAccess\PropertyAccessor") createPropertyAccessor() Creates a property accessor with the default configuration. #### Return Value | | | | --- | --- | | [PropertyAccessor](propertyaccessor "Symfony\Component\PropertyAccess\PropertyAccessor") | | ### static [PropertyAccessorBuilder](propertyaccessorbuilder "Symfony\Component\PropertyAccess\PropertyAccessorBuilder") createPropertyAccessorBuilder() #### Return Value | | | | --- | --- | | [PropertyAccessorBuilder](propertyaccessorbuilder "Symfony\Component\PropertyAccess\PropertyAccessorBuilder") | | symfony PropertyPathIterator PropertyPathIterator ===================== class **PropertyPathIterator** extends [ArrayIterator](http://php.net/ArrayIterator) implements [PropertyPathIteratorInterface](propertypathiteratorinterface "Symfony\Component\PropertyAccess\PropertyPathIteratorInterface") Traverses a property path and provides additional methods to find out information about the current element. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $path | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $path) | | | bool | [isIndex](#method_isIndex)() Returns whether the current element in the property path is an array index. | | | bool | [isProperty](#method_isProperty)() Returns whether the current element in the property path is a property name. | | Details ------- ### \_\_construct([PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $path) #### Parameters | | | | | --- | --- | --- | | [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $path | The property path to traverse | ### bool isIndex() Returns whether the current element in the property path is an array index. #### Return Value | | | | --- | --- | | bool | | ### bool isProperty() Returns whether the current element in the property path is a property name. #### Return Value | | | | --- | --- | | bool | | symfony PropertyPathIteratorInterface PropertyPathIteratorInterface ============================== interface **PropertyPathIteratorInterface** implements [Iterator](http://php.net/Iterator), [SeekableIterator](http://php.net/SeekableIterator) Methods ------- | | | | | --- | --- | --- | | bool | [isIndex](#method_isIndex)() Returns whether the current element in the property path is an array index. | | | bool | [isProperty](#method_isProperty)() Returns whether the current element in the property path is a property name. | | Details ------- ### bool isIndex() Returns whether the current element in the property path is an array index. #### Return Value | | | | --- | --- | | bool | | ### bool isProperty() Returns whether the current element in the property path is a property name. #### Return Value | | | | --- | --- | | bool | | symfony PropertyPathBuilder PropertyPathBuilder ==================== class **PropertyPathBuilder** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string|null $path = null) Creates a new property path builder. | | | | [append](#method_append)([PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string $path, int $offset = 0, int $length = 0) Appends a (sub-) path to the current path. | | | | [appendIndex](#method_appendIndex)(string $name) Appends an index element to the current path. | | | | [appendProperty](#method_appendProperty)(string $name) Appends a property element to the current path. | | | | [remove](#method_remove)(int $offset, int $length = 1) Removes elements from the current path. | | | | [replace](#method_replace)(int $offset, int $length, [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string $path, int $pathOffset = 0, int $pathLength = 0) Replaces a sub-path by a different (sub-) path. | | | | [replaceByIndex](#method_replaceByIndex)(int $offset, string $name = null) Replaces a property element by an index element. | | | | [replaceByProperty](#method_replaceByProperty)(int $offset, string $name = null) Replaces an index element by a property element. | | | int | [getLength](#method_getLength)() Returns the length of the current path. | | | [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | [getPropertyPath](#method_getPropertyPath)() Returns the current property path. | | | string | [\_\_toString](#method___toString)() Returns the current property path as string. | | Details ------- ### \_\_construct([PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string|null $path = null) Creates a new property path builder. #### Parameters | | | | | --- | --- | --- | | [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string|null | $path | The path to initially store in the builder. Optional. | ### append([PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string $path, int $offset = 0, int $length = 0) Appends a (sub-) path to the current path. #### Parameters | | | | | --- | --- | --- | | [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string | $path | The path to append | | int | $offset | The offset where the appended piece starts in $path | | int | $length | The length of the appended piece If 0, the full path is appended | ### appendIndex(string $name) Appends an index element to the current path. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the appended index | ### appendProperty(string $name) Appends a property element to the current path. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the appended property | ### remove(int $offset, int $length = 1) Removes elements from the current path. #### Parameters | | | | | --- | --- | --- | | int | $offset | The offset at which to remove | | int | $length | The length of the removed piece | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | if offset is invalid | ### replace(int $offset, int $length, [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string $path, int $pathOffset = 0, int $pathLength = 0) Replaces a sub-path by a different (sub-) path. #### Parameters | | | | | --- | --- | --- | | int | $offset | The offset at which to replace | | int | $length | The length of the piece to replace | | [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface")|string | $path | The path to insert | | int | $pathOffset | The offset where the inserted piece starts in $path | | int | $pathLength | The length of the inserted piece If 0, the full path is inserted | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### replaceByIndex(int $offset, string $name = null) Replaces a property element by an index element. #### Parameters | | | | | --- | --- | --- | | int | $offset | The offset at which to replace | | string | $name | The new name of the element. Optional | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### replaceByProperty(int $offset, string $name = null) Replaces an index element by a property element. #### Parameters | | | | | --- | --- | --- | | int | $offset | The offset at which to replace | | string | $name | The new name of the element. Optional | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\PropertyAccess\Exception\OutOfBoundsException") | If the offset is invalid | ### int getLength() Returns the length of the current path. #### Return Value | | | | --- | --- | | int | The path length | ### [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") getPropertyPath() Returns the current property path. #### Return Value | | | | --- | --- | | [PropertyPathInterface](propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | The constructed property path | ### string \_\_toString() Returns the current property path as string. #### Return Value | | | | --- | --- | | string | The property path as string | symfony NoSuchPropertyException NoSuchPropertyException ======================== class **NoSuchPropertyException** extends [AccessException](accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") Thrown when a property cannot be found. symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\PropertyAccess\Exception\ExceptionInterface") Base InvalidArgumentException for the PropertyAccess component. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Marker interface for the PropertyAccess component. symfony InvalidPropertyPathException InvalidPropertyPathException ============================= class **InvalidPropertyPathException** extends [RuntimeException](runtimeexception "Symfony\Component\PropertyAccess\Exception\RuntimeException") Thrown when a property path is malformed. symfony NoSuchIndexException NoSuchIndexException ===================== class **NoSuchIndexException** extends [AccessException](accessexception "Symfony\Component\PropertyAccess\Exception\AccessException") Thrown when an index cannot be found. symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\PropertyAccess\Exception\ExceptionInterface") Base RuntimeException for the PropertyAccess component. symfony OutOfBoundsException OutOfBoundsException ===================== class **OutOfBoundsException** extends [OutOfBoundsException](http://php.net/OutOfBoundsException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\PropertyAccess\Exception\ExceptionInterface") Base OutOfBoundsException for the PropertyAccess component. symfony AccessException AccessException ================ class **AccessException** extends [RuntimeException](runtimeexception "Symfony\Component\PropertyAccess\Exception\RuntimeException") Thrown when a property path is not available. symfony UnexpectedTypeException UnexpectedTypeException ======================== class **UnexpectedTypeException** extends [RuntimeException](runtimeexception "Symfony\Component\PropertyAccess\Exception\RuntimeException") Thrown when a value does not match an expected type. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(mixed $value, [PropertyPathInterface](../propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $path, int $pathIndex) | | Details ------- ### \_\_construct(mixed $value, [PropertyPathInterface](../propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") $path, int $pathIndex) #### Parameters | | | | | --- | --- | --- | | mixed | $value | The unexpected value found while traversing property path | | [PropertyPathInterface](../propertypathinterface "Symfony\Component\PropertyAccess\PropertyPathInterface") | $path | The property path | | int | $pathIndex | The property path index when the unexpected value was found | symfony Client Client ======= abstract class **Client** Client simulates a browser. To make the actual request, you need to implement the doRequest() method. If you want to be able to run requests in their own process (insulated flag), you need to also implement the getScript() method. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $history | | | | protected | $cookieJar | | | | protected | $server | | | | protected | $internalRequest | | | | protected | $request | | | | protected | $internalResponse | | | | protected | $response | | | | protected | $crawler | | | | protected | $insulated | | | | protected | $redirect | | | | protected | $followRedirects | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $server = array(), [History](history "Symfony\Component\BrowserKit\History") $history = null, [CookieJar](cookiejar "Symfony\Component\BrowserKit\CookieJar") $cookieJar = null) | | | | [followRedirects](#method_followRedirects)(bool $followRedirect = true) Sets whether to automatically follow redirects or not. | | | bool | [isFollowingRedirects](#method_isFollowingRedirects)() Returns whether client automatically follows redirects or not. | | | | [setMaxRedirects](#method_setMaxRedirects)(int $maxRedirects) Sets the maximum number of redirects that crawler can follow. | | | int | [getMaxRedirects](#method_getMaxRedirects)() Returns the maximum number of redirects that crawler can follow. | | | | [insulate](#method_insulate)(bool $insulated = true) Sets the insulated flag. | | | | [setServerParameters](#method_setServerParameters)(array $server) Sets server parameters. | | | | [setServerParameter](#method_setServerParameter)(string $key, string $value) Sets single server parameter. | | | string | [getServerParameter](#method_getServerParameter)(string $key, string $default = '') Gets single server parameter for specified key. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [xmlHttpRequest](#method_xmlHttpRequest)(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true) | | | [History](history "Symfony\Component\BrowserKit\History") | [getHistory](#method_getHistory)() Returns the History instance. | | | [CookieJar](cookiejar "Symfony\Component\BrowserKit\CookieJar") | [getCookieJar](#method_getCookieJar)() Returns the CookieJar instance. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [getCrawler](#method_getCrawler)() Returns the current Crawler instance. | | | [Response](response "Symfony\Component\BrowserKit\Response") | [getInternalResponse](#method_getInternalResponse)() Returns the current BrowserKit Response instance. | | | object | [getResponse](#method_getResponse)() Returns the current origin response instance. | | | [Request](request "Symfony\Component\BrowserKit\Request") | [getInternalRequest](#method_getInternalRequest)() Returns the current BrowserKit Request instance. | | | object | [getRequest](#method_getRequest)() Returns the current origin Request instance. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [click](#method_click)([Link](../domcrawler/link "Symfony\Component\DomCrawler\Link") $link) Clicks on a given link. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [submit](#method_submit)([Form](../domcrawler/form "Symfony\Component\DomCrawler\Form") $form, array $values = array()) Submits a form. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [request](#method_request)(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true) Calls a URI. | | | object | [doRequestInProcess](#method_doRequestInProcess)(object $request) Makes a request in another process. | | | object | [doRequest](#method_doRequest)(object $request) Makes a request. | | | | [getScript](#method_getScript)(object $request) Returns the script to execute when the request must be insulated. | | | object | [filterRequest](#method_filterRequest)([Request](request "Symfony\Component\BrowserKit\Request") $request) Filters the BrowserKit request to the origin one. | | | [Response](response "Symfony\Component\BrowserKit\Response") | [filterResponse](#method_filterResponse)(object $response) Filters the origin response to the BrowserKit one. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler")|null | [createCrawlerFromContent](#method_createCrawlerFromContent)(string $uri, string $content, string $type) Creates a crawler. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [back](#method_back)() Goes back in the browser history. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [forward](#method_forward)() Goes forward in the browser history. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [reload](#method_reload)() Reloads the current browser. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [followRedirect](#method_followRedirect)() Follow redirects? | | | | [restart](#method_restart)() Restarts the client. | | | string | [getAbsoluteUri](#method_getAbsoluteUri)(string $uri) Takes a URI and converts it to absolute if it is not already absolute. | | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | [requestFromRequest](#method_requestFromRequest)([Request](request "Symfony\Component\BrowserKit\Request") $request, bool $changeHistory = true) Makes a request from a Request object directly. | | Details ------- ### \_\_construct(array $server = array(), [History](history "Symfony\Component\BrowserKit\History") $history = null, [CookieJar](cookiejar "Symfony\Component\BrowserKit\CookieJar") $cookieJar = null) #### Parameters | | | | | --- | --- | --- | | array | $server | The server parameters (equivalent of $\_SERVER) | | [History](history "Symfony\Component\BrowserKit\History") | $history | A History instance to store the browser history | | [CookieJar](cookiejar "Symfony\Component\BrowserKit\CookieJar") | $cookieJar | A CookieJar instance to store the cookies | ### followRedirects(bool $followRedirect = true) Sets whether to automatically follow redirects or not. #### Parameters | | | | | --- | --- | --- | | bool | $followRedirect | Whether to follow redirects | ### bool isFollowingRedirects() Returns whether client automatically follows redirects or not. #### Return Value | | | | --- | --- | | bool | | ### setMaxRedirects(int $maxRedirects) Sets the maximum number of redirects that crawler can follow. #### Parameters | | | | | --- | --- | --- | | int | $maxRedirects | | ### int getMaxRedirects() Returns the maximum number of redirects that crawler can follow. #### Return Value | | | | --- | --- | | int | | ### insulate(bool $insulated = true) Sets the insulated flag. #### Parameters | | | | | --- | --- | --- | | bool | $insulated | Whether to insulate the requests or not | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When Symfony Process Component is not installed | ### setServerParameters(array $server) Sets server parameters. #### Parameters | | | | | --- | --- | --- | | array | $server | An array of server parameters | ### setServerParameter(string $key, string $value) Sets single server parameter. #### Parameters | | | | | --- | --- | --- | | string | $key | A key of the parameter | | string | $value | A value of the parameter | ### string getServerParameter(string $key, string $default = '') Gets single server parameter for specified key. #### Parameters | | | | | --- | --- | --- | | string | $key | A key of the parameter to get | | string | $default | A default value when key is undefined | #### Return Value | | | | --- | --- | | string | A value of the parameter | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") xmlHttpRequest(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true) #### Parameters | | | | | --- | --- | --- | | string | $method | | | string | $uri | | | array | $parameters | | | array | $files | | | array | $server | | | string | $content | | | bool | $changeHistory | | #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### [History](history "Symfony\Component\BrowserKit\History") getHistory() Returns the History instance. #### Return Value | | | | --- | --- | | [History](history "Symfony\Component\BrowserKit\History") | A History instance | ### [CookieJar](cookiejar "Symfony\Component\BrowserKit\CookieJar") getCookieJar() Returns the CookieJar instance. #### Return Value | | | | --- | --- | | [CookieJar](cookiejar "Symfony\Component\BrowserKit\CookieJar") | A CookieJar instance | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") getCrawler() Returns the current Crawler instance. #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | A Crawler instance | ### [Response](response "Symfony\Component\BrowserKit\Response") getInternalResponse() Returns the current BrowserKit Response instance. #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\BrowserKit\Response") | A BrowserKit Response instance | ### object getResponse() Returns the current origin response instance. The origin response is the response instance that is returned by the code that handles requests. #### Return Value | | | | --- | --- | | object | A response instance | #### See also | | | | --- | --- | | doRequest() | | ### [Request](request "Symfony\Component\BrowserKit\Request") getInternalRequest() Returns the current BrowserKit Request instance. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | A BrowserKit Request instance | ### object getRequest() Returns the current origin Request instance. The origin request is the request instance that is sent to the code that handles requests. #### Return Value | | | | --- | --- | | object | A Request instance | #### See also | | | | --- | --- | | doRequest() | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") click([Link](../domcrawler/link "Symfony\Component\DomCrawler\Link") $link) Clicks on a given link. #### Parameters | | | | | --- | --- | --- | | [Link](../domcrawler/link "Symfony\Component\DomCrawler\Link") | $link | | #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") submit([Form](../domcrawler/form "Symfony\Component\DomCrawler\Form") $form, array $values = array()) Submits a form. #### Parameters | | | | | --- | --- | --- | | [Form](../domcrawler/form "Symfony\Component\DomCrawler\Form") | $form | | | array | $values | | #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true) Calls a URI. #### Parameters | | | | | --- | --- | --- | | string | $method | The request method | | string | $uri | The URI to fetch | | array | $parameters | The Request parameters | | array | $files | The files | | array | $server | The server parameters (HTTP headers are referenced with a HTTP\_ prefix as PHP does) | | string | $content | The raw body data | | bool | $changeHistory | Whether to update the history or not (only used internally for back(), forward(), and reload()) | #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### protected object doRequestInProcess(object $request) Makes a request in another process. #### Parameters | | | | | --- | --- | --- | | object | $request | An origin request instance | #### Return Value | | | | --- | --- | | object | An origin response instance | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When processing returns exit code | ### abstract protected object doRequest(object $request) Makes a request. #### Parameters | | | | | --- | --- | --- | | object | $request | An origin request instance | #### Return Value | | | | --- | --- | | object | An origin response instance | ### protected getScript(object $request) Returns the script to execute when the request must be insulated. #### Parameters | | | | | --- | --- | --- | | object | $request | An origin request instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When this abstract class is not implemented | ### protected object filterRequest([Request](request "Symfony\Component\BrowserKit\Request") $request) Filters the BrowserKit request to the origin one. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | $request | The BrowserKit Request to filter | #### Return Value | | | | --- | --- | | object | An origin request instance | ### protected [Response](response "Symfony\Component\BrowserKit\Response") filterResponse(object $response) Filters the origin response to the BrowserKit one. #### Parameters | | | | | --- | --- | --- | | object | $response | The origin response to filter | #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\BrowserKit\Response") | An BrowserKit Response instance | ### protected [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler")|null createCrawlerFromContent(string $uri, string $content, string $type) Creates a crawler. This method returns null if the DomCrawler component is not available. #### Parameters | | | | | --- | --- | --- | | string | $uri | A URI | | string | $content | Content for the crawler to use | | string | $type | Content type | #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler")|null | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") back() Goes back in the browser history. #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") forward() Goes forward in the browser history. #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") reload() Reloads the current browser. #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") followRedirect() Follow redirects? #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If request was not a redirect | ### restart() Restarts the client. It flushes history and all cookies. ### protected string getAbsoluteUri(string $uri) Takes a URI and converts it to absolute if it is not already absolute. #### Parameters | | | | | --- | --- | --- | | string | $uri | A URI | #### Return Value | | | | --- | --- | | string | An absolute URI | ### protected [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") requestFromRequest([Request](request "Symfony\Component\BrowserKit\Request") $request, bool $changeHistory = true) Makes a request from a Request object directly. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | $request | A Request instance | | bool | $changeHistory | Whether to update the history or not (only used internally for back(), forward(), and reload()) | #### Return Value | | | | --- | --- | | [Crawler](../domcrawler/crawler "Symfony\Component\DomCrawler\Crawler") | |
programming_docs
symfony Response Response ========= class **Response** Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $content | | | | protected | $status | | | | protected | $headers | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $content = '', int $status = 200, array $headers = array()) The headers array is a set of key/value pairs. If a header is present multiple times then the value is an array of all the values. | | | string | [\_\_toString](#method___toString)() Converts the response object to string containing all headers and the response content. | | | string | [buildHeader](#method_buildHeader)(string $name, string $value) Returns the build header line. | | | string | [getContent](#method_getContent)() Gets the response content. | | | int | [getStatus](#method_getStatus)() Gets the response status code. | | | array | [getHeaders](#method_getHeaders)() Gets the response headers. | | | string|array | [getHeader](#method_getHeader)(string $header, bool $first = true) Gets a response header. | | Details ------- ### \_\_construct(string $content = '', int $status = 200, array $headers = array()) The headers array is a set of key/value pairs. If a header is present multiple times then the value is an array of all the values. #### Parameters | | | | | --- | --- | --- | | string | $content | The content of the response | | int | $status | The response status code | | array | $headers | An array of headers | ### string \_\_toString() Converts the response object to string containing all headers and the response content. #### Return Value | | | | --- | --- | | string | The response with headers and content | ### protected string buildHeader(string $name, string $value) Returns the build header line. #### Parameters | | | | | --- | --- | --- | | string | $name | The header name | | string | $value | The header value | #### Return Value | | | | --- | --- | | string | The built header line | ### string getContent() Gets the response content. #### Return Value | | | | --- | --- | | string | The response content | ### int getStatus() Gets the response status code. #### Return Value | | | | --- | --- | | int | The response status code | ### array getHeaders() Gets the response headers. #### Return Value | | | | --- | --- | | array | The response headers | ### string|array getHeader(string $header, bool $first = true) Gets a response header. #### Parameters | | | | | --- | --- | --- | | string | $header | The header name | | bool | $first | Whether to return the first value or all header values | #### Return Value | | | | --- | --- | | string|array | The first header value if $first is true, an array of values otherwise | symfony Symfony\Component\BrowserKit\Exception Symfony\Component\BrowserKit\Exception ====================================== Classes ------- | | | | --- | --- | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\BrowserKit\Exception\BadMethodCallException") | | symfony History History ======== class **History** History. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $stack | | | | protected | $position | | | Methods ------- | | | | | --- | --- | --- | | | [clear](#method_clear)() Clears the history. | | | | [add](#method_add)([Request](request "Symfony\Component\BrowserKit\Request") $request) Adds a Request to the history. | | | bool | [isEmpty](#method_isEmpty)() Returns true if the history is empty. | | | [Request](request "Symfony\Component\BrowserKit\Request") | [back](#method_back)() Goes back in the history. | | | [Request](request "Symfony\Component\BrowserKit\Request") | [forward](#method_forward)() Goes forward in the history. | | | [Request](request "Symfony\Component\BrowserKit\Request") | [current](#method_current)() Returns the current element in the history. | | Details ------- ### clear() Clears the history. ### add([Request](request "Symfony\Component\BrowserKit\Request") $request) Adds a Request to the history. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | $request | | ### bool isEmpty() Returns true if the history is empty. #### Return Value | | | | --- | --- | | bool | true if the history is empty, false otherwise | ### [Request](request "Symfony\Component\BrowserKit\Request") back() Goes back in the history. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | A Request instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if the stack is already on the first page | ### [Request](request "Symfony\Component\BrowserKit\Request") forward() Goes forward in the history. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | A Request instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if the stack is already on the last page | ### [Request](request "Symfony\Component\BrowserKit\Request") current() Returns the current element in the history. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\BrowserKit\Request") | A Request instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if the stack is empty | symfony CookieJar CookieJar ========== class **CookieJar** CookieJar. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $cookieJar | | | Methods ------- | | | | | --- | --- | --- | | | [set](#method_set)([Cookie](cookie "Symfony\Component\BrowserKit\Cookie") $cookie) | | | [Cookie](cookie "Symfony\Component\BrowserKit\Cookie")|null | [get](#method_get)(string $name, string $path = '/', string $domain = null) Gets a cookie by name. | | | | [expire](#method_expire)(string $name, string $path = '/', string $domain = null) Removes a cookie by name. | | | | [clear](#method_clear)() Removes all the cookies from the jar. | | | | [updateFromSetCookie](#method_updateFromSetCookie)(array $setCookies, string $uri = null) Updates the cookie jar from a response Set-Cookie headers. | | | | [updateFromResponse](#method_updateFromResponse)([Response](response "Symfony\Component\BrowserKit\Response") $response, string $uri = null) Updates the cookie jar from a Response object. | | | [Cookie](cookie "Symfony\Component\BrowserKit\Cookie")[] | [all](#method_all)() Returns not yet expired cookies. | | | array | [allValues](#method_allValues)(string $uri, bool $returnsRawValue = false) Returns not yet expired cookie values for the given URI. | | | array | [allRawValues](#method_allRawValues)(string $uri) Returns not yet expired raw cookie values for the given URI. | | | | [flushExpiredCookies](#method_flushExpiredCookies)() Removes all expired cookies. | | Details ------- ### set([Cookie](cookie "Symfony\Component\BrowserKit\Cookie") $cookie) #### Parameters | | | | | --- | --- | --- | | [Cookie](cookie "Symfony\Component\BrowserKit\Cookie") | $cookie | | ### [Cookie](cookie "Symfony\Component\BrowserKit\Cookie")|null get(string $name, string $path = '/', string $domain = null) Gets a cookie by name. You should never use an empty domain, but if you do so, this method returns the first cookie for the given name/path (this behavior ensures a BC behavior with previous versions of Symfony). #### Parameters | | | | | --- | --- | --- | | string | $name | The cookie name | | string | $path | The cookie path | | string | $domain | The cookie domain | #### Return Value | | | | --- | --- | | [Cookie](cookie "Symfony\Component\BrowserKit\Cookie")|null | A Cookie instance or null if the cookie does not exist | ### expire(string $name, string $path = '/', string $domain = null) Removes a cookie by name. You should never use an empty domain, but if you do so, all cookies for the given name/path expire (this behavior ensures a BC behavior with previous versions of Symfony). #### Parameters | | | | | --- | --- | --- | | string | $name | The cookie name | | string | $path | The cookie path | | string | $domain | The cookie domain | ### clear() Removes all the cookies from the jar. ### updateFromSetCookie(array $setCookies, string $uri = null) Updates the cookie jar from a response Set-Cookie headers. #### Parameters | | | | | --- | --- | --- | | array | $setCookies | Set-Cookie headers from an HTTP response | | string | $uri | The base URL | ### updateFromResponse([Response](response "Symfony\Component\BrowserKit\Response") $response, string $uri = null) Updates the cookie jar from a Response object. #### Parameters | | | | | --- | --- | --- | | [Response](response "Symfony\Component\BrowserKit\Response") | $response | A Response object | | string | $uri | The base URL | ### [Cookie](cookie "Symfony\Component\BrowserKit\Cookie")[] all() Returns not yet expired cookies. #### Return Value | | | | --- | --- | | [Cookie](cookie "Symfony\Component\BrowserKit\Cookie")[] | An array of cookies | ### array allValues(string $uri, bool $returnsRawValue = false) Returns not yet expired cookie values for the given URI. #### Parameters | | | | | --- | --- | --- | | string | $uri | A URI | | bool | $returnsRawValue | Returns raw value or urldecoded value | #### Return Value | | | | --- | --- | | array | An array of cookie values | ### array allRawValues(string $uri) Returns not yet expired raw cookie values for the given URI. #### Parameters | | | | | --- | --- | --- | | string | $uri | A URI | #### Return Value | | | | --- | --- | | array | An array of cookie values | ### flushExpiredCookies() Removes all expired cookies. symfony Cookie Cookie ======= class **Cookie** Cookie represents an HTTP cookie. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | | | protected | $value | | | | protected | $expires | | | | protected | $path | | | | protected | $domain | | | | protected | $secure | | | | protected | $httponly | | | | protected | $rawValue | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, string|null $value, string $expires = null, string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false) Sets a cookie. | | | | [\_\_toString](#method___toString)() Returns the HTTP representation of the Cookie. | | | static [Cookie](cookie "Symfony\Component\BrowserKit\Cookie") | [fromString](#method_fromString)(string $cookie, string|null $url = null) Creates a Cookie instance from a Set-Cookie header value. | | | string | [getName](#method_getName)() Gets the name of the cookie. | | | string | [getValue](#method_getValue)() Gets the value of the cookie. | | | string | [getRawValue](#method_getRawValue)() Gets the raw value of the cookie. | | | string|null | [getExpiresTime](#method_getExpiresTime)() Gets the expires time of the cookie. | | | string | [getPath](#method_getPath)() Gets the path of the cookie. | | | string | [getDomain](#method_getDomain)() Gets the domain of the cookie. | | | bool | [isSecure](#method_isSecure)() Returns the secure flag of the cookie. | | | bool | [isHttpOnly](#method_isHttpOnly)() Returns the httponly flag of the cookie. | | | bool | [isExpired](#method_isExpired)() Returns true if the cookie has expired. | | Details ------- ### \_\_construct(string $name, string|null $value, string $expires = null, string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false) Sets a cookie. #### Parameters | | | | | --- | --- | --- | | string | $name | The cookie name | | string|null | $value | The value of the cookie | | string | $expires | The time the cookie expires | | string | $path | The path on the server in which the cookie will be available on | | string | $domain | The domain that the cookie is available | | bool | $secure | Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client | | bool | $httponly | The cookie httponly flag | | bool | $encodedValue | Whether the value is encoded or not | ### \_\_toString() Returns the HTTP representation of the Cookie. ### static [Cookie](cookie "Symfony\Component\BrowserKit\Cookie") fromString(string $cookie, string|null $url = null) Creates a Cookie instance from a Set-Cookie header value. #### Parameters | | | | | --- | --- | --- | | string | $cookie | A Set-Cookie header value | | string|null | $url | The base URL | #### Return Value | | | | --- | --- | | [Cookie](cookie "Symfony\Component\BrowserKit\Cookie") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string getName() Gets the name of the cookie. #### Return Value | | | | --- | --- | | string | The cookie name | ### string getValue() Gets the value of the cookie. #### Return Value | | | | --- | --- | | string | The cookie value | ### string getRawValue() Gets the raw value of the cookie. #### Return Value | | | | --- | --- | | string | The cookie value | ### string|null getExpiresTime() Gets the expires time of the cookie. #### Return Value | | | | --- | --- | | string|null | The cookie expires time | ### string getPath() Gets the path of the cookie. #### Return Value | | | | --- | --- | | string | The cookie path | ### string getDomain() Gets the domain of the cookie. #### Return Value | | | | --- | --- | | string | The cookie domain | ### bool isSecure() Returns the secure flag of the cookie. #### Return Value | | | | --- | --- | | bool | The cookie secure flag | ### bool isHttpOnly() Returns the httponly flag of the cookie. #### Return Value | | | | --- | --- | | bool | The cookie httponly flag | ### bool isExpired() Returns true if the cookie has expired. #### Return Value | | | | --- | --- | | bool | true if the cookie has expired, false otherwise | symfony Request Request ======== class **Request** Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $uri | | | | protected | $method | | | | protected | $parameters | | | | protected | $files | | | | protected | $cookies | | | | protected | $server | | | | protected | $content | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $uri, string $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), string $content = null) | | | string | [getUri](#method_getUri)() Gets the request URI. | | | string | [getMethod](#method_getMethod)() Gets the request HTTP method. | | | array | [getParameters](#method_getParameters)() Gets the request parameters. | | | array | [getFiles](#method_getFiles)() Gets the request server files. | | | array | [getCookies](#method_getCookies)() Gets the request cookies. | | | array | [getServer](#method_getServer)() Gets the request server parameters. | | | string | [getContent](#method_getContent)() Gets the request raw body data. | | Details ------- ### \_\_construct(string $uri, string $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), string $content = null) #### Parameters | | | | | --- | --- | --- | | string | $uri | The request URI | | string | $method | The HTTP method request | | array | $parameters | The request parameters | | array | $files | An array of uploaded files | | array | $cookies | An array of cookies | | array | $server | An array of server parameters | | string | $content | The raw body data | ### string getUri() Gets the request URI. #### Return Value | | | | --- | --- | | string | The request URI | ### string getMethod() Gets the request HTTP method. #### Return Value | | | | --- | --- | | string | The request HTTP method | ### array getParameters() Gets the request parameters. #### Return Value | | | | --- | --- | | array | The request parameters | ### array getFiles() Gets the request server files. #### Return Value | | | | --- | --- | | array | The request files | ### array getCookies() Gets the request cookies. #### Return Value | | | | --- | --- | | array | The request cookies | ### array getServer() Gets the request server parameters. #### Return Value | | | | --- | --- | | array | The request server parameters | ### string getContent() Gets the request raw body data. #### Return Value | | | | --- | --- | | string | The request raw body data | symfony BadMethodCallException BadMethodCallException ======================= class **BadMethodCallException** extends [BadMethodCallException](http://php.net/BadMethodCallException) symfony Envelope Envelope ========= class **Envelope** A message wrapped in an envelope with items (configurations, markers, . ..). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(object $message, array $items = array()) | | | static [Envelope](envelope "Symfony\Component\Messenger\Envelope") | [wrap](#method_wrap)([Envelope](envelope "Symfony\Component\Messenger\Envelope")|object $message) Wrap a message into an envelope if not already wrapped. | | | [Envelope](envelope "Symfony\Component\Messenger\Envelope") | [with](#method_with)([EnvelopeItemInterface](envelopeiteminterface "Symfony\Component\Messenger\EnvelopeItemInterface") $item) | | | [Envelope](envelope "Symfony\Component\Messenger\Envelope") | [withMessage](#method_withMessage)($message) | | | EnvelopeItemInterface|null | [get](#method_get)(string $itemFqcn) | | | array | [all](#method_all)() | | | object | [getMessage](#method_getMessage)() | | Details ------- ### \_\_construct(object $message, array $items = array()) #### Parameters | | | | | --- | --- | --- | | object | $message | | | array | $items | | ### static [Envelope](envelope "Symfony\Component\Messenger\Envelope") wrap([Envelope](envelope "Symfony\Component\Messenger\Envelope")|object $message) Wrap a message into an envelope if not already wrapped. #### Parameters | | | | | --- | --- | --- | | [Envelope](envelope "Symfony\Component\Messenger\Envelope")|object | $message | | #### Return Value | | | | --- | --- | | [Envelope](envelope "Symfony\Component\Messenger\Envelope") | | ### [Envelope](envelope "Symfony\Component\Messenger\Envelope") with([EnvelopeItemInterface](envelopeiteminterface "Symfony\Component\Messenger\EnvelopeItemInterface") $item) #### Parameters | | | | | --- | --- | --- | | [EnvelopeItemInterface](envelopeiteminterface "Symfony\Component\Messenger\EnvelopeItemInterface") | $item | | #### Return Value | | | | --- | --- | | [Envelope](envelope "Symfony\Component\Messenger\Envelope") | a new Envelope instance with additional item | ### [Envelope](envelope "Symfony\Component\Messenger\Envelope") withMessage($message) #### Parameters | | | | | --- | --- | --- | | | $message | | #### Return Value | | | | --- | --- | | [Envelope](envelope "Symfony\Component\Messenger\Envelope") | | ### EnvelopeItemInterface|null get(string $itemFqcn) #### Parameters | | | | | --- | --- | --- | | string | $itemFqcn | | #### Return Value | | | | --- | --- | | EnvelopeItemInterface|null | | ### array all() #### Return Value | | | | --- | --- | | array | indexed by fqcn | ### object getMessage() #### Return Value | | | | --- | --- | | object | The original message contained in the envelope |
programming_docs
symfony Symfony\Component\Messenger\Asynchronous Symfony\Component\Messenger\Asynchronous ======================================== Namespaces ---------- [Symfony\Component\Messenger\Asynchronous\Middleware](asynchronous/middleware)[Symfony\Component\Messenger\Asynchronous\Routing](asynchronous/routing)[Symfony\Component\Messenger\Asynchronous\Transport](asynchronous/transport) symfony Symfony\Component\Messenger\Exception Symfony\Component\Messenger\Exception ===================================== Classes ------- | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Messenger\Exception\InvalidArgumentException") | | | [NoHandlerForMessageException](exception/nohandlerformessageexception "Symfony\Component\Messenger\Exception\NoHandlerForMessageException") | | | [ValidationFailedException](exception/validationfailedexception "Symfony\Component\Messenger\Exception\ValidationFailedException") | | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Messenger\Exception\ExceptionInterface")* | Base Message component's exception. | symfony MessageBus MessageBus =========== class **MessageBus** implements [MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $middlewareHandlers = array()) | | | mixed | [dispatch](#method_dispatch)(object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") $message) Dispatches the given message. | | Details ------- ### \_\_construct(iterable $middlewareHandlers = array()) #### Parameters | | | | | --- | --- | --- | | iterable | $middlewareHandlers | | ### mixed dispatch(object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") $message) Dispatches the given message. The bus can return a value coming from handlers, but is not required to do so. #### Parameters | | | | | --- | --- | --- | | object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") | $message | The message or the message pre-wrapped in an envelope | #### Return Value | | | | --- | --- | | mixed | | symfony MessageBusInterface MessageBusInterface ==================== interface **MessageBusInterface** Methods ------- | | | | | --- | --- | --- | | mixed | [dispatch](#method_dispatch)(object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") $message) Dispatches the given message. | | Details ------- ### mixed dispatch(object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") $message) Dispatches the given message. The bus can return a value coming from handlers, but is not required to do so. #### Parameters | | | | | --- | --- | --- | | object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") | $message | The message or the message pre-wrapped in an envelope | #### Return Value | | | | --- | --- | | mixed | | symfony Symfony\Component\Messenger\Handler Symfony\Component\Messenger\Handler =================================== Namespaces ---------- [Symfony\Component\Messenger\Handler\Locator](handler/locator) Classes ------- | | | | --- | --- | | [ChainHandler](handler/chainhandler "Symfony\Component\Messenger\Handler\ChainHandler") | Represents a collection of message handlers. | Interfaces ---------- | | | | --- | --- | | *[MessageHandlerInterface](handler/messagehandlerinterface "Symfony\Component\Messenger\Handler\MessageHandlerInterface")* | Marker interface for message handlers. | | *[MessageSubscriberInterface](handler/messagesubscriberinterface "Symfony\Component\Messenger\Handler\MessageSubscriberInterface")* | Handlers can implement this interface to handle multiple messages. | symfony Symfony\Component\Messenger\DataCollector Symfony\Component\Messenger\DataCollector ========================================= Classes ------- | | | | --- | --- | | [MessengerDataCollector](datacollector/messengerdatacollector "Symfony\Component\Messenger\DataCollector\MessengerDataCollector") | | symfony Symfony\Component\Messenger\Middleware Symfony\Component\Messenger\Middleware ====================================== Namespaces ---------- [Symfony\Component\Messenger\Middleware\Configuration](middleware/configuration) Classes ------- | | | | --- | --- | | [AllowNoHandlerMiddleware](middleware/allownohandlermiddleware "Symfony\Component\Messenger\Middleware\AllowNoHandlerMiddleware") | | | [HandleMessageMiddleware](middleware/handlemessagemiddleware "Symfony\Component\Messenger\Middleware\HandleMessageMiddleware") | | | [LoggingMiddleware](middleware/loggingmiddleware "Symfony\Component\Messenger\Middleware\LoggingMiddleware") | | | [ValidationMiddleware](middleware/validationmiddleware "Symfony\Component\Messenger\Middleware\ValidationMiddleware") | | Interfaces ---------- | | | | --- | --- | | *[MiddlewareInterface](middleware/middlewareinterface "Symfony\Component\Messenger\Middleware\MiddlewareInterface")* | | symfony Symfony\Component\Messenger\Transport Symfony\Component\Messenger\Transport ===================================== Namespaces ---------- [Symfony\Component\Messenger\Transport\AmqpExt](transport/amqpext)[Symfony\Component\Messenger\Transport\Enhancers](transport/enhancers)[Symfony\Component\Messenger\Transport\Serialization](transport/serialization) Classes ------- | | | | --- | --- | | [ChainSender](transport/chainsender "Symfony\Component\Messenger\Transport\ChainSender") | | | [TransportFactory](transport/transportfactory "Symfony\Component\Messenger\Transport\TransportFactory") | | Interfaces ---------- | | | | --- | --- | | *[ReceiverInterface](transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface")* | | | *[SenderInterface](transport/senderinterface "Symfony\Component\Messenger\Transport\SenderInterface")* | | | *[TransportFactoryInterface](transport/transportfactoryinterface "Symfony\Component\Messenger\Transport\TransportFactoryInterface")* | Creates a Messenger transport. | | *[TransportInterface](transport/transportinterface "Symfony\Component\Messenger\Transport\TransportInterface")* | | symfony Symfony\Component\Messenger\Command Symfony\Component\Messenger\Command =================================== Classes ------- | | | | --- | --- | | [ConsumeMessagesCommand](command/consumemessagescommand "Symfony\Component\Messenger\Command\ConsumeMessagesCommand") | | | [DebugCommand](command/debugcommand "Symfony\Component\Messenger\Command\DebugCommand") | A console command to debug Messenger information. | symfony EnvelopeItemInterface EnvelopeItemInterface ====================== interface **EnvelopeItemInterface** implements [Serializable](http://php.net/Serializable) An envelope item related to a message. This item must be serializable for transport. symfony Worker Worker ======= class **Worker** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ReceiverInterface](transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $receiver, [MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") $bus) | | | | [run](#method_run)() Receive the messages and dispatch them to the bus. | | Details ------- ### \_\_construct([ReceiverInterface](transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $receiver, [MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") $bus) #### Parameters | | | | | --- | --- | --- | | [ReceiverInterface](transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") | $receiver | | | [MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") | $bus | | ### run() Receive the messages and dispatch them to the bus. symfony EnvelopeAwareInterface EnvelopeAwareInterface ======================= interface **EnvelopeAwareInterface** A Messenger protagonist aware of the message envelope and its content. symfony TraceableMessageBus TraceableMessageBus ==================== class **TraceableMessageBus** implements [MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") $decoratedBus) | | | mixed | [dispatch](#method_dispatch)(object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") $message) Dispatches the given message. | | | array | [getDispatchedMessages](#method_getDispatchedMessages)() | | | | [reset](#method_reset)() | | Details ------- ### \_\_construct([MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") $decoratedBus) #### Parameters | | | | | --- | --- | --- | | [MessageBusInterface](messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") | $decoratedBus | | ### mixed dispatch(object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") $message) Dispatches the given message. The bus can return a value coming from handlers, but is not required to do so. #### Parameters | | | | | --- | --- | --- | | object|[Envelope](envelope "Symfony\Component\Messenger\Envelope") | $message | The message or the message pre-wrapped in an envelope | #### Return Value | | | | --- | --- | | mixed | | ### array getDispatchedMessages() #### Return Value | | | | --- | --- | | array | | ### reset() symfony Symfony\Component\Messenger\DependencyInjection Symfony\Component\Messenger\DependencyInjection =============================================== Classes ------- | | | | --- | --- | | [MessengerPass](dependencyinjection/messengerpass "Symfony\Component\Messenger\DependencyInjection\MessengerPass") | | symfony MessengerDataCollector MessengerDataCollector ======================= class **MessengerDataCollector** extends [DataCollector](../../httpkernel/datacollector/datacollector "Symfony\Component\HttpKernel\DataCollector\DataCollector") implements [LateDataCollectorInterface](../../httpkernel/datacollector/latedatacollectorinterface "Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $data | | from [DataCollector](../../httpkernel/datacollector/datacollector#property_data "Symfony\Component\HttpKernel\DataCollector\DataCollector") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [DataCollector](../../httpkernel/datacollector/datacollector#method_serialize "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | | [unserialize](#method_unserialize)($data) | from [DataCollector](../../httpkernel/datacollector/datacollector#method_unserialize "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | [Data](../../vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | [cloneVar](#method_cloneVar)(mixed $var) Converts the variable into a serializable Data instance. | from [DataCollector](../../httpkernel/datacollector/datacollector#method_cloneVar "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | callable[] | [getCasters](#method_getCasters)() | from [DataCollector](../../httpkernel/datacollector/datacollector#method_getCasters "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | | [registerBus](#method_registerBus)(string $name, [TraceableMessageBus](../traceablemessagebus "Symfony\Component\Messenger\TraceableMessageBus") $bus) | | | | [collect](#method_collect)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [Exception](http://php.net/Exception) $exception = null) Collects data for the given Request and Response. | | | | [lateCollect](#method_lateCollect)() Collects data as late as possible. | | | string | [getName](#method_getName)() Returns the name of the collector. | | | | [reset](#method_reset)() Resets this data collector to its initial state. | | | int | [getExceptionsCount](#method_getExceptionsCount)(string $bus = null) | | | array | [getMessages](#method_getMessages)(string $bus = null) | | | array | [getBuses](#method_getBuses)() | | Details ------- ### serialize() ### unserialize($data) #### Parameters | | | | | --- | --- | --- | | | $data | | ### protected [Data](../../vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") cloneVar(mixed $var) Converts the variable into a serializable Data instance. This array can be displayed in the template using the VarDumper component. #### Parameters | | | | | --- | --- | --- | | mixed | $var | | #### Return Value | | | | --- | --- | | [Data](../../vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | | ### protected callable[] getCasters() #### Return Value | | | | --- | --- | | callable[] | The casters to add to the cloner | ### registerBus(string $name, [TraceableMessageBus](../traceablemessagebus "Symfony\Component\Messenger\TraceableMessageBus") $bus) #### Parameters | | | | | --- | --- | --- | | string | $name | | | [TraceableMessageBus](../traceablemessagebus "Symfony\Component\Messenger\TraceableMessageBus") | $bus | | ### collect([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [Exception](http://php.net/Exception) $exception = null) Collects data for the given Request and Response. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [Exception](http://php.net/Exception) | $exception | | ### lateCollect() Collects data as late as possible. ### string getName() Returns the name of the collector. #### Return Value | | | | --- | --- | | string | The collector name | ### reset() Resets this data collector to its initial state. ### int getExceptionsCount(string $bus = null) #### Parameters | | | | | --- | --- | --- | | string | $bus | | #### Return Value | | | | --- | --- | | int | | ### array getMessages(string $bus = null) #### Parameters | | | | | --- | --- | --- | | string | $bus | | #### Return Value | | | | --- | --- | | array | | ### array getBuses() #### Return Value | | | | --- | --- | | array | | symfony Symfony\Component\Messenger\Handler\Locator Symfony\Component\Messenger\Handler\Locator =========================================== Classes ------- | | | | --- | --- | | [ContainerHandlerLocator](locator/containerhandlerlocator "Symfony\Component\Messenger\Handler\Locator\ContainerHandlerLocator") | | | [HandlerLocator](locator/handlerlocator "Symfony\Component\Messenger\Handler\Locator\HandlerLocator") | | Interfaces ---------- | | | | --- | --- | | *[HandlerLocatorInterface](locator/handlerlocatorinterface "Symfony\Component\Messenger\Handler\Locator\HandlerLocatorInterface")* | | symfony MessageSubscriberInterface MessageSubscriberInterface =========================== interface **MessageSubscriberInterface** implements [MessageHandlerInterface](messagehandlerinterface "Symfony\Component\Messenger\Handler\MessageHandlerInterface") Handlers can implement this interface to handle multiple messages. Methods ------- | | | | | --- | --- | --- | | static iterable | [getHandledMessages](#method_getHandledMessages)() Returns a list of messages to be handled. | | Details ------- ### static iterable getHandledMessages() Returns a list of messages to be handled. It returns a list of messages like in the following example: ``` return [MyMessage::class]; ``` It can also change the priority per classes. ``` return [ [FirstMessage::class, 0], [SecondMessage::class, -10], ]; ``` It can also specify a method and/or a priority per message: ``` return [ FirstMessage::class => 'firstMessageMethod', SecondMessage::class => ['secondMessageMethod', 20], ]; ``` The `__invoke` method of the handler will be called as usual with the message to handle. #### Return Value | | | | --- | --- | | iterable | | symfony MessageHandlerInterface MessageHandlerInterface ======================== interface **MessageHandlerInterface** Marker interface for message handlers. symfony ChainHandler ChainHandler ============= class **ChainHandler** Represents a collection of message handlers. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $handlers) | | | | [\_\_invoke](#method___invoke)($message) | | Details ------- ### \_\_construct(array $handlers) #### Parameters | | | | | --- | --- | --- | | array | $handlers | | ### \_\_invoke($message) #### Parameters | | | | | --- | --- | --- | | | $message | | symfony ContainerHandlerLocator ContainerHandlerLocator ======================== class **ContainerHandlerLocator** implements [HandlerLocatorInterface](handlerlocatorinterface "Symfony\Component\Messenger\Handler\Locator\HandlerLocatorInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(ContainerInterface $container) | | | callable | [resolve](#method_resolve)(object $message) Returns the handler for the given message. | | Details ------- ### \_\_construct(ContainerInterface $container) #### Parameters | | | | | --- | --- | --- | | ContainerInterface | $container | | ### callable resolve(object $message) Returns the handler for the given message. #### Parameters | | | | | --- | --- | --- | | object | $message | | #### Return Value | | | | --- | --- | | callable | | #### Exceptions | | | | --- | --- | | [NoHandlerForMessageException](../../exception/nohandlerformessageexception "Symfony\Component\Messenger\Exception\NoHandlerForMessageException") | | symfony HandlerLocatorInterface HandlerLocatorInterface ======================== interface **HandlerLocatorInterface** Methods ------- | | | | | --- | --- | --- | | callable | [resolve](#method_resolve)(object $message) Returns the handler for the given message. | | Details ------- ### callable resolve(object $message) Returns the handler for the given message. #### Parameters | | | | | --- | --- | --- | | object | $message | | #### Return Value | | | | --- | --- | | callable | | #### Exceptions | | | | --- | --- | | [NoHandlerForMessageException](../../exception/nohandlerformessageexception "Symfony\Component\Messenger\Exception\NoHandlerForMessageException") | | symfony HandlerLocator HandlerLocator =============== class **HandlerLocator** implements [HandlerLocatorInterface](handlerlocatorinterface "Symfony\Component\Messenger\Handler\Locator\HandlerLocatorInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $messageToHandlerMapping = array()) | | | callable | [resolve](#method_resolve)(object $message) Returns the handler for the given message. | | Details ------- ### \_\_construct(array $messageToHandlerMapping = array()) #### Parameters | | | | | --- | --- | --- | | array | $messageToHandlerMapping | | ### callable resolve(object $message) Returns the handler for the given message. #### Parameters | | | | | --- | --- | --- | | object | $message | | #### Return Value | | | | --- | --- | | callable | | #### Exceptions | | | | --- | --- | | [NoHandlerForMessageException](../../exception/nohandlerformessageexception "Symfony\Component\Messenger\Exception\NoHandlerForMessageException") | |
programming_docs
symfony AllowNoHandlerMiddleware AllowNoHandlerMiddleware ========================= class **AllowNoHandlerMiddleware** implements [MiddlewareInterface](middlewareinterface "Symfony\Component\Messenger\Middleware\MiddlewareInterface") Methods ------- | | | | | --- | --- | --- | | mixed | [handle](#method_handle)($message, callable $next) | | Details ------- ### mixed handle($message, callable $next) #### Parameters | | | | | --- | --- | --- | | | $message | | | callable | $next | | #### Return Value | | | | --- | --- | | mixed | | symfony ValidationMiddleware ValidationMiddleware ===================== class **ValidationMiddleware** implements [MiddlewareInterface](middlewareinterface "Symfony\Component\Messenger\Middleware\MiddlewareInterface"), [EnvelopeAwareInterface](../envelopeawareinterface "Symfony\Component\Messenger\EnvelopeAwareInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ValidatorInterface](../../validator/validator/validatorinterface "Symfony\Component\Validator\Validator\ValidatorInterface") $validator) | | | mixed | [handle](#method_handle)($message, callable $next) | | Details ------- ### \_\_construct([ValidatorInterface](../../validator/validator/validatorinterface "Symfony\Component\Validator\Validator\ValidatorInterface") $validator) #### Parameters | | | | | --- | --- | --- | | [ValidatorInterface](../../validator/validator/validatorinterface "Symfony\Component\Validator\Validator\ValidatorInterface") | $validator | | ### mixed handle($message, callable $next) #### Parameters | | | | | --- | --- | --- | | | $message | | | callable | $next | | #### Return Value | | | | --- | --- | | mixed | | symfony HandleMessageMiddleware HandleMessageMiddleware ======================== class **HandleMessageMiddleware** implements [MiddlewareInterface](middlewareinterface "Symfony\Component\Messenger\Middleware\MiddlewareInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([HandlerLocatorInterface](../handler/locator/handlerlocatorinterface "Symfony\Component\Messenger\Handler\Locator\HandlerLocatorInterface") $messageHandlerResolver) | | | mixed | [handle](#method_handle)($message, callable $next) | | Details ------- ### \_\_construct([HandlerLocatorInterface](../handler/locator/handlerlocatorinterface "Symfony\Component\Messenger\Handler\Locator\HandlerLocatorInterface") $messageHandlerResolver) #### Parameters | | | | | --- | --- | --- | | [HandlerLocatorInterface](../handler/locator/handlerlocatorinterface "Symfony\Component\Messenger\Handler\Locator\HandlerLocatorInterface") | $messageHandlerResolver | | ### mixed handle($message, callable $next) #### Parameters | | | | | --- | --- | --- | | | $message | | | callable | $next | | #### Return Value | | | | --- | --- | | mixed | | symfony Symfony\Component\Messenger\Middleware\Configuration Symfony\Component\Messenger\Middleware\Configuration ==================================================== Classes ------- | | | | --- | --- | | [ValidationConfiguration](configuration/validationconfiguration "Symfony\Component\Messenger\Middleware\Configuration\ValidationConfiguration") | | symfony MiddlewareInterface MiddlewareInterface ==================== interface **MiddlewareInterface** Methods ------- | | | | | --- | --- | --- | | mixed | [handle](#method_handle)($message, callable $next) | | Details ------- ### mixed handle($message, callable $next) #### Parameters | | | | | --- | --- | --- | | | $message | | | callable | $next | | #### Return Value | | | | --- | --- | | mixed | | symfony LoggingMiddleware LoggingMiddleware ================== class **LoggingMiddleware** implements [MiddlewareInterface](middlewareinterface "Symfony\Component\Messenger\Middleware\MiddlewareInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(LoggerInterface $logger) | | | mixed | [handle](#method_handle)($message, callable $next) | | Details ------- ### \_\_construct(LoggerInterface $logger) #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | ### mixed handle($message, callable $next) #### Parameters | | | | | --- | --- | --- | | | $message | | | callable | $next | | #### Return Value | | | | --- | --- | | mixed | | symfony ValidationConfiguration ValidationConfiguration ======================== class **ValidationConfiguration** implements [EnvelopeItemInterface](../../envelopeiteminterface "Symfony\Component\Messenger\EnvelopeItemInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string[]|[GroupSequence](../../../validator/constraints/groupsequence "Symfony\Component\Validator\Constraints\GroupSequence") $groups) | | | | [getGroups](#method_getGroups)() | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### \_\_construct(string[]|[GroupSequence](../../../validator/constraints/groupsequence "Symfony\Component\Validator\Constraints\GroupSequence") $groups) #### Parameters | | | | | --- | --- | --- | | string[]|[GroupSequence](../../../validator/constraints/groupsequence "Symfony\Component\Validator\Constraints\GroupSequence") | $groups | | ### getGroups() ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony Symfony\Component\Messenger\Asynchronous\Routing Symfony\Component\Messenger\Asynchronous\Routing ================================================ Classes ------- | | | | --- | --- | | [SenderLocator](routing/senderlocator "Symfony\Component\Messenger\Asynchronous\Routing\SenderLocator") | | Interfaces ---------- | | | | --- | --- | | *[SenderLocatorInterface](routing/senderlocatorinterface "Symfony\Component\Messenger\Asynchronous\Routing\SenderLocatorInterface")* | | symfony Symfony\Component\Messenger\Asynchronous\Middleware Symfony\Component\Messenger\Asynchronous\Middleware =================================================== Classes ------- | | | | --- | --- | | [SendMessageMiddleware](middleware/sendmessagemiddleware "Symfony\Component\Messenger\Asynchronous\Middleware\SendMessageMiddleware") | | symfony Symfony\Component\Messenger\Asynchronous\Transport Symfony\Component\Messenger\Asynchronous\Transport ================================================== Classes ------- | | | | --- | --- | | [ReceivedMessage](transport/receivedmessage "Symfony\Component\Messenger\Asynchronous\Transport\ReceivedMessage") | Marker config for a received message. | | [WrapIntoReceivedMessage](transport/wrapintoreceivedmessage "Symfony\Component\Messenger\Asynchronous\Transport\WrapIntoReceivedMessage") | | symfony SendMessageMiddleware SendMessageMiddleware ====================== class **SendMessageMiddleware** implements [MiddlewareInterface](../../middleware/middlewareinterface "Symfony\Component\Messenger\Middleware\MiddlewareInterface"), [EnvelopeAwareInterface](../../envelopeawareinterface "Symfony\Component\Messenger\EnvelopeAwareInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SenderLocatorInterface](../routing/senderlocatorinterface "Symfony\Component\Messenger\Asynchronous\Routing\SenderLocatorInterface") $senderLocator, array $messagesToSendAndHandleMapping = array()) | | | mixed | [handle](#method_handle)($message, callable $next) | | Details ------- ### \_\_construct([SenderLocatorInterface](../routing/senderlocatorinterface "Symfony\Component\Messenger\Asynchronous\Routing\SenderLocatorInterface") $senderLocator, array $messagesToSendAndHandleMapping = array()) #### Parameters | | | | | --- | --- | --- | | [SenderLocatorInterface](../routing/senderlocatorinterface "Symfony\Component\Messenger\Asynchronous\Routing\SenderLocatorInterface") | $senderLocator | | | array | $messagesToSendAndHandleMapping | | ### mixed handle($message, callable $next) #### Parameters | | | | | --- | --- | --- | | | $message | | | callable | $next | | #### Return Value | | | | --- | --- | | mixed | | symfony ReceivedMessage ReceivedMessage ================ class **ReceivedMessage** implements [EnvelopeItemInterface](../../envelopeiteminterface "Symfony\Component\Messenger\EnvelopeItemInterface") Marker config for a received message. This is mainly used by the `SendMessageMiddleware` middleware to identify a message should not be sent if it was just received. Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony WrapIntoReceivedMessage WrapIntoReceivedMessage ======================== class **WrapIntoReceivedMessage** implements [ReceiverInterface](../../transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ReceiverInterface](../../transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver) | | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | Details ------- ### \_\_construct([ReceiverInterface](../../transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver) #### Parameters | | | | | --- | --- | --- | | [ReceiverInterface](../../transport/receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") | $decoratedReceiver | | ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | symfony SenderLocator SenderLocator ============== class **SenderLocator** implements [SenderLocatorInterface](senderlocatorinterface "Symfony\Component\Messenger\Asynchronous\Routing\SenderLocatorInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(ContainerInterface $senderServiceLocator, array $messageToSenderIdMapping) | | | SenderInterface|null | [getSenderForMessage](#method_getSenderForMessage)(object $message) Gets the sender (if applicable) for the given message object. | | | static | [getValueFromMessageRouting](#method_getValueFromMessageRouting)(array $mapping, $message) | | Details ------- ### \_\_construct(ContainerInterface $senderServiceLocator, array $messageToSenderIdMapping) #### Parameters | | | | | --- | --- | --- | | ContainerInterface | $senderServiceLocator | | | array | $messageToSenderIdMapping | | ### SenderInterface|null getSenderForMessage(object $message) Gets the sender (if applicable) for the given message object. #### Parameters | | | | | --- | --- | --- | | object | $message | | #### Return Value | | | | --- | --- | | SenderInterface|null | | ### static getValueFromMessageRouting(array $mapping, $message) #### Parameters | | | | | --- | --- | --- | | array | $mapping | | | | $message | | symfony SenderLocatorInterface SenderLocatorInterface ======================= interface **SenderLocatorInterface** Methods ------- | | | | | --- | --- | --- | | SenderInterface|null | [getSenderForMessage](#method_getSenderForMessage)(object $message) Gets the sender (if applicable) for the given message object. | | Details ------- ### SenderInterface|null getSenderForMessage(object $message) Gets the sender (if applicable) for the given message object. #### Parameters | | | | | --- | --- | --- | | object | $message | | #### Return Value | | | | --- | --- | | SenderInterface|null | | symfony ReceiverInterface ReceiverInterface ================== interface **ReceiverInterface** Methods ------- | | | | | --- | --- | --- | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | Details ------- ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | symfony TransportInterface TransportInterface =================== interface **TransportInterface** implements [ReceiverInterface](receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface"), [SenderInterface](senderinterface "Symfony\Component\Messenger\Transport\SenderInterface") Methods ------- | | | | | --- | --- | --- | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | from [ReceiverInterface](receiverinterface#method_receive "Symfony\Component\Messenger\Transport\ReceiverInterface") | | void | [stop](#method_stop)() Stop receiving some messages. | from [ReceiverInterface](receiverinterface#method_stop "Symfony\Component\Messenger\Transport\ReceiverInterface") | | | [send](#method_send)([Envelope](../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. | from [SenderInterface](senderinterface#method_send "Symfony\Component\Messenger\Transport\SenderInterface") | Details ------- ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | ### send([Envelope](../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. #### Parameters | | | | | --- | --- | --- | | [Envelope](../envelope "Symfony\Component\Messenger\Envelope") | $envelope | | symfony Symfony\Component\Messenger\Transport\Serialization Symfony\Component\Messenger\Transport\Serialization =================================================== Classes ------- | | | | --- | --- | | [Serializer](serialization/serializer "Symfony\Component\Messenger\Transport\Serialization\Serializer") | | | [SerializerConfiguration](serialization/serializerconfiguration "Symfony\Component\Messenger\Transport\Serialization\SerializerConfiguration") | | Interfaces ---------- | | | | --- | --- | | *[DecoderInterface](serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface")* | | | *[EncoderInterface](serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface")* | | symfony SenderInterface SenderInterface ================ interface **SenderInterface** Methods ------- | | | | | --- | --- | --- | | | [send](#method_send)([Envelope](../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. | | Details ------- ### send([Envelope](../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. #### Parameters | | | | | --- | --- | --- | | [Envelope](../envelope "Symfony\Component\Messenger\Envelope") | $envelope | | symfony TransportFactory TransportFactory ================= class **TransportFactory** implements [TransportFactoryInterface](transportfactoryinterface "Symfony\Component\Messenger\Transport\TransportFactoryInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $factories) | | | [TransportInterface](transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") | [createTransport](#method_createTransport)(string $dsn, array $options) | | | bool | [supports](#method_supports)(string $dsn, array $options) | | Details ------- ### \_\_construct(iterable $factories) #### Parameters | | | | | --- | --- | --- | | iterable | $factories | | ### [TransportInterface](transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") createTransport(string $dsn, array $options) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | #### Return Value | | | | --- | --- | | [TransportInterface](transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") | | ### bool supports(string $dsn, array $options) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\Messenger\Transport\AmqpExt Symfony\Component\Messenger\Transport\AmqpExt ============================================= Namespaces ---------- [Symfony\Component\Messenger\Transport\AmqpExt\Exception](amqpext/exception) Classes ------- | | | | --- | --- | | [AmqpFactory](amqpext/amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") | | | [AmqpReceiver](amqpext/amqpreceiver "Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceiver") | Symfony Messenger receiver to get messages from AMQP brokers using PHP's AMQP extension. | | [AmqpSender](amqpext/amqpsender "Symfony\Component\Messenger\Transport\AmqpExt\AmqpSender") | Symfony Messenger sender to send messages to AMQP brokers using PHP's AMQP extension. | | [AmqpTransport](amqpext/amqptransport "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport") | | | [AmqpTransportFactory](amqpext/amqptransportfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory") | | | [Connection](amqpext/connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") | An AMQP connection. | symfony ChainSender ChainSender ============ class **ChainSender** implements [SenderInterface](senderinterface "Symfony\Component\Messenger\Transport\SenderInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $senders) | | | | [send](#method_send)([Envelope](../envelope "Symfony\Component\Messenger\Envelope") $message) Sends the given envelope. | | Details ------- ### \_\_construct(iterable $senders) #### Parameters | | | | | --- | --- | --- | | iterable | $senders | | ### send([Envelope](../envelope "Symfony\Component\Messenger\Envelope") $message) Sends the given envelope. #### Parameters | | | | | --- | --- | --- | | [Envelope](../envelope "Symfony\Component\Messenger\Envelope") | $message | |
programming_docs
symfony Symfony\Component\Messenger\Transport\Enhancers Symfony\Component\Messenger\Transport\Enhancers =============================================== Classes ------- | | | | --- | --- | | [StopWhenMemoryUsageIsExceededReceiver](enhancers/stopwhenmemoryusageisexceededreceiver "Symfony\Component\Messenger\Transport\Enhancers\StopWhenMemoryUsageIsExceededReceiver") | | | [StopWhenMessageCountIsExceededReceiver](enhancers/stopwhenmessagecountisexceededreceiver "Symfony\Component\Messenger\Transport\Enhancers\StopWhenMessageCountIsExceededReceiver") | | | [StopWhenTimeLimitIsReachedReceiver](enhancers/stopwhentimelimitisreachedreceiver "Symfony\Component\Messenger\Transport\Enhancers\StopWhenTimeLimitIsReachedReceiver") | | symfony TransportFactoryInterface TransportFactoryInterface ========================== interface **TransportFactoryInterface** Creates a Messenger transport. Methods ------- | | | | | --- | --- | --- | | [TransportInterface](transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") | [createTransport](#method_createTransport)(string $dsn, array $options) | | | bool | [supports](#method_supports)(string $dsn, array $options) | | Details ------- ### [TransportInterface](transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") createTransport(string $dsn, array $options) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | #### Return Value | | | | --- | --- | | [TransportInterface](transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") | | ### bool supports(string $dsn, array $options) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | #### Return Value | | | | --- | --- | | bool | | symfony AmqpFactory AmqpFactory ============ class **AmqpFactory** Methods ------- | | | | | --- | --- | --- | | AMQPConnection | [createConnection](#method_createConnection)(array $credentials) | | | AMQPChannel | [createChannel](#method_createChannel)(AMQPConnection $connection) | | | AMQPQueue | [createQueue](#method_createQueue)(AMQPChannel $channel) | | | AMQPExchange | [createExchange](#method_createExchange)(AMQPChannel $channel) | | Details ------- ### AMQPConnection createConnection(array $credentials) #### Parameters | | | | | --- | --- | --- | | array | $credentials | | #### Return Value | | | | --- | --- | | AMQPConnection | | ### AMQPChannel createChannel(AMQPConnection $connection) #### Parameters | | | | | --- | --- | --- | | AMQPConnection | $connection | | #### Return Value | | | | --- | --- | | AMQPChannel | | ### AMQPQueue createQueue(AMQPChannel $channel) #### Parameters | | | | | --- | --- | --- | | AMQPChannel | $channel | | #### Return Value | | | | --- | --- | | AMQPQueue | | ### AMQPExchange createExchange(AMQPChannel $channel) #### Parameters | | | | | --- | --- | --- | | AMQPChannel | $channel | | #### Return Value | | | | --- | --- | | AMQPExchange | | symfony Symfony\Component\Messenger\Transport\AmqpExt\Exception Symfony\Component\Messenger\Transport\AmqpExt\Exception ======================================================= Interfaces ---------- | | | | --- | --- | | *[RejectMessageExceptionInterface](exception/rejectmessageexceptioninterface "Symfony\Component\Messenger\Transport\AmqpExt\Exception\RejectMessageExceptionInterface")* | If something goes wrong while consuming and handling a message from the AMQP broker, there are two choices: rejecting or re-queuing the message. | symfony AmqpSender AmqpSender =========== class **AmqpSender** implements [SenderInterface](../senderinterface "Symfony\Component\Messenger\Transport\SenderInterface") Symfony Messenger sender to send messages to AMQP brokers using PHP's AMQP extension. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") $encoder, [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") $connection) | | | | [send](#method_send)([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. | | Details ------- ### \_\_construct([EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") $encoder, [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") $connection) #### Parameters | | | | | --- | --- | --- | | [EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") | $encoder | | | [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") | $connection | | ### send([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. #### Parameters | | | | | --- | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | $envelope | | symfony Connection Connection =========== class **Connection** An AMQP connection. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $connectionCredentials, array $exchangeConfiguration, array $queueConfiguration, bool $debug = false, [AmqpFactory](amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") $amqpFactory = null) | | | static [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") | [fromDsn](#method_fromDsn)(string $dsn, array $options = array(), bool $debug = false, [AmqpFactory](amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") $amqpFactory = null) | | | void | [publish](#method_publish)(string $body, array $headers = array()) | | | AMQPEnvelope|null | [get](#method_get)() Waits and gets a message from the configured queue. | | | bool | [ack](#method_ack)(AMQPEnvelope $message) | | | bool | [reject](#method_reject)(AMQPEnvelope $message) | | | bool | [nack](#method_nack)(AMQPEnvelope $message, int $flags = AMQP\_NOPARAM) | | | void | [setup](#method_setup)() | | | AMQPChannel | [channel](#method_channel)() | | | AMQPQueue | [queue](#method_queue)() | | | AMQPExchange | [exchange](#method_exchange)() | | | array | [getConnectionCredentials](#method_getConnectionCredentials)() | | Details ------- ### \_\_construct(array $connectionCredentials, array $exchangeConfiguration, array $queueConfiguration, bool $debug = false, [AmqpFactory](amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") $amqpFactory = null) #### Parameters | | | | | --- | --- | --- | | array | $connectionCredentials | | | array | $exchangeConfiguration | | | array | $queueConfiguration | | | bool | $debug | | | [AmqpFactory](amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") | $amqpFactory | | ### static [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") fromDsn(string $dsn, array $options = array(), bool $debug = false, [AmqpFactory](amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") $amqpFactory = null) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | | bool | $debug | | | [AmqpFactory](amqpfactory "Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory") | $amqpFactory | | #### Return Value | | | | --- | --- | | [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") | | ### void publish(string $body, array $headers = array()) #### Parameters | | | | | --- | --- | --- | | string | $body | | | array | $headers | | #### Return Value | | | | --- | --- | | void | | #### Exceptions | | | | --- | --- | | AMQPException | | ### AMQPEnvelope|null get() Waits and gets a message from the configured queue. #### Return Value | | | | --- | --- | | AMQPEnvelope|null | | #### Exceptions | | | | --- | --- | | AMQPException | | ### bool ack(AMQPEnvelope $message) #### Parameters | | | | | --- | --- | --- | | AMQPEnvelope | $message | | #### Return Value | | | | --- | --- | | bool | | ### bool reject(AMQPEnvelope $message) #### Parameters | | | | | --- | --- | --- | | AMQPEnvelope | $message | | #### Return Value | | | | --- | --- | | bool | | ### bool nack(AMQPEnvelope $message, int $flags = AMQP\_NOPARAM) #### Parameters | | | | | --- | --- | --- | | AMQPEnvelope | $message | | | int | $flags | | #### Return Value | | | | --- | --- | | bool | | ### void setup() #### Return Value | | | | --- | --- | | void | | ### AMQPChannel channel() #### Return Value | | | | --- | --- | | AMQPChannel | | ### AMQPQueue queue() #### Return Value | | | | --- | --- | | AMQPQueue | | ### AMQPExchange exchange() #### Return Value | | | | --- | --- | | AMQPExchange | | ### array getConnectionCredentials() #### Return Value | | | | --- | --- | | array | | symfony AmqpTransport AmqpTransport ============== class **AmqpTransport** implements [TransportInterface](../transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") $encoder, [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") $decoder, [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") $connection) | | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | | | [send](#method_send)([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. | | Details ------- ### \_\_construct([EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") $encoder, [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") $decoder, [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") $connection) #### Parameters | | | | | --- | --- | --- | | [EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") | $encoder | | | [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") | $decoder | | | [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") | $connection | | ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | ### send([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Sends the given envelope. #### Parameters | | | | | --- | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | $envelope | | symfony AmqpReceiver AmqpReceiver ============= class **AmqpReceiver** implements [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") Symfony Messenger receiver to get messages from AMQP brokers using PHP's AMQP extension. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") $decoder, [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") $connection) | | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | Details ------- ### \_\_construct([DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") $decoder, [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") $connection) #### Parameters | | | | | --- | --- | --- | | [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") | $decoder | | | [Connection](connection "Symfony\Component\Messenger\Transport\AmqpExt\Connection") | $connection | | ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | symfony AmqpTransportFactory AmqpTransportFactory ===================== class **AmqpTransportFactory** implements [TransportFactoryInterface](../transportfactoryinterface "Symfony\Component\Messenger\Transport\TransportFactoryInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") $encoder, [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") $decoder, bool $debug) | | | [TransportInterface](../transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") | [createTransport](#method_createTransport)(string $dsn, array $options) | | | bool | [supports](#method_supports)(string $dsn, array $options) | | Details ------- ### \_\_construct([EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") $encoder, [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") $decoder, bool $debug) #### Parameters | | | | | --- | --- | --- | | [EncoderInterface](../serialization/encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") | $encoder | | | [DecoderInterface](../serialization/decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface") | $decoder | | | bool | $debug | | ### [TransportInterface](../transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") createTransport(string $dsn, array $options) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | #### Return Value | | | | --- | --- | | [TransportInterface](../transportinterface "Symfony\Component\Messenger\Transport\TransportInterface") | | ### bool supports(string $dsn, array $options) #### Parameters | | | | | --- | --- | --- | | string | $dsn | | | array | $options | | #### Return Value | | | | --- | --- | | bool | | symfony RejectMessageExceptionInterface RejectMessageExceptionInterface ================================ interface **RejectMessageExceptionInterface** implements [Throwable](http://php.net/Throwable) If something goes wrong while consuming and handling a message from the AMQP broker, there are two choices: rejecting or re-queuing the message. If the exception that is thrown by the bus while dispatching the message implements this interface, the message will be rejected. Otherwise, it will be re-queued. symfony DecoderInterface DecoderInterface ================= interface **DecoderInterface** Methods ------- | | | | | --- | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | [decode](#method_decode)(array $encodedEnvelope) Decodes an envelope and its message from an encoded-form. | | Details ------- ### [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") decode(array $encodedEnvelope) Decodes an envelope and its message from an encoded-form. The `$encodedEnvelope` parameter is a key-value array that describes the envelope and its content, that will be used by the different transports. The most common keys are: - `body` (string) - the message body - `headers` (string) - a key/value pair of headers #### Parameters | | | | | --- | --- | --- | | array | $encodedEnvelope | | #### Return Value | | | | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | | symfony EncoderInterface EncoderInterface ================= interface **EncoderInterface** Methods ------- | | | | | --- | --- | --- | | array | [encode](#method_encode)([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Encodes an envelope content (message & items) to a common format understandable by transports. | | Details ------- ### array encode([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Encodes an envelope content (message & items) to a common format understandable by transports. The encoded array should only contain scalar and arrays. The most common keys of the encoded array are: - `body` (string) - the message body - `headers` (string) - a key/value pair of headers #### Parameters | | | | | --- | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | $envelope | The envelop containing the message put on the MessageBus by the user | #### Return Value | | | | --- | --- | | array | | symfony SerializerConfiguration SerializerConfiguration ======================== class **SerializerConfiguration** implements [EnvelopeItemInterface](../../envelopeiteminterface "Symfony\Component\Messenger\EnvelopeItemInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $context) | | | array | [getContext](#method_getContext)() | | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### \_\_construct(array $context) #### Parameters | | | | | --- | --- | --- | | array | $context | | ### array getContext() #### Return Value | | | | --- | --- | | array | | ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony Serializer Serializer =========== class **Serializer** implements [DecoderInterface](decoderinterface "Symfony\Component\Messenger\Transport\Serialization\DecoderInterface"), [EncoderInterface](encoderinterface "Symfony\Component\Messenger\Transport\Serialization\EncoderInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SerializerInterface](../../../serializer/serializerinterface "Symfony\Component\Serializer\SerializerInterface") $serializer, string $format = 'json', array $context = array()) | | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | [decode](#method_decode)(array $encodedEnvelope) Decodes an envelope and its message from an encoded-form. | | | array | [encode](#method_encode)([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Encodes an envelope content (message & items) to a common format understandable by transports. | | Details ------- ### \_\_construct([SerializerInterface](../../../serializer/serializerinterface "Symfony\Component\Serializer\SerializerInterface") $serializer, string $format = 'json', array $context = array()) #### Parameters | | | | | --- | --- | --- | | [SerializerInterface](../../../serializer/serializerinterface "Symfony\Component\Serializer\SerializerInterface") | $serializer | | | string | $format | | | array | $context | | ### [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") decode(array $encodedEnvelope) Decodes an envelope and its message from an encoded-form. The `$encodedEnvelope` parameter is a key-value array that describes the envelope and its content, that will be used by the different transports. The most common keys are: - `body` (string) - the message body - `headers` (string) - a key/value pair of headers #### Parameters | | | | | --- | --- | --- | | array | $encodedEnvelope | | #### Return Value | | | | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | | ### array encode([Envelope](../../envelope "Symfony\Component\Messenger\Envelope") $envelope) Encodes an envelope content (message & items) to a common format understandable by transports. The encoded array should only contain scalar and arrays. The most common keys of the encoded array are: - `body` (string) - the message body - `headers` (string) - a key/value pair of headers #### Parameters | | | | | --- | --- | --- | | [Envelope](../../envelope "Symfony\Component\Messenger\Envelope") | $envelope | The envelop containing the message put on the MessageBus by the user | #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony StopWhenMessageCountIsExceededReceiver StopWhenMessageCountIsExceededReceiver ======================================= class **StopWhenMessageCountIsExceededReceiver** implements [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver, int $maximumNumberOfMessages, LoggerInterface $logger = null) | | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | Details ------- ### \_\_construct([ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver, int $maximumNumberOfMessages, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") | $decoratedReceiver | | | int | $maximumNumberOfMessages | | | LoggerInterface | $logger | | ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | symfony StopWhenMemoryUsageIsExceededReceiver StopWhenMemoryUsageIsExceededReceiver ====================================== class **StopWhenMemoryUsageIsExceededReceiver** implements [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver, int $memoryLimit, LoggerInterface $logger = null, callable $memoryResolver = null) | | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | Details ------- ### \_\_construct([ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver, int $memoryLimit, LoggerInterface $logger = null, callable $memoryResolver = null) #### Parameters | | | | | --- | --- | --- | | [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") | $decoratedReceiver | | | int | $memoryLimit | | | LoggerInterface | $logger | | | callable | $memoryResolver | | ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | symfony StopWhenTimeLimitIsReachedReceiver StopWhenTimeLimitIsReachedReceiver =================================== class **StopWhenTimeLimitIsReachedReceiver** implements [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver, int $timeLimitInSeconds, LoggerInterface $logger = null) | | | void | [receive](#method_receive)(callable $handler) Receive some messages to the given handler. | | | void | [stop](#method_stop)() Stop receiving some messages. | | Details ------- ### \_\_construct([ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") $decoratedReceiver, int $timeLimitInSeconds, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [ReceiverInterface](../receiverinterface "Symfony\Component\Messenger\Transport\ReceiverInterface") | $decoratedReceiver | | | int | $timeLimitInSeconds | | | LoggerInterface | $logger | | ### void receive(callable $handler) Receive some messages to the given handler. The handler will have, as argument, the received {@link \Symfony\Component\Messenger\Envelope} containing the message. Note that this envelope can be `null` if the timeout to receive something has expired. #### Parameters | | | | | --- | --- | --- | | callable | $handler | | #### Return Value | | | | --- | --- | | void | | ### void stop() Stop receiving some messages. #### Return Value | | | | --- | --- | | void | | symfony ConsumeMessagesCommand ConsumeMessagesCommand ======================= class **ConsumeMessagesCommand** extends [Command](../../console/command/command "Symfony\Component\Console\Command\Command") Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](../../console/command/command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)([MessageBusInterface](../messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") $bus, ContainerInterface $receiverLocator, LoggerInterface $logger = null, array $receiverNames = array()) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](../../console/command/command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../../console/application "Symfony\Component\Console\Application") $application = null) | from [Command](../../console/command/command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](../../console/command/command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](../../console/command/command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../../console/application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](../../console/command/command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](../../console/command/command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | | | | [initialize](#method_initialize)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](../../console/command/command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](../../console/command/command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](../../console/command/command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](../../console/command/command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](../../console/command/command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](../../console/command/command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](../../console/command/command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](../../console/command/command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](../../console/command/command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](../../console/command/command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](../../console/command/command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](../../console/command/command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](../../console/command/command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](../../console/command/command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](../../console/command/command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](../../console/command/command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](../../console/command/command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](../../console/command/command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](../../console/command/command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](../../console/command/command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](../../console/command/command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](../../console/command/command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](../../console/command/command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](../../console/command/command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](../../console/command/command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct([MessageBusInterface](../messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") $bus, ContainerInterface $receiverLocator, LoggerInterface $logger = null, array $receiverNames = array()) #### Parameters | | | | | --- | --- | --- | | [MessageBusInterface](../messagebusinterface "Symfony\Component\Messenger\MessageBusInterface") | $bus | | | ContainerInterface | $receiverLocator | | | LoggerInterface | $logger | | | array | $receiverNames | | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../../console/application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../../console/application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../../console/input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../../console/input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](../../console/command/command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony DebugCommand DebugCommand ============= class **DebugCommand** extends [Command](../../console/command/command "Symfony\Component\Console\Command\Command") A console command to debug Messenger information. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](../../console/command/command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)(array $mapping) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](../../console/command/command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../../console/application "Symfony\Component\Console\Application") $application = null) | from [Command](../../console/command/command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](../../console/command/command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](../../console/command/command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../../console/application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](../../console/command/command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](../../console/command/command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](../../console/command/command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](../../console/command/command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](../../console/command/command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](../../console/command/command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](../../console/command/command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](../../console/command/command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](../../console/command/command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](../../console/command/command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](../../console/command/command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](../../console/command/command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](../../console/command/command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](../../console/command/command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](../../console/command/command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](../../console/command/command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](../../console/command/command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](../../console/command/command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](../../console/command/command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](../../console/command/command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](../../console/command/command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](../../console/command/command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](../../console/command/command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](../../console/command/command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](../../console/command/command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](../../console/command/command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](../../console/command/command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](../../console/command/command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct(array $mapping) #### Parameters | | | | | --- | --- | --- | | array | $mapping | | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../../console/application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../../console/application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../../console/input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../../console/input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](../../console/command/command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony MessengerPass MessengerPass ============== class **MessengerPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Traits ------ | | | | --- | --- | | [PriorityTaggedServiceTrait](../../dependencyinjection/compiler/prioritytaggedservicetrait "Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait") | Trait that allows a generic method to find and sort service by priority option in the tag. | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $handlerTag = 'messenger.message\_handler', string $busTag = 'messenger.bus', string $senderTag = 'messenger.sender', string $receiverTag = 'messenger.receiver') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $handlerTag = 'messenger.message\_handler', string $busTag = 'messenger.bus', string $senderTag = 'messenger.sender', string $receiverTag = 'messenger.receiver') #### Parameters | | | | | --- | --- | --- | | string | $handlerTag | | | string | $busTag | | | string | $senderTag | | | string | $receiverTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Messenger\Exception\ExceptionInterface") symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Base Message component's exception. symfony NoHandlerForMessageException NoHandlerForMessageException ============================= class **NoHandlerForMessageException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Messenger\Exception\ExceptionInterface") symfony ValidationFailedException ValidationFailedException ========================== class **ValidationFailedException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Messenger\Exception\ExceptionInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($violatingMessage, [ConstraintViolationListInterface](../../validator/constraintviolationlistinterface "Symfony\Component\Validator\ConstraintViolationListInterface") $violations) | | | | [getViolatingMessage](#method_getViolatingMessage)() | | | [ConstraintViolationListInterface](../../validator/constraintviolationlistinterface "Symfony\Component\Validator\ConstraintViolationListInterface") | [getViolations](#method_getViolations)() | | Details ------- ### \_\_construct($violatingMessage, [ConstraintViolationListInterface](../../validator/constraintviolationlistinterface "Symfony\Component\Validator\ConstraintViolationListInterface") $violations) #### Parameters | | | | | --- | --- | --- | | | $violatingMessage | | | [ConstraintViolationListInterface](../../validator/constraintviolationlistinterface "Symfony\Component\Validator\ConstraintViolationListInterface") | $violations | | ### getViolatingMessage() ### [ConstraintViolationListInterface](../../validator/constraintviolationlistinterface "Symfony\Component\Validator\ConstraintViolationListInterface") getViolations() #### Return Value | | | | --- | --- | | [ConstraintViolationListInterface](../../validator/constraintviolationlistinterface "Symfony\Component\Validator\ConstraintViolationListInterface") | | symfony Symfony\Component\Finder\Exception Symfony\Component\Finder\Exception ================================== Classes ------- | | | | --- | --- | | [AccessDeniedException](exception/accessdeniedexception "Symfony\Component\Finder\Exception\AccessDeniedException") | | symfony Glob Glob ===== class **Glob** Glob matches globbing patterns against text. if match\_glob("foo.\*", "foo.bar") echo "matched\n"; ``` // prints foo.bar and foo.baz $regex = glob_to_regex("foo.*"); for (array('foo.bar', 'foo.baz', 'foo', 'bar') as $t) { if (/$regex/) echo "matched: $car\n"; } ``` Glob implements glob(3) style matching that can be used to match against text, rather than fetching names from a filesystem. Based on the Perl Text::Glob module. Methods ------- | | | | | --- | --- | --- | | static string | [toRegex](#method_toRegex)(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') Returns a regexp which is the equivalent of the glob pattern. | | Details ------- ### static string toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') Returns a regexp which is the equivalent of the glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $glob | The glob pattern | | bool | $strictLeadingDot | | | bool | $strictWildcardSlash | | | string | $delimiter | Optional delimiter | #### Return Value | | | | --- | --- | | string | regex The regexp | symfony SplFileInfo SplFileInfo ============ class **SplFileInfo** extends [SplFileInfo](http://php.net/SplFileInfo) Extends \SplFileInfo to support relative paths. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $file, string $relativePath, string $relativePathname) | | | string | [getRelativePath](#method_getRelativePath)() Returns the relative path. | | | string | [getRelativePathname](#method_getRelativePathname)() Returns the relative path name. | | | string | [getContents](#method_getContents)() Returns the contents of the file. | | Details ------- ### \_\_construct(string $file, string $relativePath, string $relativePathname) #### Parameters | | | | | --- | --- | --- | | string | $file | The file name | | string | $relativePath | The relative path | | string | $relativePathname | The relative path name | ### string getRelativePath() Returns the relative path. This path does not contain the file name. #### Return Value | | | | --- | --- | | string | the relative path | ### string getRelativePathname() Returns the relative path name. This path contains the file name. #### Return Value | | | | --- | --- | | string | the relative path name | ### string getContents() Returns the contents of the file. #### Return Value | | | | --- | --- | | string | the contents of the file | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | symfony Symfony\Component\Finder\Iterator Symfony\Component\Finder\Iterator ================================= Classes ------- | | | | --- | --- | | [CustomFilterIterator](iterator/customfilteriterator "Symfony\Component\Finder\Iterator\CustomFilterIterator") | CustomFilterIterator filters files by applying anonymous functions. | | [DateRangeFilterIterator](iterator/daterangefilteriterator "Symfony\Component\Finder\Iterator\DateRangeFilterIterator") | DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). | | [DepthRangeFilterIterator](iterator/depthrangefilteriterator "Symfony\Component\Finder\Iterator\DepthRangeFilterIterator") | DepthRangeFilterIterator limits the directory depth. | | [ExcludeDirectoryFilterIterator](iterator/excludedirectoryfilteriterator "Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator") | ExcludeDirectoryFilterIterator filters out directories. | | [FileTypeFilterIterator](iterator/filetypefilteriterator "Symfony\Component\Finder\Iterator\FileTypeFilterIterator") | FileTypeFilterIterator only keeps files, directories, or both. | | [FilecontentFilterIterator](iterator/filecontentfilteriterator "Symfony\Component\Finder\Iterator\FilecontentFilterIterator") | FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). | | [FilenameFilterIterator](iterator/filenamefilteriterator "Symfony\Component\Finder\Iterator\FilenameFilterIterator") | FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). | | [MultiplePcreFilterIterator](iterator/multiplepcrefilteriterator "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). | | [PathFilterIterator](iterator/pathfilteriterator "Symfony\Component\Finder\Iterator\PathFilterIterator") | PathFilterIterator filters files by path patterns (e.g. some/special/dir). | | [RecursiveDirectoryIterator](iterator/recursivedirectoryiterator "Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator") | Extends the \RecursiveDirectoryIterator to support relative paths. | | [SizeRangeFilterIterator](iterator/sizerangefilteriterator "Symfony\Component\Finder\Iterator\SizeRangeFilterIterator") | SizeRangeFilterIterator filters out files that are not in the given size range. | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | SortableIterator applies a sort on a given Iterator. | symfony Symfony\Component\Finder\Comparator Symfony\Component\Finder\Comparator =================================== Classes ------- | | | | --- | --- | | [Comparator](comparator/comparator "Symfony\Component\Finder\Comparator\Comparator") | Comparator. | | [DateComparator](comparator/datecomparator "Symfony\Component\Finder\Comparator\DateComparator") | DateCompare compiles date comparisons. | | [NumberComparator](comparator/numbercomparator "Symfony\Component\Finder\Comparator\NumberComparator") | NumberComparator compiles a simple comparison to an anonymous subroutine, which you can call with a value to be tested again. | symfony Finder Finder ======= class **Finder** implements [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) Finder allows to build rules to find files and directories. It is a thin wrapper around several specialized iterator classes. All rules may be invoked several times. All methods return the current Finder object to allow easy chaining: ``` $finder = Finder::create()->files()->name('*.php')->in(__DIR__); ``` Constants --------- | | | | --- | --- | | IGNORE\_VCS\_FILES | | | IGNORE\_DOT\_FILES | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | static [Finder](finder "Symfony\Component\Finder\Finder") | [create](#method_create)() Creates a new Finder. | | | $this | [directories](#method_directories)() Restricts the matching to directories only. | | | $this | [files](#method_files)() Restricts the matching to files only. | | | $this | [depth](#method_depth)(string|int $level) Adds tests for the directory depth. | | | $this | [date](#method_date)(string $date) Adds tests for file dates (last modified). | | | $this | [name](#method_name)(string $pattern) Adds rules that files must match. | | | $this | [notName](#method_notName)(string $pattern) Adds rules that files must not match. | | | $this | [contains](#method_contains)(string $pattern) Adds tests that file contents must match. | | | $this | [notContains](#method_notContains)(string $pattern) Adds tests that file contents must not match. | | | $this | [path](#method_path)(string $pattern) Adds rules that filenames must match. | | | $this | [notPath](#method_notPath)(string $pattern) Adds rules that filenames must not match. | | | $this | [size](#method_size)(string|int $size) Adds tests for file sizes. | | | $this | [exclude](#method_exclude)(string|array $dirs) Excludes directories. | | | $this | [ignoreDotFiles](#method_ignoreDotFiles)(bool $ignoreDotFiles) Excludes "hidden" directories and files (starting with a dot). | | | $this | [ignoreVCS](#method_ignoreVCS)(bool $ignoreVCS) Forces the finder to ignore version control directories. | | | static | [addVCSPattern](#method_addVCSPattern)(string|string[] $pattern) Adds VCS patterns. | | | $this | [sort](#method_sort)([Closure](http://php.net/Closure) $closure) Sorts files and directories by an anonymous function. | | | $this | [sortByName](#method_sortByName)() Sorts files and directories by name. | | | $this | [sortByType](#method_sortByType)() Sorts files and directories by type (directories before files), then by name. | | | $this | [sortByAccessedTime](#method_sortByAccessedTime)() Sorts files and directories by the last accessed time. | | | $this | [sortByChangedTime](#method_sortByChangedTime)() Sorts files and directories by the last inode changed time. | | | $this | [sortByModifiedTime](#method_sortByModifiedTime)() Sorts files and directories by the last modified time. | | | $this | [filter](#method_filter)([Closure](http://php.net/Closure) $closure) Filters the iterator with an anonymous function. | | | $this | [followLinks](#method_followLinks)() Forces the following of symlinks. | | | $this | [ignoreUnreadableDirs](#method_ignoreUnreadableDirs)(bool $ignore = true) Tells finder to ignore unreadable directories. | | | $this | [in](#method_in)(string|array $dirs) Searches files and directories which match defined rules. | | | [Iterator](http://php.net/Iterator)|[SplFileInfo](splfileinfo "Symfony\Component\Finder\SplFileInfo")[] | [getIterator](#method_getIterator)() Returns an Iterator for the current Finder configuration. | | | $this | [append](#method_append)(iterable $iterator) Appends an existing set of files/directories to the finder. | | | bool | [hasResults](#method_hasResults)() Check if the any results were found. | | | int | [count](#method_count)() Counts all the results collected by the iterators. | | Details ------- ### \_\_construct() ### static [Finder](finder "Symfony\Component\Finder\Finder") create() Creates a new Finder. #### Return Value | | | | --- | --- | | [Finder](finder "Symfony\Component\Finder\Finder") | | ### $this directories() Restricts the matching to directories only. #### Return Value | | | | --- | --- | | $this | | ### $this files() Restricts the matching to files only. #### Return Value | | | | --- | --- | | $this | | ### $this depth(string|int $level) Adds tests for the directory depth. Usage: ``` $finder->depth('> 1') // the Finder will start matching at level 1. $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. ``` #### Parameters | | | | | --- | --- | --- | | string|int | $level | The depth level expression | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [DepthRangeFilterIterator](iterator/depthrangefilteriterator "Symfony\Component\Finder\Iterator\DepthRangeFilterIterator") | | | [NumberComparator](comparator/numbercomparator "Symfony\Component\Finder\Comparator\NumberComparator") | | ### $this date(string $date) Adds tests for file dates (last modified). The date must be something that strtotime() is able to parse: ``` $finder->date('since yesterday'); $finder->date('until 2 days ago'); $finder->date('> now - 2 hours'); $finder->date('>= 2005-10-15'); ``` #### Parameters | | | | | --- | --- | --- | | string | $date | A date range string | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | strtotime | | | [DateRangeFilterIterator](iterator/daterangefilteriterator "Symfony\Component\Finder\Iterator\DateRangeFilterIterator") | | | [DateComparator](comparator/datecomparator "Symfony\Component\Finder\Comparator\DateComparator") | | ### $this name(string $pattern) Adds rules that files must match. You can use patterns (delimited with / sign), globs or simple strings. ``` $finder->name('*.php') $finder->name('/\.php$/') // same as above $finder->name('test.php') ``` #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern (a regexp, a glob, or a string) | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [FilenameFilterIterator](iterator/filenamefilteriterator "Symfony\Component\Finder\Iterator\FilenameFilterIterator") | | ### $this notName(string $pattern) Adds rules that files must not match. #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern (a regexp, a glob, or a string) | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [FilenameFilterIterator](iterator/filenamefilteriterator "Symfony\Component\Finder\Iterator\FilenameFilterIterator") | | ### $this contains(string $pattern) Adds tests that file contents must match. Strings or PCRE patterns can be used: ``` $finder->contains('Lorem ipsum') $finder->contains('/Lorem ipsum/i') ``` #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern (string or regexp) | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [FilecontentFilterIterator](iterator/filecontentfilteriterator "Symfony\Component\Finder\Iterator\FilecontentFilterIterator") | | ### $this notContains(string $pattern) Adds tests that file contents must not match. Strings or PCRE patterns can be used: ``` $finder->notContains('Lorem ipsum') $finder->notContains('/Lorem ipsum/i') ``` #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern (string or regexp) | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [FilecontentFilterIterator](iterator/filecontentfilteriterator "Symfony\Component\Finder\Iterator\FilecontentFilterIterator") | | ### $this path(string $pattern) Adds rules that filenames must match. You can use patterns (delimited with / sign) or simple strings. ``` $finder->path('some/special/dir') $finder->path('/some\/special\/dir/') // same as above ``` Use only / as dirname separator. #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern (a regexp or a string) | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [FilenameFilterIterator](iterator/filenamefilteriterator "Symfony\Component\Finder\Iterator\FilenameFilterIterator") | | ### $this notPath(string $pattern) Adds rules that filenames must not match. You can use patterns (delimited with / sign) or simple strings. ``` $finder->notPath('some/special/dir') $finder->notPath('/some\/special\/dir/') // same as above ``` Use only / as dirname separator. #### Parameters | | | | | --- | --- | --- | | string | $pattern | A pattern (a regexp or a string) | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [FilenameFilterIterator](iterator/filenamefilteriterator "Symfony\Component\Finder\Iterator\FilenameFilterIterator") | | ### $this size(string|int $size) Adds tests for file sizes. $finder->size('> 10K'); $finder->size('<= 1Ki'); $finder->size(4); #### Parameters | | | | | --- | --- | --- | | string|int | $size | A size range string or an integer | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SizeRangeFilterIterator](iterator/sizerangefilteriterator "Symfony\Component\Finder\Iterator\SizeRangeFilterIterator") | | | [NumberComparator](comparator/numbercomparator "Symfony\Component\Finder\Comparator\NumberComparator") | | ### $this exclude(string|array $dirs) Excludes directories. Directories passed as argument must be relative to the ones defined with the `in()` method. For example: ``` $finder->in(__DIR__)->exclude('ruby'); ``` #### Parameters | | | | | --- | --- | --- | | string|array | $dirs | A directory path or an array of directories | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [ExcludeDirectoryFilterIterator](iterator/excludedirectoryfilteriterator "Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator") | | ### $this ignoreDotFiles(bool $ignoreDotFiles) Excludes "hidden" directories and files (starting with a dot). This option is enabled by default. #### Parameters | | | | | --- | --- | --- | | bool | $ignoreDotFiles | Whether to exclude "hidden" files or not | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [ExcludeDirectoryFilterIterator](iterator/excludedirectoryfilteriterator "Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator") | | ### $this ignoreVCS(bool $ignoreVCS) Forces the finder to ignore version control directories. This option is enabled by default. #### Parameters | | | | | --- | --- | --- | | bool | $ignoreVCS | Whether to exclude VCS files or not | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [ExcludeDirectoryFilterIterator](iterator/excludedirectoryfilteriterator "Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator") | | ### static addVCSPattern(string|string[] $pattern) Adds VCS patterns. #### Parameters | | | | | --- | --- | --- | | string|string[] | $pattern | VCS patterns to ignore | #### See also | | | | --- | --- | | ignoreVCS() | | ### $this sort([Closure](http://php.net/Closure) $closure) Sorts files and directories by an anonymous function. The anonymous function receives two \SplFileInfo instances to compare. This can be slow as all the matching files and directories must be retrieved for comparison. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | | ### $this sortByName() Sorts files and directories by name. This can be slow as all the matching files and directories must be retrieved for comparison. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | | ### $this sortByType() Sorts files and directories by type (directories before files), then by name. This can be slow as all the matching files and directories must be retrieved for comparison. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | | ### $this sortByAccessedTime() Sorts files and directories by the last accessed time. This is the time that the file was last accessed, read or written to. This can be slow as all the matching files and directories must be retrieved for comparison. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | | ### $this sortByChangedTime() Sorts files and directories by the last inode changed time. This is the time that the inode information was last modified (permissions, owner, group or other metadata). On Windows, since inode is not available, changed time is actually the file creation time. This can be slow as all the matching files and directories must be retrieved for comparison. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | | ### $this sortByModifiedTime() Sorts files and directories by the last modified time. This is the last time the actual contents of the file were last modified. This can be slow as all the matching files and directories must be retrieved for comparison. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [SortableIterator](iterator/sortableiterator "Symfony\Component\Finder\Iterator\SortableIterator") | | ### $this filter([Closure](http://php.net/Closure) $closure) Filters the iterator with an anonymous function. The anonymous function receives a \SplFileInfo and must return false to remove files. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | | #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | [CustomFilterIterator](iterator/customfilteriterator "Symfony\Component\Finder\Iterator\CustomFilterIterator") | | ### $this followLinks() Forces the following of symlinks. #### Return Value | | | | --- | --- | | $this | | ### $this ignoreUnreadableDirs(bool $ignore = true) Tells finder to ignore unreadable directories. By default, scanning unreadable directories content throws an AccessDeniedException. #### Parameters | | | | | --- | --- | --- | | bool | $ignore | | #### Return Value | | | | --- | --- | | $this | | ### $this in(string|array $dirs) Searches files and directories which match defined rules. #### Parameters | | | | | --- | --- | --- | | string|array | $dirs | A directory path or an array of directories | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if one of the directories does not exist | ### [Iterator](http://php.net/Iterator)|[SplFileInfo](splfileinfo "Symfony\Component\Finder\SplFileInfo")[] getIterator() Returns an Iterator for the current Finder configuration. This method implements the IteratorAggregate interface. #### Return Value | | | | --- | --- | | [Iterator](http://php.net/Iterator)|[SplFileInfo](splfileinfo "Symfony\Component\Finder\SplFileInfo")[] | An iterator | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if the in() method has not been called | ### $this append(iterable $iterator) Appends an existing set of files/directories to the finder. The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. #### Parameters | | | | | --- | --- | --- | | iterable | $iterator | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the given argument is not iterable | ### bool hasResults() Check if the any results were found. #### Return Value | | | | --- | --- | | bool | | ### int count() Counts all the results collected by the iterators. #### Return Value | | | | --- | --- | | int | |
programming_docs
symfony NumberComparator NumberComparator ================= class **NumberComparator** extends [Comparator](comparator "Symfony\Component\Finder\Comparator\Comparator") NumberComparator compiles a simple comparison to an anonymous subroutine, which you can call with a value to be tested again. Now this would be very pointless, if NumberCompare didn't understand magnitudes. The target value may use magnitudes of kilobytes (k, ki), megabytes (m, mi), or gigabytes (g, gi). Those suffixed with an i use the appropriate 2\*\*n version in accordance with the IEC standard: http://physics.nist.gov/cuu/Units/binary.html Based on the Perl Number::Compare module. Methods ------- | | | | | --- | --- | --- | | string | [getTarget](#method_getTarget)() Gets the target value. | from [Comparator](comparator#method_getTarget "Symfony\Component\Finder\Comparator\Comparator") | | | [setTarget](#method_setTarget)(string $target) Sets the target value. | from [Comparator](comparator#method_setTarget "Symfony\Component\Finder\Comparator\Comparator") | | string | [getOperator](#method_getOperator)() Gets the comparison operator. | from [Comparator](comparator#method_getOperator "Symfony\Component\Finder\Comparator\Comparator") | | | [setOperator](#method_setOperator)(string $operator) Sets the comparison operator. | from [Comparator](comparator#method_setOperator "Symfony\Component\Finder\Comparator\Comparator") | | bool | [test](#method_test)(mixed $test) Tests against the target. | from [Comparator](comparator#method_test "Symfony\Component\Finder\Comparator\Comparator") | | | [\_\_construct](#method___construct)(string|null $test) | | Details ------- ### string getTarget() Gets the target value. #### Return Value | | | | --- | --- | | string | The target value | ### setTarget(string $target) Sets the target value. #### Parameters | | | | | --- | --- | --- | | string | $target | The target value | ### string getOperator() Gets the comparison operator. #### Return Value | | | | --- | --- | | string | The operator | ### setOperator(string $operator) Sets the comparison operator. #### Parameters | | | | | --- | --- | --- | | string | $operator | A valid operator | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool test(mixed $test) Tests against the target. #### Parameters | | | | | --- | --- | --- | | mixed | $test | A test value | #### Return Value | | | | --- | --- | | bool | | ### \_\_construct(string|null $test) #### Parameters | | | | | --- | --- | --- | | string|null | $test | A comparison string or an integer | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the test is not understood | symfony DateComparator DateComparator =============== class **DateComparator** extends [Comparator](comparator "Symfony\Component\Finder\Comparator\Comparator") DateCompare compiles date comparisons. Methods ------- | | | | | --- | --- | --- | | string | [getTarget](#method_getTarget)() Gets the target value. | from [Comparator](comparator#method_getTarget "Symfony\Component\Finder\Comparator\Comparator") | | | [setTarget](#method_setTarget)(string $target) Sets the target value. | from [Comparator](comparator#method_setTarget "Symfony\Component\Finder\Comparator\Comparator") | | string | [getOperator](#method_getOperator)() Gets the comparison operator. | from [Comparator](comparator#method_getOperator "Symfony\Component\Finder\Comparator\Comparator") | | | [setOperator](#method_setOperator)(string $operator) Sets the comparison operator. | from [Comparator](comparator#method_setOperator "Symfony\Component\Finder\Comparator\Comparator") | | bool | [test](#method_test)(mixed $test) Tests against the target. | from [Comparator](comparator#method_test "Symfony\Component\Finder\Comparator\Comparator") | | | [\_\_construct](#method___construct)(string $test) | | Details ------- ### string getTarget() Gets the target value. #### Return Value | | | | --- | --- | | string | The target value | ### setTarget(string $target) Sets the target value. #### Parameters | | | | | --- | --- | --- | | string | $target | The target value | ### string getOperator() Gets the comparison operator. #### Return Value | | | | --- | --- | | string | The operator | ### setOperator(string $operator) Sets the comparison operator. #### Parameters | | | | | --- | --- | --- | | string | $operator | A valid operator | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool test(mixed $test) Tests against the target. #### Parameters | | | | | --- | --- | --- | | mixed | $test | A test value | #### Return Value | | | | --- | --- | | bool | | ### \_\_construct(string $test) #### Parameters | | | | | --- | --- | --- | | string | $test | A comparison string | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the test is not understood | symfony Comparator Comparator =========== class **Comparator** Comparator. Methods ------- | | | | | --- | --- | --- | | string | [getTarget](#method_getTarget)() Gets the target value. | | | | [setTarget](#method_setTarget)(string $target) Sets the target value. | | | string | [getOperator](#method_getOperator)() Gets the comparison operator. | | | | [setOperator](#method_setOperator)(string $operator) Sets the comparison operator. | | | bool | [test](#method_test)(mixed $test) Tests against the target. | | Details ------- ### string getTarget() Gets the target value. #### Return Value | | | | --- | --- | | string | The target value | ### setTarget(string $target) Sets the target value. #### Parameters | | | | | --- | --- | --- | | string | $target | The target value | ### string getOperator() Gets the comparison operator. #### Return Value | | | | --- | --- | | string | The operator | ### setOperator(string $operator) Sets the comparison operator. #### Parameters | | | | | --- | --- | --- | | string | $operator | A valid operator | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool test(mixed $test) Tests against the target. #### Parameters | | | | | --- | --- | --- | | mixed | $test | A test value | #### Return Value | | | | --- | --- | | bool | | symfony PathFilterIterator PathFilterIterator =================== class **PathFilterIterator** extends [MultiplePcreFilterIterator](multiplepcrefilteriterator "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") PathFilterIterator filters files by path patterns (e.g. some/special/dir). Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $matchRegexps | | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#property_matchRegexps "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | protected | $noMatchRegexps | | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#property_noMatchRegexps "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method___construct "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | bool | [isAccepted](#method_isAccepted)(string $string) Checks whether the string is accepted by the regex filters. | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method_isAccepted "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | bool | [isRegex](#method_isRegex)(string $str) Checks whether the string is a regex. | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method_isRegex "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | string | [toRegex](#method_toRegex)(string $str) Converts strings to regexp. | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $matchPatterns | An array of patterns that need to match | | array | $noMatchPatterns | An array of patterns that need to not match | ### protected bool isAccepted(string $string) Checks whether the string is accepted by the regex filters. If there is no regexps defined in the class, this method will accept the string. Such case can be handled by child classes before calling the method if they want to apply a different behavior. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to be matched against filters | #### Return Value | | | | --- | --- | | bool | | ### protected bool isRegex(string $str) Checks whether the string is a regex. #### Parameters | | | | | --- | --- | --- | | string | $str | | #### Return Value | | | | --- | --- | | bool | Whether the given string is a regex | ### protected string toRegex(string $str) Converts strings to regexp. PCRE patterns are left unchanged. Default conversion: 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' Use only / as directory separator (on Windows also). #### Parameters | | | | | --- | --- | --- | | string | $str | Pattern | #### Return Value | | | | --- | --- | | string | regexp corresponding to a given string | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony ExcludeDirectoryFilterIterator ExcludeDirectoryFilterIterator =============================== class **ExcludeDirectoryFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) implements [RecursiveIterator](http://php.net/RecursiveIterator) ExcludeDirectoryFilterIterator filters out directories. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $directories) | | | bool | [accept](#method_accept)() Filters the iterator values. | | | | [hasChildren](#method_hasChildren)() | | | | [getChildren](#method_getChildren)() | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $directories) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $directories | An array of directories to exclude | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | True if the value should be kept, false otherwise | ### hasChildren() ### getChildren() symfony CustomFilterIterator CustomFilterIterator ===================== class **CustomFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) CustomFilterIterator filters files by applying anonymous functions. The anonymous function receives a \SplFileInfo and must return false to remove files. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $filters) | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $filters) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $filters | An array of PHP callbacks | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony FilenameFilterIterator FilenameFilterIterator ======================= class **FilenameFilterIterator** extends [MultiplePcreFilterIterator](multiplepcrefilteriterator "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $matchRegexps | | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#property_matchRegexps "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | protected | $noMatchRegexps | | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#property_noMatchRegexps "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method___construct "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | bool | [isAccepted](#method_isAccepted)(string $string) Checks whether the string is accepted by the regex filters. | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method_isAccepted "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | bool | [isRegex](#method_isRegex)(string $str) Checks whether the string is a regex. | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method_isRegex "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | string | [toRegex](#method_toRegex)(string $str) Converts glob to regexp. | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $matchPatterns | An array of patterns that need to match | | array | $noMatchPatterns | An array of patterns that need to not match | ### protected bool isAccepted(string $string) Checks whether the string is accepted by the regex filters. If there is no regexps defined in the class, this method will accept the string. Such case can be handled by child classes before calling the method if they want to apply a different behavior. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to be matched against filters | #### Return Value | | | | --- | --- | | bool | | ### protected bool isRegex(string $str) Checks whether the string is a regex. #### Parameters | | | | | --- | --- | --- | | string | $str | | #### Return Value | | | | --- | --- | | bool | Whether the given string is a regex | ### protected string toRegex(string $str) Converts glob to regexp. PCRE patterns are left unchanged. Glob strings are transformed with Glob::toRegex(). #### Parameters | | | | | --- | --- | --- | | string | $str | Pattern | #### Return Value | | | | --- | --- | | string | regexp corresponding to a given string | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony SizeRangeFilterIterator SizeRangeFilterIterator ======================== class **SizeRangeFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) SizeRangeFilterIterator filters out files that are not in the given size range. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $comparators) | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $comparators) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $comparators | An array of NumberComparator instances | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony FileTypeFilterIterator FileTypeFilterIterator ======================= class **FileTypeFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) FileTypeFilterIterator only keeps files, directories, or both. Constants --------- | | | | --- | --- | | ONLY\_FILES | | | ONLY\_DIRECTORIES | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, int $mode) | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, int $mode) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | int | $mode | The mode (self::ONLY\_FILES or self::ONLY\_DIRECTORIES) | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony RecursiveDirectoryIterator RecursiveDirectoryIterator =========================== class **RecursiveDirectoryIterator** extends [RecursiveDirectoryIterator](http://php.net/RecursiveDirectoryIterator) Extends the \RecursiveDirectoryIterator to support relative paths. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, int $flags, bool $ignoreUnreadableDirs = false) | | | [SplFileInfo](../splfileinfo "Symfony\Component\Finder\SplFileInfo") | [current](#method_current)() Return an instance of SplFileInfo with support for relative paths. | | | [RecursiveIterator](http://php.net/RecursiveIterator) | [getChildren](#method_getChildren)() | | | | [rewind](#method_rewind)() Do nothing for non rewindable stream. | | | bool | [isRewindable](#method_isRewindable)() Checks if the stream is rewindable. | | Details ------- ### \_\_construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) #### Parameters | | | | | --- | --- | --- | | string | $path | | | int | $flags | | | bool | $ignoreUnreadableDirs | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### [SplFileInfo](../splfileinfo "Symfony\Component\Finder\SplFileInfo") current() Return an instance of SplFileInfo with support for relative paths. #### Return Value | | | | --- | --- | | [SplFileInfo](../splfileinfo "Symfony\Component\Finder\SplFileInfo") | File information | ### [RecursiveIterator](http://php.net/RecursiveIterator) getChildren() #### Return Value | | | | --- | --- | | [RecursiveIterator](http://php.net/RecursiveIterator) | | #### Exceptions | | | | --- | --- | | [AccessDeniedException](../exception/accessdeniedexception "Symfony\Component\Finder\Exception\AccessDeniedException") | | ### rewind() Do nothing for non rewindable stream. ### bool isRewindable() Checks if the stream is rewindable. #### Return Value | | | | --- | --- | | bool | true when the stream is rewindable, false otherwise |
programming_docs
symfony FilecontentFilterIterator FilecontentFilterIterator ========================== class **FilecontentFilterIterator** extends [MultiplePcreFilterIterator](multiplepcrefilteriterator "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $matchRegexps | | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#property_matchRegexps "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | protected | $noMatchRegexps | | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#property_noMatchRegexps "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method___construct "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | bool | [isAccepted](#method_isAccepted)(string $string) Checks whether the string is accepted by the regex filters. | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method_isAccepted "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | bool | [isRegex](#method_isRegex)(string $str) Checks whether the string is a regex. | from [MultiplePcreFilterIterator](multiplepcrefilteriterator#method_isRegex "Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator") | | string | [toRegex](#method_toRegex)(string $str) Converts string to regexp if necessary. | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $matchPatterns | An array of patterns that need to match | | array | $noMatchPatterns | An array of patterns that need to not match | ### protected bool isAccepted(string $string) Checks whether the string is accepted by the regex filters. If there is no regexps defined in the class, this method will accept the string. Such case can be handled by child classes before calling the method if they want to apply a different behavior. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to be matched against filters | #### Return Value | | | | --- | --- | | bool | | ### protected bool isRegex(string $str) Checks whether the string is a regex. #### Parameters | | | | | --- | --- | --- | | string | $str | | #### Return Value | | | | --- | --- | | bool | Whether the given string is a regex | ### protected string toRegex(string $str) Converts string to regexp if necessary. #### Parameters | | | | | --- | --- | --- | | string | $str | Pattern | #### Return Value | | | | --- | --- | | string | regexp corresponding to a given string | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony MultiplePcreFilterIterator MultiplePcreFilterIterator =========================== abstract class **MultiplePcreFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $matchRegexps | | | | protected | $noMatchRegexps | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) | | | bool | [isAccepted](#method_isAccepted)(string $string) Checks whether the string is accepted by the regex filters. | | | bool | [isRegex](#method_isRegex)(string $str) Checks whether the string is a regex. | | | string | [toRegex](#method_toRegex)(string $str) Converts string into regexp. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $matchPatterns, array $noMatchPatterns) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $matchPatterns | An array of patterns that need to match | | array | $noMatchPatterns | An array of patterns that need to not match | ### protected bool isAccepted(string $string) Checks whether the string is accepted by the regex filters. If there is no regexps defined in the class, this method will accept the string. Such case can be handled by child classes before calling the method if they want to apply a different behavior. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to be matched against filters | #### Return Value | | | | --- | --- | | bool | | ### protected bool isRegex(string $str) Checks whether the string is a regex. #### Parameters | | | | | --- | --- | --- | | string | $str | | #### Return Value | | | | --- | --- | | bool | Whether the given string is a regex | ### abstract protected string toRegex(string $str) Converts string into regexp. #### Parameters | | | | | --- | --- | --- | | string | $str | Pattern | #### Return Value | | | | --- | --- | | string | regexp corresponding to a given string | symfony DateRangeFilterIterator DateRangeFilterIterator ======================== class **DateRangeFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Iterator](http://php.net/Iterator) $iterator, array $comparators) | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([Iterator](http://php.net/Iterator) $iterator, array $comparators) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $iterator | The Iterator to filter | | array | $comparators | An array of DateComparator instances | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony DepthRangeFilterIterator DepthRangeFilterIterator ========================= class **DepthRangeFilterIterator** extends [FilterIterator](http://php.net/FilterIterator) DepthRangeFilterIterator limits the directory depth. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RecursiveIteratorIterator](http://php.net/RecursiveIteratorIterator) $iterator, int $minDepth = 0, int $maxDepth = PHP\_INT\_MAX) | | | bool | [accept](#method_accept)() Filters the iterator values. | | Details ------- ### \_\_construct([RecursiveIteratorIterator](http://php.net/RecursiveIteratorIterator) $iterator, int $minDepth = 0, int $maxDepth = PHP\_INT\_MAX) #### Parameters | | | | | --- | --- | --- | | [RecursiveIteratorIterator](http://php.net/RecursiveIteratorIterator) | $iterator | The Iterator to filter | | int | $minDepth | The min depth | | int | $maxDepth | The max depth | ### bool accept() Filters the iterator values. #### Return Value | | | | --- | --- | | bool | true if the value should be kept, false otherwise | symfony SortableIterator SortableIterator ================= class **SortableIterator** implements [IteratorAggregate](http://php.net/IteratorAggregate) SortableIterator applies a sort on a given Iterator. Constants --------- | | | | --- | --- | | SORT\_BY\_NAME | | | SORT\_BY\_TYPE | | | SORT\_BY\_ACCESSED\_TIME | | | SORT\_BY\_CHANGED\_TIME | | | SORT\_BY\_MODIFIED\_TIME | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Traversable](http://php.net/Traversable) $iterator, int|callable $sort) | | | | [getIterator](#method_getIterator)() | | Details ------- ### \_\_construct([Traversable](http://php.net/Traversable) $iterator, int|callable $sort) #### Parameters | | | | | --- | --- | --- | | [Traversable](http://php.net/Traversable) | $iterator | The Iterator to filter | | int|callable | $sort | The sort type (SORT\_BY\_NAME, SORT\_BY\_TYPE, or a PHP callback) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### getIterator() symfony AccessDeniedException AccessDeniedException ====================== class **AccessDeniedException** extends [UnexpectedValueException](http://php.net/UnexpectedValueException) symfony Transition Transition =========== class **Transition** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, string|string[] $froms, string|string[] $tos) | | | | [getName](#method_getName)() | | | | [getFroms](#method_getFroms)() | | | | [getTos](#method_getTos)() | | Details ------- ### \_\_construct(string $name, string|string[] $froms, string|string[] $tos) #### Parameters | | | | | --- | --- | --- | | string | $name | | | string|string[] | $froms | | | string|string[] | $tos | | ### getName() ### getFroms() ### getTos() symfony Definition Definition =========== class **Definition** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $places, array $transitions, string $initialPlace = null, [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") $metadataStore = null) | | | string|null | [getInitialPlace](#method_getInitialPlace)() | | | array | [getPlaces](#method_getPlaces)() | | | array | [getTransitions](#method_getTransitions)() | | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | [getMetadataStore](#method_getMetadataStore)() | | Details ------- ### \_\_construct(array $places, array $transitions, string $initialPlace = null, [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") $metadataStore = null) #### Parameters | | | | | --- | --- | --- | | array | $places | | | array | $transitions | | | string | $initialPlace | | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | $metadataStore | | ### string|null getInitialPlace() #### Return Value | | | | --- | --- | | string|null | | ### array getPlaces() #### Return Value | | | | --- | --- | | array | | ### array getTransitions() #### Return Value | | | | --- | --- | | array | | ### [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") getMetadataStore() #### Return Value | | | | --- | --- | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | | symfony Symfony\Component\Workflow\Exception Symfony\Component\Workflow\Exception ==================================== Classes ------- | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Workflow\Exception\InvalidArgumentException") | | | [InvalidDefinitionException](exception/invaliddefinitionexception "Symfony\Component\Workflow\Exception\InvalidDefinitionException") | Thrown by the DefinitionValidatorInterface when the definition is invalid. | | [InvalidTokenConfigurationException](exception/invalidtokenconfigurationexception "Symfony\Component\Workflow\Exception\InvalidTokenConfigurationException") | Thrown by GuardListener when there is no token set, but guards are placed on a transition. | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | | | [NotEnabledTransitionException](exception/notenabledtransitionexception "Symfony\Component\Workflow\Exception\NotEnabledTransitionException") | Thrown by Workflow when a not enabled transition is applied on a subject. | | [RuntimeException](exception/runtimeexception "Symfony\Component\Workflow\Exception\RuntimeException") | Base RuntimeException for the Workflow component. | | [TransitionException](exception/transitionexception "Symfony\Component\Workflow\Exception\TransitionException") | | | [UndefinedTransitionException](exception/undefinedtransitionexception "Symfony\Component\Workflow\Exception\UndefinedTransitionException") | Thrown by Workflow when an undefined transition is applied on a subject. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Workflow\Exception\ExceptionInterface")* | | symfony WorkflowInterface WorkflowInterface ================== interface **WorkflowInterface** Methods ------- | | | | | --- | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | [getMarking](#method_getMarking)(object $subject) Returns the object's Marking. | | | bool | [can](#method_can)(object $subject, string $transitionName) Returns true if the transition is enabled. | | | [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | [buildTransitionBlockerList](#method_buildTransitionBlockerList)($subject, string $transitionName) Builds a TransitionBlockerList to know why a transition is blocked. | | | [Marking](marking "Symfony\Component\Workflow\Marking") | [apply](#method_apply)(object $subject, string $transitionName) Fire a transition. | | | [Transition](transition "Symfony\Component\Workflow\Transition")[] | [getEnabledTransitions](#method_getEnabledTransitions)(object $subject) Returns all enabled transitions. | | | string | [getName](#method_getName)() | | | [Definition](definition "Symfony\Component\Workflow\Definition") | [getDefinition](#method_getDefinition)() | | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | [getMarkingStore](#method_getMarkingStore)() | | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | [getMetadataStore](#method_getMetadataStore)() | | Details ------- ### [Marking](marking "Symfony\Component\Workflow\Marking") getMarking(object $subject) Returns the object's Marking. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | The Marking | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | | ### bool can(object $subject, string $transitionName) Returns true if the transition is enabled. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | string | $transitionName | A transition | #### Return Value | | | | --- | --- | | bool | true if the transition is enabled | ### [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") buildTransitionBlockerList($subject, string $transitionName) Builds a TransitionBlockerList to know why a transition is blocked. #### Parameters | | | | | --- | --- | --- | | | $subject | | | string | $transitionName | | #### Return Value | | | | --- | --- | | [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | | ### [Marking](marking "Symfony\Component\Workflow\Marking") apply(object $subject, string $transitionName) Fire a transition. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | string | $transitionName | A transition | #### Return Value | | | | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | The new Marking | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | If the transition is not applicable | ### [Transition](transition "Symfony\Component\Workflow\Transition")[] getEnabledTransitions(object $subject) Returns all enabled transitions. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Transition](transition "Symfony\Component\Workflow\Transition")[] | All enabled transitions | ### string getName() #### Return Value | | | | --- | --- | | string | | ### [Definition](definition "Symfony\Component\Workflow\Definition") getDefinition() #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\Workflow\Definition") | | ### [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") getMarkingStore() #### Return Value | | | | --- | --- | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | | ### [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") getMetadataStore() #### Return Value | | | | --- | --- | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | | symfony Symfony\Component\Workflow\MarkingStore Symfony\Component\Workflow\MarkingStore ======================================= Classes ------- | | | | --- | --- | | [MultipleStateMarkingStore](markingstore/multiplestatemarkingstore "Symfony\Component\Workflow\MarkingStore\MultipleStateMarkingStore") | MultipleStateMarkingStore stores the marking into a property of the subject. | | [SingleStateMarkingStore](markingstore/singlestatemarkingstore "Symfony\Component\Workflow\MarkingStore\SingleStateMarkingStore") | SingleStateMarkingStore stores the marking into a property of the subject. | Interfaces ---------- | | | | --- | --- | | *[MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface")* | MarkingStoreInterface is the interface between the Workflow Component and a plain old PHP object: the subject. | symfony Symfony\Component\Workflow\SupportStrategy Symfony\Component\Workflow\SupportStrategy ========================================== Classes ------- | | | | --- | --- | | [ClassInstanceSupportStrategy](supportstrategy/classinstancesupportstrategy "Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy") deprecated | | | [InstanceOfSupportStrategy](supportstrategy/instanceofsupportstrategy "Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy") | | Interfaces ---------- | | | | --- | --- | | *[SupportStrategyInterface](supportstrategy/supportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface")* deprecated | | | *[WorkflowSupportStrategyInterface](supportstrategy/workflowsupportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface")* | | symfony Marking Marking ======== class **Marking** Marking contains the place of every tokens. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $representation = array()) | | | | [mark](#method_mark)($place) | | | | [unmark](#method_unmark)($place) | | | | [has](#method_has)($place) | | | | [getPlaces](#method_getPlaces)() | | Details ------- ### \_\_construct(array $representation = array()) #### Parameters | | | | | --- | --- | --- | | array | $representation | Keys are the place name and values should be 1 | ### mark($place) #### Parameters | | | | | --- | --- | --- | | | $place | | ### unmark($place) #### Parameters | | | | | --- | --- | --- | | | $place | | ### has($place) #### Parameters | | | | | --- | --- | --- | | | $place | | ### getPlaces()
programming_docs
symfony Symfony\Component\Workflow\Validator Symfony\Component\Workflow\Validator ==================================== Classes ------- | | | | --- | --- | | [StateMachineValidator](validator/statemachinevalidator "Symfony\Component\Workflow\Validator\StateMachineValidator") | | | [WorkflowValidator](validator/workflowvalidator "Symfony\Component\Workflow\Validator\WorkflowValidator") | | Interfaces ---------- | | | | --- | --- | | *[DefinitionValidatorInterface](validator/definitionvalidatorinterface "Symfony\Component\Workflow\Validator\DefinitionValidatorInterface")* | | symfony StateMachine StateMachine ============= class **StateMachine** extends [Workflow](workflow "Symfony\Component\Workflow\Workflow") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Definition](definition "Symfony\Component\Workflow\Definition") $definition, [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") $markingStore = null, [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, string $name = 'unnamed') | | | [Marking](marking "Symfony\Component\Workflow\Marking") | [getMarking](#method_getMarking)(object $subject) Returns the object's Marking. | from [Workflow](workflow#method_getMarking "Symfony\Component\Workflow\Workflow") | | bool | [can](#method_can)(object $subject, string $transitionName) Returns true if the transition is enabled. | from [Workflow](workflow#method_can "Symfony\Component\Workflow\Workflow") | | [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | [buildTransitionBlockerList](#method_buildTransitionBlockerList)($subject, string $transitionName) Builds a TransitionBlockerList to know why a transition is blocked. | from [Workflow](workflow#method_buildTransitionBlockerList "Symfony\Component\Workflow\Workflow") | | [Marking](marking "Symfony\Component\Workflow\Marking") | [apply](#method_apply)(object $subject, string $transitionName) Fire a transition. | from [Workflow](workflow#method_apply "Symfony\Component\Workflow\Workflow") | | [Transition](transition "Symfony\Component\Workflow\Transition")[] | [getEnabledTransitions](#method_getEnabledTransitions)(object $subject) Returns all enabled transitions. | from [Workflow](workflow#method_getEnabledTransitions "Symfony\Component\Workflow\Workflow") | | string | [getName](#method_getName)() | from [Workflow](workflow#method_getName "Symfony\Component\Workflow\Workflow") | | [Definition](definition "Symfony\Component\Workflow\Definition") | [getDefinition](#method_getDefinition)() | from [Workflow](workflow#method_getDefinition "Symfony\Component\Workflow\Workflow") | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | [getMarkingStore](#method_getMarkingStore)() | from [Workflow](workflow#method_getMarkingStore "Symfony\Component\Workflow\Workflow") | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | [getMetadataStore](#method_getMetadataStore)() | from [Workflow](workflow#method_getMetadataStore "Symfony\Component\Workflow\Workflow") | Details ------- ### \_\_construct([Definition](definition "Symfony\Component\Workflow\Definition") $definition, [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") $markingStore = null, [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, string $name = 'unnamed') #### Parameters | | | | | --- | --- | --- | | [Definition](definition "Symfony\Component\Workflow\Definition") | $definition | | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | $markingStore | | | [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | string | $name | | ### [Marking](marking "Symfony\Component\Workflow\Marking") getMarking(object $subject) Returns the object's Marking. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | The Marking | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | | ### bool can(object $subject, string $transitionName) Returns true if the transition is enabled. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | string | $transitionName | A transition | #### Return Value | | | | --- | --- | | bool | true if the transition is enabled | ### [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") buildTransitionBlockerList($subject, string $transitionName) Builds a TransitionBlockerList to know why a transition is blocked. #### Parameters | | | | | --- | --- | --- | | | $subject | | | string | $transitionName | | #### Return Value | | | | --- | --- | | [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | | ### [Marking](marking "Symfony\Component\Workflow\Marking") apply(object $subject, string $transitionName) Fire a transition. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | string | $transitionName | A transition | #### Return Value | | | | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | The new Marking | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | If the transition is not applicable | ### [Transition](transition "Symfony\Component\Workflow\Transition")[] getEnabledTransitions(object $subject) Returns all enabled transitions. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Transition](transition "Symfony\Component\Workflow\Transition")[] | All enabled transitions | ### string getName() #### Return Value | | | | --- | --- | | string | | ### [Definition](definition "Symfony\Component\Workflow\Definition") getDefinition() #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\Workflow\Definition") | | ### [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") getMarkingStore() #### Return Value | | | | --- | --- | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | | ### [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") getMetadataStore() #### Return Value | | | | --- | --- | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | | symfony Symfony\Component\Workflow\Event Symfony\Component\Workflow\Event ================================ Classes ------- | | | | --- | --- | | [Event](event/event "Symfony\Component\Workflow\Event\Event") | | | [GuardEvent](event/guardevent "Symfony\Component\Workflow\Event\GuardEvent") | | symfony DefinitionBuilder DefinitionBuilder ================== class **DefinitionBuilder** Builds a definition. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $places = array(), array $transitions = array()) | | | [Definition](definition "Symfony\Component\Workflow\Definition") | [build](#method_build)() | | | $this | [clear](#method_clear)() Clear all data in the builder. | | | $this | [setInitialPlace](#method_setInitialPlace)(string $place) | | | $this | [addPlace](#method_addPlace)(string $place) | | | $this | [addPlaces](#method_addPlaces)(array $places) | | | $this | [addTransitions](#method_addTransitions)(array $transitions) | | | $this | [addTransition](#method_addTransition)([Transition](transition "Symfony\Component\Workflow\Transition") $transition) | | | $this | [setMetadataStore](#method_setMetadataStore)([MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") $metadataStore) | | | $this | [reset](#method_reset)() deprecated | | Details ------- ### \_\_construct(array $places = array(), array $transitions = array()) #### Parameters | | | | | --- | --- | --- | | array | $places | | | array | $transitions | | ### [Definition](definition "Symfony\Component\Workflow\Definition") build() #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\Workflow\Definition") | | ### $this clear() Clear all data in the builder. #### Return Value | | | | --- | --- | | $this | | ### $this setInitialPlace(string $place) #### Parameters | | | | | --- | --- | --- | | string | $place | | #### Return Value | | | | --- | --- | | $this | | ### $this addPlace(string $place) #### Parameters | | | | | --- | --- | --- | | string | $place | | #### Return Value | | | | --- | --- | | $this | | ### $this addPlaces(array $places) #### Parameters | | | | | --- | --- | --- | | array | $places | | #### Return Value | | | | --- | --- | | $this | | ### $this addTransitions(array $transitions) #### Parameters | | | | | --- | --- | --- | | array | $transitions | | #### Return Value | | | | --- | --- | | $this | | ### $this addTransition([Transition](transition "Symfony\Component\Workflow\Transition") $transition) #### Parameters | | | | | --- | --- | --- | | [Transition](transition "Symfony\Component\Workflow\Transition") | $transition | | #### Return Value | | | | --- | --- | | $this | | ### $this setMetadataStore([MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") $metadataStore) #### Parameters | | | | | --- | --- | --- | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | $metadataStore | | #### Return Value | | | | --- | --- | | $this | | ### $this reset() deprecated deprecated | since | Symfony 4.1, use the clear() method instead. | #### Return Value | | | | --- | --- | | $this | | symfony Symfony\Component\Workflow\Metadata Symfony\Component\Workflow\Metadata =================================== Classes ------- | | | | --- | --- | | [GetMetadataTrait](metadata/getmetadatatrait "Symfony\Component\Workflow\Metadata\GetMetadataTrait") | | | [InMemoryMetadataStore](metadata/inmemorymetadatastore "Symfony\Component\Workflow\Metadata\InMemoryMetadataStore") | | Interfaces ---------- | | | | --- | --- | | *[MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface")* | MetadataStoreInterface is able to fetch metadata for a specific workflow. | symfony TransitionBlocker TransitionBlocker ================== class **TransitionBlocker** A reason why a transition cannot be performed for a subject. Constants --------- | | | | --- | --- | | BLOCKED\_BY\_MARKING | | | BLOCKED\_BY\_EXPRESSION\_GUARD\_LISTENER | | | UNKNOWN | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, string $code, array $parameters = array()) | | | static [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | [createBlockedByMarking](#method_createBlockedByMarking)([Marking](marking "Symfony\Component\Workflow\Marking") $marking) Create a blocker that says the transition cannot be made because it is not enabled. | | | static [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | [createBlockedByExpressionGuardListener](#method_createBlockedByExpressionGuardListener)(string $expression) Creates a blocker that says the transition cannot be made because it has been blocked by the expression guard listener. | | | static [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | [createUnknown](#method_createUnknown)() Creates a blocker that says the transition cannot be made because of an unknown reason. | | | string | [getMessage](#method_getMessage)() | | | string | [getCode](#method_getCode)() | | | array | [getParameters](#method_getParameters)() | | Details ------- ### \_\_construct(string $message, string $code, array $parameters = array()) #### Parameters | | | | | --- | --- | --- | | string | $message | | | string | $code | | | array | $parameters | | ### static [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") createBlockedByMarking([Marking](marking "Symfony\Component\Workflow\Marking") $marking) Create a blocker that says the transition cannot be made because it is not enabled. It means the subject is in wrong place (i.e. status): \* If the workflow is a state machine: the subject is not in the previous place of the transition. \* If the workflow is a workflow: the subject is not in all previous places of the transition. #### Parameters | | | | | --- | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | $marking | | #### Return Value | | | | --- | --- | | [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | | ### static [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") createBlockedByExpressionGuardListener(string $expression) Creates a blocker that says the transition cannot be made because it has been blocked by the expression guard listener. #### Parameters | | | | | --- | --- | --- | | string | $expression | | #### Return Value | | | | --- | --- | | [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | | ### static [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") createUnknown() Creates a blocker that says the transition cannot be made because of an unknown reason. This blocker code is chiefly for preserving backwards compatibility. #### Return Value | | | | --- | --- | | [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | | ### string getMessage() #### Return Value | | | | --- | --- | | string | | ### string getCode() #### Return Value | | | | --- | --- | | string | | ### array getParameters() #### Return Value | | | | --- | --- | | array | | symfony Symfony\Component\Workflow\Dumper Symfony\Component\Workflow\Dumper ================================= Classes ------- | | | | --- | --- | | [GraphvizDumper](dumper/graphvizdumper "Symfony\Component\Workflow\Dumper\GraphvizDumper") | GraphvizDumper dumps a workflow as a graphviz file. | | [PlantUmlDumper](dumper/plantumldumper "Symfony\Component\Workflow\Dumper\PlantUmlDumper") | PlantUmlDumper dumps a workflow as a PlantUML file. | | [StateMachineGraphvizDumper](dumper/statemachinegraphvizdumper "Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper") | | Interfaces ---------- | | | | --- | --- | | *[DumperInterface](dumper/dumperinterface "Symfony\Component\Workflow\Dumper\DumperInterface")* | DumperInterface is the interface implemented by workflow dumper classes. | symfony Symfony\Component\Workflow\DependencyInjection Symfony\Component\Workflow\DependencyInjection ============================================== Classes ------- | | | | --- | --- | | [ValidateWorkflowsPass](dependencyinjection/validateworkflowspass "Symfony\Component\Workflow\DependencyInjection\ValidateWorkflowsPass") | | symfony TransitionBlockerList TransitionBlockerList ====================== class **TransitionBlockerList** implements [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) A list of transition blockers. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $blockers = array()) | | | void | [add](#method_add)([TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") $blocker) | | | void | [clear](#method_clear)() | | | bool | [isEmpty](#method_isEmpty)() | | | [ArrayIterator](http://php.net/ArrayIterator)|[TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker")[] | [getIterator](#method_getIterator)() {@inheritdoc} | | | int | [count](#method_count)() | | Details ------- ### \_\_construct(array $blockers = array()) #### Parameters | | | | | --- | --- | --- | | array | $blockers | | ### void add([TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") $blocker) #### Parameters | | | | | --- | --- | --- | | [TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | $blocker | | #### Return Value | | | | --- | --- | | void | | ### void clear() #### Return Value | | | | --- | --- | | void | | ### bool isEmpty() #### Return Value | | | | --- | --- | | bool | | ### [ArrayIterator](http://php.net/ArrayIterator)|[TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker")[] getIterator() {@inheritdoc} #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator)|[TransitionBlocker](transitionblocker "Symfony\Component\Workflow\TransitionBlocker")[] | | ### int count() #### Return Value | | | | --- | --- | | int | | symfony Symfony\Component\Workflow\EventListener Symfony\Component\Workflow\EventListener ======================================== Classes ------- | | | | --- | --- | | [AuditTrailListener](eventlistener/audittraillistener "Symfony\Component\Workflow\EventListener\AuditTrailListener") | | | [ExpressionLanguage](eventlistener/expressionlanguage "Symfony\Component\Workflow\EventListener\ExpressionLanguage") | Adds some function to the default Symfony Security ExpressionLanguage. | | [GuardListener](eventlistener/guardlistener "Symfony\Component\Workflow\EventListener\GuardListener") | | symfony Registry Registry ========= class **Registry** Methods ------- | | | | | --- | --- | --- | | | [add](#method_add)([Workflow](workflow "Symfony\Component\Workflow\Workflow") $workflow, [SupportStrategyInterface](supportstrategy/supportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface") $supportStrategy) deprecated | | | | [addWorkflow](#method_addWorkflow)([WorkflowInterface](workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, [WorkflowSupportStrategyInterface](supportstrategy/workflowsupportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface") $supportStrategy) | | | [Workflow](workflow "Symfony\Component\Workflow\Workflow") | [get](#method_get)(object $subject, string|null $workflowName = null) | | | array | [all](#method_all)(object $subject) | | Details ------- ### add([Workflow](workflow "Symfony\Component\Workflow\Workflow") $workflow, [SupportStrategyInterface](supportstrategy/supportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface") $supportStrategy) deprecated deprecated | since | Symfony 4.1, use addWorkflow() instead | #### Parameters | | | | | --- | --- | --- | | [Workflow](workflow "Symfony\Component\Workflow\Workflow") | $workflow | | | [SupportStrategyInterface](supportstrategy/supportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface") | $supportStrategy | | ### addWorkflow([WorkflowInterface](workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, [WorkflowSupportStrategyInterface](supportstrategy/workflowsupportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface") $supportStrategy) #### Parameters | | | | | --- | --- | --- | | [WorkflowInterface](workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | | [WorkflowSupportStrategyInterface](supportstrategy/workflowsupportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface") | $supportStrategy | | ### [Workflow](workflow "Symfony\Component\Workflow\Workflow") get(object $subject, string|null $workflowName = null) #### Parameters | | | | | --- | --- | --- | | object | $subject | | | string|null | $workflowName | | #### Return Value | | | | --- | --- | | [Workflow](workflow "Symfony\Component\Workflow\Workflow") | | ### array all(object $subject) #### Parameters | | | | | --- | --- | --- | | object | $subject | | #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony Workflow Workflow ========= class **Workflow** implements [WorkflowInterface](workflowinterface "Symfony\Component\Workflow\WorkflowInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Definition](definition "Symfony\Component\Workflow\Definition") $definition, [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") $markingStore = null, [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, string $name = 'unnamed') | | | [Marking](marking "Symfony\Component\Workflow\Marking") | [getMarking](#method_getMarking)(object $subject) Returns the object's Marking. | | | bool | [can](#method_can)(object $subject, string $transitionName) Returns true if the transition is enabled. | | | [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | [buildTransitionBlockerList](#method_buildTransitionBlockerList)($subject, string $transitionName) Builds a TransitionBlockerList to know why a transition is blocked. | | | [Marking](marking "Symfony\Component\Workflow\Marking") | [apply](#method_apply)(object $subject, string $transitionName) Fire a transition. | | | [Transition](transition "Symfony\Component\Workflow\Transition")[] | [getEnabledTransitions](#method_getEnabledTransitions)(object $subject) Returns all enabled transitions. | | | string | [getName](#method_getName)() | | | [Definition](definition "Symfony\Component\Workflow\Definition") | [getDefinition](#method_getDefinition)() | | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | [getMarkingStore](#method_getMarkingStore)() | | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | [getMetadataStore](#method_getMetadataStore)() | | Details ------- ### \_\_construct([Definition](definition "Symfony\Component\Workflow\Definition") $definition, [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") $markingStore = null, [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher = null, string $name = 'unnamed') #### Parameters | | | | | --- | --- | --- | | [Definition](definition "Symfony\Component\Workflow\Definition") | $definition | | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | $markingStore | | | [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | | string | $name | | ### [Marking](marking "Symfony\Component\Workflow\Marking") getMarking(object $subject) Returns the object's Marking. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | The Marking | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | | ### bool can(object $subject, string $transitionName) Returns true if the transition is enabled. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | string | $transitionName | A transition | #### Return Value | | | | --- | --- | | bool | true if the transition is enabled | ### [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") buildTransitionBlockerList($subject, string $transitionName) Builds a TransitionBlockerList to know why a transition is blocked. #### Parameters | | | | | --- | --- | --- | | | $subject | | | string | $transitionName | | #### Return Value | | | | --- | --- | | [TransitionBlockerList](transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | | ### [Marking](marking "Symfony\Component\Workflow\Marking") apply(object $subject, string $transitionName) Fire a transition. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | string | $transitionName | A transition | #### Return Value | | | | --- | --- | | [Marking](marking "Symfony\Component\Workflow\Marking") | The new Marking | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Workflow\Exception\LogicException") | If the transition is not applicable | ### [Transition](transition "Symfony\Component\Workflow\Transition")[] getEnabledTransitions(object $subject) Returns all enabled transitions. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Transition](transition "Symfony\Component\Workflow\Transition")[] | All enabled transitions | ### string getName() #### Return Value | | | | --- | --- | | string | | ### [Definition](definition "Symfony\Component\Workflow\Definition") getDefinition() #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\Workflow\Definition") | | ### [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") getMarkingStore() #### Return Value | | | | --- | --- | | [MarkingStoreInterface](markingstore/markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") | | ### [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") getMetadataStore() #### Return Value | | | | --- | --- | | [MetadataStoreInterface](metadata/metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") | | symfony StateMachineValidator StateMachineValidator ====================== class **StateMachineValidator** implements [DefinitionValidatorInterface](definitionvalidatorinterface "Symfony\Component\Workflow\Validator\DefinitionValidatorInterface") Methods ------- | | | | | --- | --- | --- | | | [validate](#method_validate)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, string $name) | | Details ------- ### validate([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, string $name) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | | string | $name | | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Workflow\Exception\InvalidDefinitionException") | on invalid definition | symfony WorkflowValidator WorkflowValidator ================== class **WorkflowValidator** implements [DefinitionValidatorInterface](definitionvalidatorinterface "Symfony\Component\Workflow\Validator\DefinitionValidatorInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool $singlePlace = false) | | | | [validate](#method_validate)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, string $name) | | Details ------- ### \_\_construct(bool $singlePlace = false) #### Parameters | | | | | --- | --- | --- | | bool | $singlePlace | | ### validate([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, string $name) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | | string | $name | | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Workflow\Exception\InvalidDefinitionException") | on invalid definition | symfony DefinitionValidatorInterface DefinitionValidatorInterface ============================= interface **DefinitionValidatorInterface** Methods ------- | | | | | --- | --- | --- | | | [validate](#method_validate)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, string $name) | | Details ------- ### validate([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, string $name) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | | string | $name | | #### Exceptions | | | | --- | --- | | [InvalidDefinitionException](../exception/invaliddefinitionexception "Symfony\Component\Workflow\Exception\InvalidDefinitionException") | on invalid definition | symfony ClassInstanceSupportStrategy deprecated ClassInstanceSupportStrategy deprecated ======================================== class **ClassInstanceSupportStrategy** implements [SupportStrategyInterface](supportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface") deprecated | since | Symfony 4.1, use InstanceOfSupportStrategy instead | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $className) | | | bool | [supports](#method_supports)([Workflow](../workflow "Symfony\Component\Workflow\Workflow") $workflow, object $subject) | | | string | [getClassName](#method_getClassName)() | | Details ------- ### \_\_construct(string $className) #### Parameters | | | | | --- | --- | --- | | string | $className | | ### bool supports([Workflow](../workflow "Symfony\Component\Workflow\Workflow") $workflow, object $subject) #### Parameters | | | | | --- | --- | --- | | [Workflow](../workflow "Symfony\Component\Workflow\Workflow") | $workflow | | | object | $subject | | #### Return Value | | | | --- | --- | | bool | | ### string getClassName() #### Return Value | | | | --- | --- | | string | | symfony InstanceOfSupportStrategy InstanceOfSupportStrategy ========================== class **InstanceOfSupportStrategy** implements [WorkflowSupportStrategyInterface](workflowsupportstrategyinterface "Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $className) | | | bool | [supports](#method_supports)([WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, $subject) | | | string | [getClassName](#method_getClassName)() | | Details ------- ### \_\_construct(string $className) #### Parameters | | | | | --- | --- | --- | | string | $className | | ### bool supports([WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, $subject) #### Parameters | | | | | --- | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | | | $subject | | #### Return Value | | | | --- | --- | | bool | | ### string getClassName() #### Return Value | | | | --- | --- | | string | | symfony SupportStrategyInterface deprecated SupportStrategyInterface deprecated ==================================== interface **SupportStrategyInterface** deprecated | since | Symfony 4.1, use WorkflowSupportStrategyInterface instead | Methods ------- | | | | | --- | --- | --- | | bool | [supports](#method_supports)([Workflow](../workflow "Symfony\Component\Workflow\Workflow") $workflow, object $subject) | | Details ------- ### bool supports([Workflow](../workflow "Symfony\Component\Workflow\Workflow") $workflow, object $subject) #### Parameters | | | | | --- | --- | --- | | [Workflow](../workflow "Symfony\Component\Workflow\Workflow") | $workflow | | | object | $subject | | #### Return Value | | | | --- | --- | | bool | | symfony WorkflowSupportStrategyInterface WorkflowSupportStrategyInterface ================================= interface **WorkflowSupportStrategyInterface** Methods ------- | | | | | --- | --- | --- | | bool | [supports](#method_supports)([WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, $subject) | | Details ------- ### bool supports([WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, $subject) #### Parameters | | | | | --- | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | | | $subject | | #### Return Value | | | | --- | --- | | bool | | symfony MarkingStoreInterface MarkingStoreInterface ====================== interface **MarkingStoreInterface** MarkingStoreInterface is the interface between the Workflow Component and a plain old PHP object: the subject. It converts the Marking into something understandable by the subject and vice versa. Methods ------- | | | | | --- | --- | --- | | [Marking](../marking "Symfony\Component\Workflow\Marking") | [getMarking](#method_getMarking)(object $subject) Gets a Marking from a subject. | | | | [setMarking](#method_setMarking)(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking) Sets a Marking to a subject. | | Details ------- ### [Marking](../marking "Symfony\Component\Workflow\Marking") getMarking(object $subject) Gets a Marking from a subject. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Marking](../marking "Symfony\Component\Workflow\Marking") | The marking | ### setMarking(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking) Sets a Marking to a subject. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A marking | symfony SingleStateMarkingStore SingleStateMarkingStore ======================== class **SingleStateMarkingStore** implements [MarkingStoreInterface](markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") SingleStateMarkingStore stores the marking into a property of the subject. This store deals with a "single state" Marking. It means a subject can be in one and only one state at the same time. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $property = 'marking', [PropertyAccessorInterface](../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") $propertyAccessor = null) | | | [Marking](../marking "Symfony\Component\Workflow\Marking") | [getMarking](#method_getMarking)(object $subject) Gets a Marking from a subject. | | | | [setMarking](#method_setMarking)(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking) Sets a Marking to a subject. | | | string | [getProperty](#method_getProperty)() | | Details ------- ### \_\_construct(string $property = 'marking', [PropertyAccessorInterface](../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") $propertyAccessor = null) #### Parameters | | | | | --- | --- | --- | | string | $property | | | [PropertyAccessorInterface](../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") | $propertyAccessor | | ### [Marking](../marking "Symfony\Component\Workflow\Marking") getMarking(object $subject) Gets a Marking from a subject. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Marking](../marking "Symfony\Component\Workflow\Marking") | The marking | ### setMarking(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking) Sets a Marking to a subject. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A marking | ### string getProperty() #### Return Value | | | | --- | --- | | string | | symfony MultipleStateMarkingStore MultipleStateMarkingStore ========================== class **MultipleStateMarkingStore** implements [MarkingStoreInterface](markingstoreinterface "Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface") MultipleStateMarkingStore stores the marking into a property of the subject. This store deals with a "multiple state" Marking. It means a subject can be in many states at the same time. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $property = 'marking', [PropertyAccessorInterface](../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") $propertyAccessor = null) | | | [Marking](../marking "Symfony\Component\Workflow\Marking") | [getMarking](#method_getMarking)(object $subject) Gets a Marking from a subject. | | | | [setMarking](#method_setMarking)(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking) Sets a Marking to a subject. | | | string | [getProperty](#method_getProperty)() | | Details ------- ### \_\_construct(string $property = 'marking', [PropertyAccessorInterface](../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") $propertyAccessor = null) #### Parameters | | | | | --- | --- | --- | | string | $property | | | [PropertyAccessorInterface](../../propertyaccess/propertyaccessorinterface "Symfony\Component\PropertyAccess\PropertyAccessorInterface") | $propertyAccessor | | ### [Marking](../marking "Symfony\Component\Workflow\Marking") getMarking(object $subject) Gets a Marking from a subject. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | #### Return Value | | | | --- | --- | | [Marking](../marking "Symfony\Component\Workflow\Marking") | The marking | ### setMarking(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking) Sets a Marking to a subject. #### Parameters | | | | | --- | --- | --- | | object | $subject | A subject | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A marking | ### string getProperty() #### Return Value | | | | --- | --- | | string | | symfony ValidateWorkflowsPass ValidateWorkflowsPass ====================== class **ValidateWorkflowsPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $definitionTag = 'workflow.definition') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $definitionTag = 'workflow.definition') #### Parameters | | | | | --- | --- | --- | | string | $definitionTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | |
programming_docs
symfony InvalidTokenConfigurationException InvalidTokenConfigurationException =================================== class **InvalidTokenConfigurationException** extends [LogicException](logicexception "Symfony\Component\Workflow\Exception\LogicException") implements [ExceptionInterface](exceptioninterface "Symfony\Component\Workflow\Exception\ExceptionInterface") Thrown by GuardListener when there is no token set, but guards are placed on a transition. symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Workflow\Exception\ExceptionInterface") symfony TransitionException TransitionException ==================== class **TransitionException** extends [LogicException](logicexception "Symfony\Component\Workflow\Exception\LogicException") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($subject, string $transitionName, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, string $message) | | | | [getSubject](#method_getSubject)() | | | string | [getTransitionName](#method_getTransitionName)() | | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | [getWorkflow](#method_getWorkflow)() | | Details ------- ### \_\_construct($subject, string $transitionName, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, string $message) #### Parameters | | | | | --- | --- | --- | | | $subject | | | string | $transitionName | | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | | string | $message | | ### getSubject() ### string getTransitionName() #### Return Value | | | | --- | --- | | string | | ### [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") getWorkflow() #### Return Value | | | | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | | symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Workflow\Exception\ExceptionInterface") symfony InvalidDefinitionException InvalidDefinitionException =========================== class **InvalidDefinitionException** extends [LogicException](logicexception "Symfony\Component\Workflow\Exception\LogicException") Thrown by the DefinitionValidatorInterface when the definition is invalid. symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Workflow\Exception\ExceptionInterface") Base RuntimeException for the Workflow component. symfony UndefinedTransitionException UndefinedTransitionException ============================= class **UndefinedTransitionException** extends [TransitionException](transitionexception "Symfony\Component\Workflow\Exception\TransitionException") Thrown by Workflow when an undefined transition is applied on a subject. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($subject, string $transitionName, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow) | | | | [getSubject](#method_getSubject)() | from [TransitionException](transitionexception#method_getSubject "Symfony\Component\Workflow\Exception\TransitionException") | | string | [getTransitionName](#method_getTransitionName)() | from [TransitionException](transitionexception#method_getTransitionName "Symfony\Component\Workflow\Exception\TransitionException") | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | [getWorkflow](#method_getWorkflow)() | from [TransitionException](transitionexception#method_getWorkflow "Symfony\Component\Workflow\Exception\TransitionException") | Details ------- ### \_\_construct($subject, string $transitionName, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow) #### Parameters | | | | | --- | --- | --- | | | $subject | | | string | $transitionName | | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | ### getSubject() ### string getTransitionName() #### Return Value | | | | --- | --- | | string | | ### [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") getWorkflow() #### Return Value | | | | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | | symfony NotEnabledTransitionException NotEnabledTransitionException ============================== class **NotEnabledTransitionException** extends [TransitionException](transitionexception "Symfony\Component\Workflow\Exception\TransitionException") Thrown by Workflow when a not enabled transition is applied on a subject. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($subject, string $transitionName, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") $transitionBlockerList) | | | | [getSubject](#method_getSubject)() | from [TransitionException](transitionexception#method_getSubject "Symfony\Component\Workflow\Exception\TransitionException") | | string | [getTransitionName](#method_getTransitionName)() | from [TransitionException](transitionexception#method_getTransitionName "Symfony\Component\Workflow\Exception\TransitionException") | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | [getWorkflow](#method_getWorkflow)() | from [TransitionException](transitionexception#method_getWorkflow "Symfony\Component\Workflow\Exception\TransitionException") | | [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | [getTransitionBlockerList](#method_getTransitionBlockerList)() | | Details ------- ### \_\_construct($subject, string $transitionName, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow, [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") $transitionBlockerList) #### Parameters | | | | | --- | --- | --- | | | $subject | | | string | $transitionName | | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | | [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | $transitionBlockerList | | ### getSubject() ### string getTransitionName() #### Return Value | | | | --- | --- | | string | | ### [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") getWorkflow() #### Return Value | | | | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | | ### [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") getTransitionBlockerList() #### Return Value | | | | --- | --- | | [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | | symfony Event Event ====== class **Event** extends [Event](../../eventdispatcher/event "Symfony\Component\EventDispatcher\Event") Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking, [Transition](../transition "Symfony\Component\Workflow\Transition") $transition, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow = null) | | | | [getMarking](#method_getMarking)() | | | | [getSubject](#method_getSubject)() | | | | [getTransition](#method_getTransition)() | | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | [getWorkflow](#method_getWorkflow)() | | | | [getWorkflowName](#method_getWorkflowName)() | | | | [getMetadata](#method_getMetadata)(string $key, $subject) | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking, [Transition](../transition "Symfony\Component\Workflow\Transition") $transition, [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") $workflow = null) #### Parameters | | | | | --- | --- | --- | | object | $subject | | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | | | [Transition](../transition "Symfony\Component\Workflow\Transition") | $transition | | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | $workflow | | ### getMarking() ### getSubject() ### getTransition() ### [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") getWorkflow() #### Return Value | | | | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | | ### getWorkflowName() ### getMetadata(string $key, $subject) #### Parameters | | | | | --- | --- | --- | | string | $key | | | | $subject | | symfony GuardEvent GuardEvent =========== class **GuardEvent** extends [Event](event "Symfony\Component\Workflow\Event\Event") Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking, [Transition](../transition "Symfony\Component\Workflow\Transition") $transition, $workflowName = 'unnamed') | | | | [getMarking](#method_getMarking)() | from [Event](event#method_getMarking "Symfony\Component\Workflow\Event\Event") | | | [getSubject](#method_getSubject)() | from [Event](event#method_getSubject "Symfony\Component\Workflow\Event\Event") | | | [getTransition](#method_getTransition)() | from [Event](event#method_getTransition "Symfony\Component\Workflow\Event\Event") | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | [getWorkflow](#method_getWorkflow)() | from [Event](event#method_getWorkflow "Symfony\Component\Workflow\Event\Event") | | | [getWorkflowName](#method_getWorkflowName)() | from [Event](event#method_getWorkflowName "Symfony\Component\Workflow\Event\Event") | | | [getMetadata](#method_getMetadata)(string $key, $subject) | from [Event](event#method_getMetadata "Symfony\Component\Workflow\Event\Event") | | | [isBlocked](#method_isBlocked)() | | | | [setBlocked](#method_setBlocked)($blocked) | | | [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | [getTransitionBlockerList](#method_getTransitionBlockerList)() | | | void | [addTransitionBlocker](#method_addTransitionBlocker)([TransitionBlocker](../transitionblocker "Symfony\Component\Workflow\TransitionBlocker") $transitionBlocker) | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct(object $subject, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking, [Transition](../transition "Symfony\Component\Workflow\Transition") $transition, $workflowName = 'unnamed') #### Parameters | | | | | --- | --- | --- | | object | $subject | | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | | | [Transition](../transition "Symfony\Component\Workflow\Transition") | $transition | | | | $workflowName | | ### getMarking() ### getSubject() ### getTransition() ### [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") getWorkflow() #### Return Value | | | | --- | --- | | [WorkflowInterface](../workflowinterface "Symfony\Component\Workflow\WorkflowInterface") | | ### getWorkflowName() ### getMetadata(string $key, $subject) #### Parameters | | | | | --- | --- | --- | | string | $key | | | | $subject | | ### isBlocked() ### setBlocked($blocked) #### Parameters | | | | | --- | --- | --- | | | $blocked | | ### [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") getTransitionBlockerList() #### Return Value | | | | --- | --- | | [TransitionBlockerList](../transitionblockerlist "Symfony\Component\Workflow\TransitionBlockerList") | | ### void addTransitionBlocker([TransitionBlocker](../transitionblocker "Symfony\Component\Workflow\TransitionBlocker") $transitionBlocker) #### Parameters | | | | | --- | --- | --- | | [TransitionBlocker](../transitionblocker "Symfony\Component\Workflow\TransitionBlocker") | $transitionBlocker | | #### Return Value | | | | --- | --- | | void | | symfony InMemoryMetadataStore InMemoryMetadataStore ====================== class **InMemoryMetadataStore** implements [MetadataStoreInterface](metadatastoreinterface "Symfony\Component\Workflow\Metadata\MetadataStoreInterface") Traits ------ | | | | --- | --- | | [GetMetadataTrait](getmetadatatrait "Symfony\Component\Workflow\Metadata\GetMetadataTrait") | | Methods ------- | | | | | --- | --- | --- | | | [getMetadata](#method_getMetadata)(string $key, $subject = null) | from [GetMetadataTrait](getmetadatatrait#method_getMetadata "Symfony\Component\Workflow\Metadata\GetMetadataTrait") | | | [\_\_construct](#method___construct)(array $workflowMetadata = array(), array $placesMetadata = array(), [SplObjectStorage](http://php.net/SplObjectStorage) $transitionsMetadata = null) | | | array | [getWorkflowMetadata](#method_getWorkflowMetadata)() | | | array | [getPlaceMetadata](#method_getPlaceMetadata)(string $place) | | | array | [getTransitionMetadata](#method_getTransitionMetadata)([Transition](../transition "Symfony\Component\Workflow\Transition") $transition) | | Details ------- ### getMetadata(string $key, $subject = null) #### Parameters | | | | | --- | --- | --- | | string | $key | | | | $subject | | ### \_\_construct(array $workflowMetadata = array(), array $placesMetadata = array(), [SplObjectStorage](http://php.net/SplObjectStorage) $transitionsMetadata = null) #### Parameters | | | | | --- | --- | --- | | array | $workflowMetadata | | | array | $placesMetadata | | | [SplObjectStorage](http://php.net/SplObjectStorage) | $transitionsMetadata | | ### array getWorkflowMetadata() #### Return Value | | | | --- | --- | | array | | ### array getPlaceMetadata(string $place) #### Parameters | | | | | --- | --- | --- | | string | $place | | #### Return Value | | | | --- | --- | | array | | ### array getTransitionMetadata([Transition](../transition "Symfony\Component\Workflow\Transition") $transition) #### Parameters | | | | | --- | --- | --- | | [Transition](../transition "Symfony\Component\Workflow\Transition") | $transition | | #### Return Value | | | | --- | --- | | array | | symfony MetadataStoreInterface MetadataStoreInterface ======================= interface **MetadataStoreInterface** MetadataStoreInterface is able to fetch metadata for a specific workflow. Methods ------- | | | | | --- | --- | --- | | array | [getWorkflowMetadata](#method_getWorkflowMetadata)() | | | array | [getPlaceMetadata](#method_getPlaceMetadata)(string $place) | | | array | [getTransitionMetadata](#method_getTransitionMetadata)([Transition](../transition "Symfony\Component\Workflow\Transition") $transition) | | | | [getMetadata](#method_getMetadata)(string $key, $subject = null) Returns the metadata for a specific subject. | | Details ------- ### array getWorkflowMetadata() #### Return Value | | | | --- | --- | | array | | ### array getPlaceMetadata(string $place) #### Parameters | | | | | --- | --- | --- | | string | $place | | #### Return Value | | | | --- | --- | | array | | ### array getTransitionMetadata([Transition](../transition "Symfony\Component\Workflow\Transition") $transition) #### Parameters | | | | | --- | --- | --- | | [Transition](../transition "Symfony\Component\Workflow\Transition") | $transition | | #### Return Value | | | | --- | --- | | array | | ### getMetadata(string $key, $subject = null) Returns the metadata for a specific subject. This is a proxy method. #### Parameters | | | | | --- | --- | --- | | string | $key | | | | $subject | | symfony GetMetadataTrait GetMetadataTrait ================= trait **GetMetadataTrait** Methods ------- | | | | | --- | --- | --- | | | [getMetadata](#method_getMetadata)(string $key, $subject = null) | | Details ------- ### getMetadata(string $key, $subject = null) #### Parameters | | | | | --- | --- | --- | | string | $key | | | | $subject | | symfony DumperInterface DumperInterface ================ interface **DumperInterface** DumperInterface is the interface implemented by workflow dumper classes. Methods ------- | | | | | --- | --- | --- | | string | [dump](#method_dump)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. | | Details ------- ### string dump([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | A Definition instance | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A Marking instance | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the workflow |
programming_docs