| Server IP : 54.36.91.62 / Your IP : 216.73.217.111 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/components/com_mymaplocations/models/ |
Upload File : |
<?php
/**
* @version 4.6.2
* @package com_mymaplocations
* @copyright JoomUnited (C) 2011. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* ****@author joomunited - contact@joomunited.com
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
// Base this model on the backend version.
require_once JPATH_ADMINISTRATOR . '/components/com_mymaplocations/models/location.php';
/**
* MyMaplocations model.
*/
class MyMaplocationsModelForm extends MyMaplocationsModellocation
{
/**
* Model typeAlias string. Used for version history.
*
* @var string
*/
public $typeAlias = 'com_mymaplocations.location';
var $_item = null;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState()
{
$app = JFactory::getApplication();
$id = $app->input->getInt('id');
$this->setState('location.id', $id);
// Load the parameters.
$params = $app->getParams();
$this->setState('params', $params);
$this->setState('layout', $app->input->getString('layout'));
}
/**
* Method to get article data.
*
* @param integer $itemId The id of the article.
*
* @return mixed Content item data object on success, false on failure.
*/
public function getItem($itemId = null)
{
if ($this->_item === null) {
$this->_item = false;
if (empty($id)) {
$id = $this->getState('location.id');
}
// Get a level row instance.
$table = $this->getTable();
// Attempt to load the row.
if ($table->load($id)) {
// Check published state.
if ($published = $this->getState('filter.published')) {
if ($table->state != $published) {
return $this->_item;
}
}
// Convert the JTable to a clean JObject.
$properties = $table->getProperties(1);
$this->_item = ArrayHelper::toObject($properties, 'JObject');
} elseif ($error = $table->getError()) {
$this->setError($error);
}
}
if (!empty($this->_item->id))
{
$this->_item->tags = new JHelperTags;
$this->_item->tags->getTagIds($this->_item->id, 'com_mymaplocations.location');
}
return $this->_item;
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
* @since 1.6
*/
protected function loadFormData() {
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_mymaplocations.edit.location.data', array());
$app = JFactory::getApplication();
if (empty($data)) {
$data = $this->getItem();
if ($this->getState('location.id') == 0) {
$filterCatId = null;
$data->set('catid', $app->getInput()->getInt('catid', $filterCatId));
}
}
return $data;
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 3.2
*/
public function save($data)
{
return parent::save($data);
}
}