[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_newsfeeds 6 * 7 * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Component\Newsfeeds\Administrator\Field; 12 13 use Joomla\CMS\Factory; 14 use Joomla\CMS\Form\Field\ListField; 15 16 // phpcs:disable PSR1.Files.SideEffects 17 \defined('_JEXEC') or die; 18 // phpcs:enable PSR1.Files.SideEffects 19 20 /** 21 * News Feed List field. 22 * 23 * @since 1.6 24 */ 25 class NewsfeedsField extends ListField 26 { 27 /** 28 * The form field type. 29 * 30 * @var string 31 * @since 1.6 32 */ 33 protected $type = 'Newsfeeds'; 34 35 /** 36 * Method to get the field options. 37 * 38 * @return array The field option objects. 39 * 40 * @since 1.6 41 */ 42 protected function getOptions() 43 { 44 $options = array(); 45 46 $db = $this->getDatabase(); 47 $query = $db->getQuery(true) 48 ->select( 49 [ 50 $db->quoteName('id', 'value'), 51 $db->quoteName('name', 'text'), 52 ] 53 ) 54 ->from($db->quoteName('#__newsfeeds', 'a')) 55 ->order($db->quoteName('a.name')); 56 57 // Get the options. 58 $db->setQuery($query); 59 60 try { 61 $options = $db->loadObjectList(); 62 } catch (\RuntimeException $e) { 63 Factory::getApplication()->enqueueMessage($e->getMessage(), 'error'); 64 } 65 66 // Merge any additional options in the XML definition. 67 $options = array_merge(parent::getOptions(), $options); 68 69 return $options; 70 } 71 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |