Add configurable subjects to question sets
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Komponent\Component\Testquestions\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Model\AdminModel;
|
||||
|
||||
class SubjectModel extends AdminModel
|
||||
{
|
||||
public function getTable($name = 'Subject', $prefix = 'Administrator', $config = [])
|
||||
{
|
||||
return $this->getMVCFactory()->createTable($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
return $this->loadForm('com_testquestions.subject', 'subject', ['control' => 'jform', 'load_data' => $loadData]);
|
||||
}
|
||||
|
||||
protected function loadFormData()
|
||||
{
|
||||
return Factory::getApplication()->getUserState('com_testquestions.edit.subject.data', []) ?: $this->getItem();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user