Exemplo n.º 1
0
 /**
  * Get a list of aliases from their ids,
  * passed as params
  *
  * @param array of integer $ids the list of aliases id to fetch
  * @return array of objects as read from db
  */
 public function getByIds($ids = array())
 {
     $aliases = array();
     if (empty($ids)) {
         return $aliases;
     }
     // select element where id is in list supplied
     try {
         $aliases = Sh404sefHelperDb::selectObjectList($this->_getTableName(), array('*'), $this->_db->nameQuote('id') . ' in (?)', Sh404sefHelperDb::arrayToQuotedList($ids));
     } catch (Sh404sefExceptionDefault $e) {
     }
     // return result
     return $aliases;
 }
Exemplo n.º 2
0
 /**
  * Load components
  *
  * @access  public
  * @param array exclude an array of component to exclude from result
  * @return  array
  */
 public static function getComponentsList($exclude = array())
 {
     static $components = null;
     if (is_null($components)) {
         $db =& JFactory::getDBO();
         // exclude some and ourselves
         $exclude = array_merge(array('com_sh404sef', 'com_joomfish', 'com_falang', 'com_joomsef', 'com_acesef', 'com_admin', 'com_cache', 'com_categories', 'com_checkin', 'com_cpanel', 'com_installer', 'com_languages', 'com_media', 'com_menus', 'com_messages', 'com_modules', 'com_plugins', 'com_templates', 'com_config', 'com_redirect', 'com_users'), $exclude);
         $where = $db->nameQuote('type') . ' = ? and ' . $db->nameQuote('enabled') . ' = ? and ' . $db->nameQuote('element') . ' <> ? ' . ' and ' . $db->nameQuote('element') . ' not in (' . Sh404sefHelperDb::arrayToQuotedList($exclude) . ')';
         $whereData = array('component', 1, '');
         try {
             $components = Sh404sefHelperDb::selectObjectList('#__extensions', array('*'), $where, $whereData, $orderBy = array('name'), $offset = 0, $lines = 0, $key = 'element');
         } catch (Sh404sefExceptionDefault $e) {
             JError::raiseWarning('SOME_ERROR_CODE', "Error loading Components: " . $e->getMessage());
             return false;
         }
     }
     return $components;
 }