- md5
- d71385ed4a6d997eb57613e6c03e05f9
- sha1
- bf64ca3522056b44edbc15f082bdc4ce491f62bd
- sha256
- e222906b278623fc29ebdadef1e00a2903ddb7435d7cf5bf33515c775908769c
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
<?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @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;
}
}
The same content is in 51 releases, Joomla 4.0.0-beta6 to 4.2.0-beta2. See them all, or every version of this file.