99// No direct access.
1010defined ('_JEXEC ' ) or die ();
1111
12- jimport ('joomla.application.component.modeladmin ' );
12+ use Joomla \CMS \MVC \Model \AdminModel ;
13+ use Joomla \CMS \Table \Table ;
14+ use Joomla \CMS \Form \Form ;
15+ use Joomla \CMS \Factory ;
1316
1417/**
1518 * Api model.
1619 *
1720 * @since 1.0
1821 */
19- class ApiModelKey extends JModelAdmin
22+ class ApiModelKey extends AdminModel
2023{
2124 /**
2225 * The prefix to use with controller messages.
@@ -33,14 +36,14 @@ class ApiModelKey extends JModelAdmin
3336 * @param string $prefix The class prefix. Optional.
3437 * @param array $config Configuration array for model. Optional.
3538 *
36- * @return \JTable A \JTable object
39+ * @return \Table A \Table object
3740 *
3841 * @since 3.0
3942 * @throws \Exception
4043 */
4144 public function getTable ($ type = 'Key ' , $ prefix = 'ApiTable ' , $ config = array ())
4245 {
43- return JTable ::getInstance ($ type , $ prefix , $ config );
46+ return Table ::getInstance ($ type , $ prefix , $ config );
4447 }
4548
4649 /**
@@ -49,14 +52,14 @@ public function getTable($type = 'Key', $prefix = 'ApiTable', $config = array())
4952 * @param array $data Data for the form.
5053 * @param boolean $loadData True if the form is to load its own data (default case), false if not.
5154 *
52- * @return \JForm |boolean A \JForm object on success, false on failure
55+ * @return \Form |boolean A \Form object on success, false on failure
5356 *
5457 * @since 1.6
5558 */
5659 public function getForm ($ data = array (), $ loadData = true )
5760 {
5861 // Initialise variables.
59- $ app = JFactory ::getApplication ();
62+ $ app = Factory ::getApplication ();
6063
6164 // Get the form.
6265 $ form = $ this ->loadForm ('com_api.key ' , 'key ' , array ('control ' => 'jform ' , 'load_data ' => $ loadData ));
@@ -79,7 +82,7 @@ public function getForm($data = array(), $loadData = true)
7982 protected function loadFormData ()
8083 {
8184 // Check the session for previously entered form data.
82- $ data = JFactory ::getApplication ()->getUserState ('com_api.edit.key.data ' , array ());
85+ $ data = Factory ::getApplication ()->getUserState ('com_api.edit.key.data ' , array ());
8386
8487 if (empty ($ data ))
8588 {
0 commit comments