| Server IP : 87.98.154.146 / Your IP : 216.73.216.101 Web Server : Apache System : Linux webm005.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : bsiadvisil ( 110003) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/bsiadvisil/old/administrator/components/com_spsimpleportfolio/tables/ |
Upload File : |
<?php
/**
* @package SP Simple Portfolio
*
* @copyright Copyright (C) 2010 - 2018 JoomShaper. All rights reserved.
* @license GNU General Public License version 2 or later.
*/
defined('_JEXEC') or die();
class SpsimpleportfolioTableItem extends JTable {
public function __construct(&$db) {
parent::__construct('#__spsimpleportfolio_items', 'id', $db);
}
public function store($updateNulls = false) {
$date = JFactory::getDate();
$user = JFactory::getUser();
if (!(int) $this->created) {
$this->created = $date->toSql();
}
if (empty($this->created_by)) {
$this->created_by = $user->get('id');
}
// Verify that the alias is unique
$table = JTable::getInstance('Item', 'SpsimpleportfolioTable');
if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)){
$this->setError(JText::_('COM_SPSIMPLEPORTFOLIO_ERROR_UNIQUE_ALIAS'));
return false;
}
return parent::store($updateNulls);
}
public function check() {
// Check for valid name.
if (trim($this->title) == '') {
throw new UnexpectedValueException(sprintf('The title is empty'));
}
if (empty($this->alias)) {
$this->alias = $this->title;
}
$this->alias = JApplicationHelper::stringURLSafe($this->alias, $this->language);
if (trim(str_replace('-', '', $this->alias)) == '') {
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}
return true;
}
}