• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Block/classes/class.ilExternalFeedBlock.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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 ?>

Generated on Fri Dec 13 2013 17:56:55 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1