Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Installation: Move getOptions() in models to base class #43356

Merged
merged 4 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions installation/src/Model/BaseInstallationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Joomla\CMS\Installation\Model;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;

Expand Down Expand Up @@ -40,4 +41,16 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null)

parent::__construct($config, $factory);
}

/**
* Get the current setup options from the session.
*
* @return array An array of options from the session.
*
* @since 3.1
*/
public function getOptions()
{
return Factory::getSession()->get('setup.options', []);
}
}
14 changes: 0 additions & 14 deletions installation/src/Model/ChecksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,6 @@ public function getPhpSettings()
return $settings;
}

/**
* Get the current setup options from the session.
*
* @return array An array of options from the session.
*
* @since 3.1
*/
public function getOptions()
{
if (!empty(Factory::getSession()->get('setup.options', []))) {
return Factory::getSession()->get('setup.options', []);
}
}

/**
* Method to get the form.
*
Expand Down
12 changes: 0 additions & 12 deletions installation/src/Model/DatabaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@
*/
class DatabaseModel extends BaseInstallationModel
{
/**
* Get the current setup options from the session.
*
* @return array An array of options from the session.
*
* @since 4.0.0
*/
public function getOptions()
{
return Factory::getSession()->get('setup.options', []);
}

/**
* Method to initialise the database.
*
Expand Down
12 changes: 0 additions & 12 deletions installation/src/Model/LanguagesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,18 +490,6 @@ public function setDefault($language, $clientName = 'administrator')
return true;
}

/**
* Get the current setup options from the session.
*
* @return array
*
* @since 3.1
*/
public function getOptions()
{
return Factory::getSession()->get('setup.options', []);
}

/**
* Get the model form.
*
Expand Down
14 changes: 0 additions & 14 deletions installation/src/Model/SetupModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@
*/
class SetupModel extends BaseInstallationModel
{
/**
* Get the current setup options from the session.
*
* @return array An array of options from the session.
*
* @since 3.1
*/
public function getOptions()
{
if (!empty(Factory::getSession()->get('setup.options', []))) {
return Factory::getSession()->get('setup.options', []);
}
}

/**
* Store the current setup options in the session.
*
Expand Down