-
-
Notifications
You must be signed in to change notification settings - Fork 210
Dev notes #1
Symphony 2.3 development has been rocketing ahead since the last post, and there has been some important breaking changes that extension developers need to be aware of. These changes aim to remove some of the legacy code that has been in Symphony for some time and improve performance and increase their usefulness.
Symphony has a number of Managers that are used to retrieve information about various objects. In Symphony 2.3, I'm happy to say that all Managers are now static, and no longer need to be initialised.
Where you previously might of had:
$entryManager = new EntryManager(Symphony::Engine());
$entries = $entryManager->fetch(1);
This can now be done as:
$entries = EntryManager::fetch(1);
The same goes for all functions of the DatasourceManager
, EntryManager
, EmailGatewayManager
, EventManager
, FieldManager
, SectionManager
and TextFormatterManager
.
Some developers will be familiar with $this->_Parent
, and hopefully more are familiar with Symphony::Engine()
because in Symphony 2.3, $this->_Parent
no longer exists. This is only one of a number of things have been cleaned up for this release. Most of the removed properties or functions were previously deprecated in Symphony 2.2, but there are a couple that have been overlooked, so he's a complete list to prevent any confusion:
-
Administration
andFrontend
classes no longer have$this->Database
,$this->Configuration
or$this->ExtensionManager
properties, these can all be accessed viaSymphony::Database()
,Symphony::Configuration()
orSymphony::ExtensionManager()
. -
Symphony
's$Configuration
,$Database
,$ExtensionManager
,$Log
and$Profiler
properties are now all private, two new accessors have been created,Symphony::Log()
andSymphony::Profiler()
to allow access to the latter two. - The
AdministrationPage
andFrontendPage
classes no longer require the$parent
be passed and consequently no longer have the$this->_Parent
property. Additionally theFrontendPage
class no longer has$this->ExtensionManager
,$this->DatasourceManager
or$this->EventManager
properties - The
Datasource
andEvent
classes no longer have$this->_Parent
. At the moment the first parameter passed when creating a newDatasource
orEvent
is ignored. - The
EntryManager
class no longer have$this->_Parent
,$this->FieldManager
,$this->TextFormatterManager
or$this->SectionManager
properties. - The
Entry
class no longer have$this->_engine
or$this->_Parent
, useSymphony::Engine()
instead, (it also no longer requires a parameter to initialise). - The
Field
class no longer have$this->_Parent
,$this->_engine
or$this->Database
properties. - The
Section
class no longer have$this->_Parent
, or$this->_fieldManager
properties. - The
SectionManager
andTextFormatter
classes no longer have$this->_Parent
, nor require a parameter to initialise. - The
$context
passed to any delegate callback no longer includes aparent
key
- The
AdministrationPage
class no longer has thewrapFormElementWithError
function, useWidget::wrapFormElementWithError
instead. - The
Author
class no longer contains theloadAuthorFromUsername
,loadAuthor
andverifyToken
functions. -
General
class no longer containsfilemtimeSort
,fileSort
orfileSortR
functions. These were unused by Symphony and were quite ironically quite specific. - The
fieldDate
class no longer contains thebuildSimpleFilterSQL
function.
This is just the first of many dev notes that we're hoping to release as Symphony 2.3 development progresses, enjoy!