\JSchemaChangeset
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.
Synopsis
class JSchemaChangeset
{
- // members
- protected $changeItems;
- protected JDatabaseDriver $db;
- protected $folder;
- // methods
- public void __construct()
- public static JSchemaChangeset getInstance()
- public array check()
- public void fix()
- public array getStatus()
- public string getSchema()
- private array getUpdateFiles()
- private array getUpdateQueries()
- private string trimQuery()
Members
protected
- $changeItems
—
array
Array of JSchemaChangeitem objects - $db
—
JDatabaseDriver
JDatabaseDriver object - $folder
—
string
Folder where SQL update files will be found
Methods
private
- getUpdateFiles() — Get list of SQL update files for this database
- getUpdateQueries() — Get array of SQL queries
- trimQuery() — Trim comment and blank lines out of a query string
public
- __construct() — Constructor: builds array of $changeItems by processing the .sql files in a folder.
- check() — Checks the database and returns an array of any errors found.
- fix() — Runs the update query to apply the change to the database
- getInstance() — Returns a reference to the JSchemaChangeset object, only creating it if it doesn't already exist.
- getSchema() — Gets the current database schema, based on the highest version number.
- getStatus() — Returns an array of results for this set