ChangeSet
class ChangeSet
Contains a set of JSchemaChange objects for a particular instance of Joomla.
Each of these objects contains a DDL query that should have been run against the database when this database was created or updated. This enables the Installation Manager to check that the current database schema is up to date.
Properties
protected ChangeItem[]
Since: 2.5
|
$changeItems | Array of ChangeItem objects |
|
protected DatabaseDriver
Since: 2.5
|
$db | DatabaseDriver object |
|
protected string
Since: 2.5
|
$folder | Folder where SQL update files will be found |
|
static protected ChangeSet
Since: 3.5.1
|
$instance | The singleton instance of this object |
Methods
Constructor: builds array of $changeItems by processing the .sql files in a folder.
Returns a reference to the ChangeSet object, only creating it if it doesn't already exist.
Checks the database and returns an array of any errors found.
Runs the update query to apply the change to the database
Returns an array of results for this set
Gets the current database schema, based on the highest version number.
Details
__construct(DatabaseDriver $db, string $folder = null)
Constructor: builds array of $changeItems by processing the .sql files in a folder.
The folder for the Joomla core updates is administrator/components/com_admin/sql/updates/<database>
.
static ChangeSet
getInstance(DatabaseDriver $db, string $folder = null)
Returns a reference to the ChangeSet object, only creating it if it doesn't already exist.