- md5
- 7257a27fd70c9ecd18f367f8269186b0
- sha1
- d104f99bff05148caf47de62bec3d87611d12da1
- sha256
- f9e42cee9226a07a14ac1b1df70b4b3e03a899390ad76a193dde533d5865d31a
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
<?php
/**
* @package Joomla.Administrator
* @subpackage com_finder
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Finder\Administrator\Table;
use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Nested;
use Joomla\Database\DatabaseInterface;
use Joomla\Event\DispatcherInterface;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Map table class for the Finder package.
*
* @since 2.5
*/
class MapTable extends Nested
{
/**
* Constructor
*
* @param DatabaseInterface $db Database connector object
* @param ?DispatcherInterface $dispatcher Event dispatcher for this table
*
* @since 2.5
*/
public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatcher = null)
{
parent::__construct('#__finder_taxonomy', 'id', $db, $dispatcher);
$this->setColumnAlias('published', 'state');
$this->access = (int) Factory::getApplication()->get('access');
}
/**
* Override check function
*
* @return boolean
*
* @see Table::check()
* @since 4.0.0
*/
public function check()
{
try {
parent::check();
} catch (\Exception $e) {
$this->setError($e->getMessage());
return false;
}
// Check for a title.
if (trim($this->title) == '') {
$this->setError(Text::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_CATEGORY'));
return false;
}
$this->alias = ApplicationHelper::stringURLSafe($this->title, $this->language);
if (trim($this->alias) == '') {
$this->alias = md5(serialize($this->getProperties()));
}
return true;
}
}
The same content is in 79 releases, Joomla 5.4.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.