芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/administrator.2/components/com_banners/src/Table/ClientTable.php
* @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Banners\Administrator\Table; \defined('_JEXEC') or die; use Joomla\CMS\Language\Text; use Joomla\CMS\Table\Table; use Joomla\CMS\Versioning\VersionableTableInterface; use Joomla\Database\DatabaseDriver; /** * Client table * * @since 1.6 */ class ClientTable extends Table implements VersionableTableInterface { /** * Indicates that columns fully support the NULL value in the database * * @var boolean * @since 4.0.0 */ protected $_supportNullValue = true; /** * Constructor * * @param DatabaseDriver $db Database connector object * * @since 1.5 */ public function __construct(DatabaseDriver $db) { $this->typeAlias = 'com_banners.client'; $this->setColumnAlias('published', 'state'); parent::__construct('#__banner_clients', 'id', $db); } /** * Get the type alias for the history table * * @return string The alias as described above * * @since 4.0.0 */ public function getTypeAlias() { return $this->typeAlias; } /** * Overloaded check function * * @return boolean True if the object is ok * * @see Table::check() * @since 4.0.0 */ public function check() { try { parent::check(); } catch (\Exception $e) { $this->setError($e->getMessage()); return false; } // Check for valid name if (trim($this->name) === '') { $this->setError(Text::_('COM_BANNERS_WARNING_PROVIDE_VALID_NAME')); return false; } // Check for valid contact if (trim($this->contact) === '') { $this->setError(Text::_('COM_BANNERS_PROVIDE_VALID_CONTACT')); return false; } return true; } }