- md5
- 3bca3f01051e5f5cd46f979aadd2da14
- sha1
- d6ecdb5dc017fda9a9c6ad938f9876c5e387f6b9
- sha256
- 3c484e320de2fc7908426a400186886c9f729cdb89e735876439fcf06d664970
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
<?php
/**
* @package Joomla.Administrator
* @subpackage com_privacy
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Privacy\Administrator\Table;
use Joomla\CMS\Factory;
use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseInterface;
use Joomla\Event\DispatcherInterface;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Table interface class for the #__privacy_requests table
*
* @property integer $id Item ID (primary key)
* @property string $email The email address of the individual requesting the data
* @property string $requested_at The time the request was created at
* @property integer $status The status of the information request
* @property string $request_type The type of information request
* @property string $confirm_token Hashed token for confirming the information request
* @property string $confirm_token_created_at The time the confirmation token was generated
*
* @since 3.9.0
*/
class RequestTable extends Table
{
/**
* Indicates that columns fully support the NULL value in the database
*
* @var boolean
* @since 4.0.0
*/
protected $_supportNullValue = true;
/**
* The class constructor.
*
* @param DatabaseInterface $db Database connector object
* @param ?DispatcherInterface $dispatcher Event dispatcher for this table
*
* @since 3.9.0
*/
public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatcher = null)
{
parent::__construct('#__privacy_requests', 'id', $db, $dispatcher);
}
/**
* Method to store a row in the database from the Table instance properties.
*
* @param boolean $updateNulls True to update fields even if they are null.
*
* @return boolean True on success.
*
* @since 3.9.0
*/
public function store($updateNulls = true)
{
$date = Factory::getDate();
// Set default values for new records
if (!$this->id) {
if (!$this->status) {
$this->status = '0';
}
if (!$this->requested_at) {
$this->requested_at = $date->toSql();
}
if (!$this->confirm_token_created_at) {
$this->confirm_token_created_at = null;
}
}
return parent::store($updateNulls);
}
}
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.