Файловый менеджер - Редактировать - /var/www/html/administrator/components/com_jchat/Table/LamessagesTable.php
Ðазад
<?php namespace JExtstore\Component\JChat\Administrator\Table; /** * * @package JCHAT::MESSAGES::administrator::components::com_jchat * @subpackage tables * @author Joomla! Extensions Store * @Copyright (C) 2015 - Joomla! Extensions Store * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html */ defined ( '_JEXEC' ) or die ( 'Restricted access' ); use Joomla\CMS\Language\Text; use Joomla\CMS\Table\Table; use Joomla\CMS\Date\Date; use Joomla\Database\DatabaseDriver; /** * Messages table * * @package JCHAT::LAMESSAGES::administrator::components::com_jchat * @subpackage tables * @since 1.0 */ class LamessagesTable extends Table { /** * * @var string */ private $_username_logged; /** * * @var int Primary key */ public $id = 0; /** * * @var string */ public $name = ''; /** * * @var string */ public $email = ''; /** * * @var string */ public $phonenumber = ''; /** * * @var string */ public $message = ''; /** * * @var string */ public $sentdate = ''; /** * * @var int */ public $userid = null; /** * * @var int */ public $worked = null; /** * * @var string */ public $responses = array (); /** * * @var int */ public $checked_out = null; /** * * @var datetime */ public $checked_out_time = null; /** * * @var int */ public $closed_ticket = 0; /** * Loads a row from the database and binds the fields to the object properties * * @override * * @access public * @param * mixed Optional primary key. If not specifed, the value of current key is used * @return boolean if successful */ public function load($keys = null, $reset = true) { // If not $idEntity set return empty object if($keys) { if(!parent::load ( $keys, $reset )) { return false; } } // Unserialize campo risposte/data if ($this->responses) { $this->responses = unserialize ( $this->responses ); } else { // Init qui $this->responses = array (); } error_reporting(E_ALL); // Foreign key management $usersTable = new \Joomla\CMS\Table\User($this->_db); // Foreign key mapping #__users if ($usersTable->load ( $this->userid )) { $this->_username_logged = $usersTable->name; } return true; } /** * Check Table override * @override * * @see Table::check() */ public function check() { // Name required if (! $this->name) { $this->setError ( Text::_ ( 'COM_JCHAT_VALIDATION_ERROR' ) ); return false; } // Email required and in valid format if (!$this->email || !filter_var(trim($this->email), FILTER_VALIDATE_EMAIL)) { $this->setError ( Text::sprintf( 'COM_JCHAT_VALIDATION_ERROR_SUBJECT', $this->email )); return false; } // Email required and in valid format if (! $this->sentdate) { $this->setError ( Text::sprintf( 'COM_JCHAT_VALIDATION_ERROR_SUBJECT', $this->sentdate )); return false; } return true; } /** * Binds a named array/hash to this object * * @override * * @access public * @param * mixed Optional primary key. If not specifed, the value of current key is used * @param boolean $storeResponse * @return boolean if successful */ function bind($from, $ignore = array(), $saveTask = false, $sessionTask = false) { // Parent std load parent::bind ( $from, $ignore ); // MySql strict mode primary key auto increment compliance if(!$this->id) { $this->id = 0; } // Unserialize campo risposte/data if (is_array ( $this->responses ) && $saveTask === 2) { $this->responses [] = array ( Date::getInstance()->toSql(), $from ['response'], $from ['ticket_sender'] ); $this->responses = serialize ( $this->responses ); } return true; } /** * * @param * database A database connector object */ function __construct(DatabaseDriver $db) { parent::__construct ( '#__jchat_lamessages', 'id', $db ); // Support null values for datetime field $this->_supportNullValue = true; } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка