- Symphony 2.6.11
-
› assets
14 -
› boot
14 -
› core
23 -
› cryptography
4 -
› data-sources
6 -
› email-gateways
3 -
› events
3 -
› global
59 -
› interface
9 -
› toolkit
59 - Delegates92
- Deprecated27
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
public abstract class Extension
class.extension.php #12The abstract Extension class contains common methods that most extensions require to get started in the Symphony environment. They include the installation updating and uninstallation, as well as a delegate subscription hook so an extension can perform custom logic at various times during Symphony execution.
Constants
static integer EXTENSION_DISABLED = 11
Status when an extension is disabled
static integer EXTENSION_ENABLED = 10
Status when an extension is installed and enabled
static integer EXTENSION_NOT_COMPATIBLE = 14
Status when the extension is not compatible with the current version of Symphony
static integer EXTENSION_NOT_INSTALLED = 12
Status when an extension is in the file system, but has not been installed.
static integer EXTENSION_REQUIRES_UPDATE = 13
Status when an extension version in the file system is different to the version stored in the database for the extension
static integer $NAV_CHILD
Determines that a new item is to be added to an existing navigation group in the Symphony backend
static integer NAV_GROUP = 1
Determines that a new navigation group is to created in the Symphony backend
Methods
void __construct()
Default constructor for an Extension, at this time it does nothing
boolean disable()
This method runs when a user selects Disable from the Symphony backend.
See Also
boolean enable()
Extensions can be disabled in the backend which stops them from functioning by removing their delegate subscription information but keeps their settings intact (usually stored in the database). This method runs when a user selects Enable from the Symphony backend.
See Also
array getSubscribedDelegates()
Extensions use delegates to perform logic at certain times throughout Symphony. This function allows an extension to subscribe to a delegate which will notify the extension when it is used so that it can perform it's custom logic. This method returns an array with the delegate name, delegate namespace, and then name of the method that should be called. The method that is called is passed an associative array containing the current context which is the current page object and any other variables that is passed via this delegate. eg.
array(
array(
'page' => '/current/path/',
'delegate' => 'DelegateName',
'callback' => 'functionToCall'
)
)
boolean install()
Any logic that assists this extension in being installed such as table creation, checking for dependancies etc.
Returns
True if the install completely successfully, false otherwise
See Also
static array providerOf(
$type)
Used by Symphony to ask this extension if it's able to provide any new
objects as defined by $type
Parameters
static boolean registerProviders()
This function should be implemented by the extension if there are objects to announce to Symphony.
boolean uninstall()
Any logic that should be run when an extension is to be uninstalled such as the removal of database tables.
See Also
boolean update(
$previousVersion)
Logic that should take place when an extension is to be been updated when a user runs the 'Enable' action from the backend. The currently installed version of this extension is provided so that it can be compared to the current version of the extension in the file system. This is commonly done using PHP's version_compare function. Common logic done by this method is to update differences between extension tables.