Source for file banner.php
Documentation is available at banner.php
* @package Joomla.Administrator
* @subpackage com_banners
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @package Joomla.Administrator
* @subpackage com_banners
$this->created =
$date->toSql();
$query =
'UPDATE #__banners'
.
' SET clicks = (clicks + 1)'
.
' WHERE id = ' . (int)
$this->id;
$this->_db->setQuery($query);
* Overloaded check function
// Check the publish down date is not earlier than publish up.
if ($this->publish_down >
$this->_db->getNullDate() &&
$this->publish_down <
$this->publish_up)
// Set ordering to 0 if state is archived or trashed
} elseif (empty($this->ordering))
// Set ordering to last if ordering was 0
$this->ordering =
self::getNextOrder($this->_db->quoteName('catid').
'=' .
$this->_db->quote($this->catid).
' AND state>=0');
* Overloaded bind function
* @param array $hash named array
* @return null|string null is operation was satisfactory, otherwise returns an error
public function bind($array, $ignore =
array())
if (isset
($array['params']) &&
is_array($array['params']))
$registry->loadArray($array['params']);
if ((int)
$registry->get('width', 0) <
0){
if ((int)
$registry->get('height', 0) <
0){
// Converts the width and height to an absolute numeric value:
$width =
abs((int)
$registry->get('width', 0));
$height =
abs((int)
$registry->get('height', 0));
// Sets the width and height to an empty string if = 0
$registry->set('width', ($width ?
$width :
''));
$registry->set('height', ($height ?
$height :
''));
$array['params'] = (string)
$registry;
if (isset
($array['imptotal']))
$array['imptotal'] =
abs((int)
$array['imptotal']);
return parent::bind($array, $ignore);
* @param boolean $updateNulls True to update fields even if they are null.
public function store($updateNulls =
false)
$purchase_type =
$this->purchase_type;
if ($purchase_type <
0 &&
$this->cid)
$client->load($this->cid);
$purchase_type =
$client->purchase_type;
$purchase_type =
$params->get('purchase_type');
$this->reset =
$this->_db->getNullDate();
$this->reset =
$this->_db->quote($date->toSql());
$this->reset =
$this->_db->quote($date->toSql());
$this->reset =
$this->_db->quote($date->toSql());
$this->reset =
$this->_db->quote($date->toSql());
parent::store($updateNulls);
if (!$oldrow->load($this->id) &&
$oldrow->getError())
// Verify that the alias is unique
if ($table->load(array('alias' =>
$this->alias, 'catid' =>
$this->catid)) &&
($table->id !=
$this->id ||
$this->id ==
0))
parent::store($updateNulls);
if ($oldrow->state >=
0 &&
($this->state <
0 ||
$oldrow->catid !=
$this->catid))
$this->reorder($this->_db->quoteName('catid').
'=' .
$this->_db->quote($oldrow->catid).
' AND state>=0');
* Method to set the publishing state for a row or list of rows in the database
* table. The method respects checked out rows by other users and will attempt
* to checkin rows that it can after adjustments are made.
* @param mixed An optional array of primary key values to update. If not
* set the instance property value is used.
* @param integer The publishing state. eg. [0 = unpublished, 1 = published, 2=archived, -2=trashed]
* @param integer The user id of the user performing the operation.
* @return boolean True on success.
public function publish($pks =
null, $state =
1, $userId =
0)
// If there are no primary keys set check to see if the instance key is set.
// Nothing to set publishing state on, return false.
// Get an instance of the table
if ($table->checked_out ==
0 ||
$table->checked_out ==
$userId)
$table->checked_out_time =
$this->_db->getNullDate();
* Method to set the sticky state for a row or list of rows in the database
* table. The method respects checked out rows by other users and will attempt
* to checkin rows that it can after adjustments are made.
* @param mixed An optional array of primary key values to update. If not
* set the instance property value is used.
* @param integer The sticky state. eg. [0 = unsticked, 1 = sticked]
* @param integer The user id of the user performing the operation.
* @return boolean True on success.
public function stick($pks =
null, $state =
1, $userId =
0)
// If there are no primary keys set check to see if the instance key is set.
// Nothing to set publishing state on, return false.
// Get an instance of the table
if ($table->checked_out ==
0 ||
$table->checked_out ==
$userId)
$table->checked_out_time =
$this->_db->getNullDate();
Documentation generated on Tue, 19 Nov 2013 14:54:15 +0100 by phpDocumentor 1.4.3