ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopTopic Class Reference

Class ilShopTopic. More...

+ Collaboration diagram for ilShopTopic:

Public Member Functions

 __construct ($a_id=0)
 save ()
 delete ()
 saveCustomSorting ()
 setId ($a_id)
 getId ()
 setTitle ($a_title)
 getTitle ()
 setCreateDate ($a_createdate)
 getCreateDate ()
 setChangeDate ($a_changedate)
 getChangeDate ()
 setSorting ($a_sorting)
 getSorting ()
 setCustomSorting ($a_custom_sorting)
 getCustomSorting ()

Static Public Member Functions

static _lookupTitle ($a_id)

Private Member Functions

 read ()

Private Attributes

 $id = 0
 $title = ''
 $sorting = 0
 $createdate = 0
 $changedate = 0
 $custom_sorting = 0
 $db = null

Detailed Description

Class ilShopTopic.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 34 of file class.ilShopTopic.php.

Constructor & Destructor Documentation

ilShopTopic::__construct (   $a_id = 0)

Definition at line 45 of file class.ilShopTopic.php.

References read().

{
global $ilDB;
$this->db = $ilDB;
if($a_id)
{
$this->id = $a_id;
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

static ilShopTopic::_lookupTitle (   $a_id)
static

Definition at line 149 of file class.ilShopTopic.php.

References $result, and DB_FETCHMODE_OBJECT.

Referenced by ilShopTopicsGUI\showTopicsList().

{
global $ilDB;
$query = $ilDB->prepare("SELECT pt_topic_title FROM payment_topics WHERE pt_topic_pk = ?",
array('integer'));
$result = $ilDB->execute($query, array($a_id));
while($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->pt_topic_title;
}
return false;
}

+ Here is the caller graph for this function:

ilShopTopic::delete ( )

Definition at line 122 of file class.ilShopTopic.php.

References $result.

{
if($this->id)
{
$query = "DELETE FROM payment_topics
WHERE 1
AND pt_topic_pk = ".$this->db->quote($this->id)." ";
$this->db->query($query);
$query = "DELETE FROM payment_topics_user_sorting
WHERE 1
AND ptus_pt_topic_fk = ".$this->db->quote($this->id)." ";
$this->db->query($query);
$query = "UPDATE payment_objects
SET pt_topic_fk = ?
WHERE 1
AND pt_topic_fk = ? ";
$statement = $this->db->prepareManip($query, array('integer', 'integer'));
$result = $this->db->execute($statement, array(0, $this->id));
return true;
}
return false;
}
ilShopTopic::getChangeDate ( )

Definition at line 211 of file class.ilShopTopic.php.

References $changedate.

{
}
ilShopTopic::getCreateDate ( )

Definition at line 203 of file class.ilShopTopic.php.

References $createdate.

{
}
ilShopTopic::getCustomSorting ( )

Definition at line 227 of file class.ilShopTopic.php.

References $custom_sorting.

{
}
ilShopTopic::getId ( )

Definition at line 187 of file class.ilShopTopic.php.

References $id.

{
return $this->id;
}
ilShopTopic::getSorting ( )

Definition at line 219 of file class.ilShopTopic.php.

References $sorting.

{
}
ilShopTopic::getTitle ( )

Definition at line 195 of file class.ilShopTopic.php.

References $title.

{
return $this->title;
}
ilShopTopic::read ( )
private

Definition at line 59 of file class.ilShopTopic.php.

References $id, $result, and DB_FETCHMODE_OBJECT.

Referenced by __construct().

{
global $ilUser;
if($this->id)
{
$query = $this->db->prepare("SELECT * FROM payment_topics
LEFT JOIN payment_topics_user_sorting ON ptus_pt_topic_fk = pt_topic_pk
AND ptus_usr_id = ?
WHERE pt_topic_pk = ?",
array('integer', 'integer'));
$result = $this->db->execute($query, array($ilUser->getId(), $this->id));
while($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->title = $row->pt_topic_title;
$this->sorting = $row->pt_topic_sort;
$this->createdate = $row->pt_topic_created;
$this->changedate = $row->pt_topic_changed;
$this->custom_sorting = $row->ptus_sorting;
return true;
}
}
return false;
}

+ Here is the caller graph for this function:

ilShopTopic::save ( )

Definition at line 85 of file class.ilShopTopic.php.

{
if($this->id)
{
$this->changedate = time();
$query = "UPDATE payment_topics
SET
pt_topic_title = ".$this->db->quote($this->title).",
pt_topic_sort = ".$this->db->quote($this->sorting).",
pt_topic_changed = ".$this->db->quote($this->changedate)."
WHERE 1
AND pt_topic_pk = ".$this->db->quote($this->id)." ";
$this->db->query($query);
return true;
}
else
{
$this->createdate = time();
$query = "INSERT INTO payment_topics
SET
pt_topic_title = ".$this->db->quote($this->title).",
pt_topic_sort = ".$this->db->quote($this->sorting).",
pt_topic_created = ".$this->db->quote($this->createdate)." ";
$this->db->query($query);
$this->id = $this->db->getLastInsertId();
if($this->id) return true;
}
return false;
}
ilShopTopic::saveCustomSorting ( )

Definition at line 164 of file class.ilShopTopic.php.

{
global $ilUser;
if($this->id)
{
$query = "REPLACE INTO payment_topics_user_sorting
SET
ptus_pt_topic_fk = ".$this->db->quote($this->id).",
ptus_usr_id = ".$this->db->quote($ilUser->getId()).",
ptus_sorting = ".$this->db->quote($this->custom_sorting)." ";
$this->db->query($query);
return true;
}
return false;
}
ilShopTopic::setChangeDate (   $a_changedate)

Definition at line 207 of file class.ilShopTopic.php.

{
$this->changedate = $a_changedate;
}
ilShopTopic::setCreateDate (   $a_createdate)

Definition at line 199 of file class.ilShopTopic.php.

{
$this->createdate = $a_createdate;
}
ilShopTopic::setCustomSorting (   $a_custom_sorting)

Definition at line 223 of file class.ilShopTopic.php.

{
$this->custom_sorting = $a_custom_sorting;
}
ilShopTopic::setId (   $a_id)

Definition at line 183 of file class.ilShopTopic.php.

{
$this->id = $a_id;
}
ilShopTopic::setSorting (   $a_sorting)

Definition at line 215 of file class.ilShopTopic.php.

{
$this->sorting = $a_sorting;
}
ilShopTopic::setTitle (   $a_title)

Definition at line 191 of file class.ilShopTopic.php.

{
$this->title = $a_title;
}

Field Documentation

ilShopTopic::$changedate = 0
private

Definition at line 40 of file class.ilShopTopic.php.

Referenced by getChangeDate().

ilShopTopic::$createdate = 0
private

Definition at line 39 of file class.ilShopTopic.php.

Referenced by getCreateDate().

ilShopTopic::$custom_sorting = 0
private

Definition at line 41 of file class.ilShopTopic.php.

Referenced by getCustomSorting().

ilShopTopic::$db = null
private

Definition at line 43 of file class.ilShopTopic.php.

ilShopTopic::$id = 0
private

Definition at line 36 of file class.ilShopTopic.php.

Referenced by getId(), and read().

ilShopTopic::$sorting = 0
private

Definition at line 38 of file class.ilShopTopic.php.

Referenced by getSorting().

ilShopTopic::$title = ''
private

Definition at line 37 of file class.ilShopTopic.php.

Referenced by getTitle().


The documentation for this class was generated from the following file: