Back to ChangeSet class

Method getInstance

public static \Joomla\CMS\Schema\ChangeSet
getInstance
(mixed $db, mixed $folder = null)
Returns a reference to the ChangeSet object, only creating it if it doesn't already exist.
Parameters
  • \Joomla\Database\DatabaseDriver $db The current database object
  • string $folder The full path to the folder containing the update queries
Returns
  • \Joomla\CMS\Schema\ChangeSet
Since
  • 2.5
Class: ChangeSet
Project: Joomla

Method getInstance - Source code

/**
 * Returns a reference to the ChangeSet object, only creating it if it doesn't already exist.
 *
 * @param   DatabaseDriver  $db      The current database object
 * @param   string          $folder  The full path to the folder containing the update queries
 *
 * @return  ChangeSet
 *
 * @since   2.5
 */
public static function getInstance($db, $folder = null)
{
    if (!\is_object(static::$instance)) {
        static::$instance = new static($db, $folder);
    }
    return static::$instance;
}