Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once("./Services/Block/classes/class.ilCustomBlock.php");
00025
00032 class ilExternalFeedBlock extends ilCustomBlock
00033 {
00034
00035 protected $feed_url;
00036
00042 public function __construct($a_id = 0)
00043 {
00044 if ($a_id > 0)
00045 {
00046 $this->setId($a_id);
00047 $this->read();
00048 }
00049
00050 }
00051
00057 public function setFeedUrl($a_feed_url)
00058 {
00059 $this->feed_url = $a_feed_url;
00060 }
00061
00067 public function getFeedUrl()
00068 {
00069 return $this->feed_url;
00070 }
00071
00076 public function create()
00077 {
00078 global $ilDB, $ilLog;
00079
00080 parent::create();
00081
00082 $query = "INSERT INTO il_external_feed_block (".
00083 " id".
00084 ", feed_url".
00085 " ) VALUES (".
00086 $ilDB->quote($this->getId())
00087 .",".$ilDB->quote($this->getFeedUrl()).")";
00088 $ilDB->query($query);
00089
00090 }
00091
00096 public function read()
00097 {
00098 global $ilDB;
00099
00100 parent::read();
00101
00102 $query = "SELECT * FROM il_external_feed_block WHERE id = ".
00103 $ilDB->quote($this->getId());
00104 $set = $ilDB->query($query);
00105 $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
00106
00107 $this->setFeedUrl($rec["feed_url"]);
00108
00109 }
00110
00115 public function update()
00116 {
00117 global $ilDB;
00118
00119 parent::update();
00120
00121 $query = "UPDATE il_external_feed_block SET ".
00122 " feed_url = ".$ilDB->quote($this->getFeedUrl()).
00123 " WHERE id = ".$ilDB->quote($this->getId());
00124
00125 $ilDB->query($query);
00126
00127 }
00128
00133 public function delete()
00134 {
00135 global $ilDB;
00136
00137 parent::delete();
00138
00139 $query = "DELETE FROM il_external_feed_block".
00140 " WHERE id = ".$ilDB->quote($this->getId());
00141
00142 $ilDB->query($query);
00143
00144 }
00145
00146
00147 }
00148 ?>