ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilExternalFeedBlock Class Reference

Custom block for external feeds. More...

+ Inheritance diagram for ilExternalFeedBlock:
+ Collaboration diagram for ilExternalFeedBlock:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 setFeedUrl ($a_feed_url)
 Set FeedUrl. More...
 
 getFeedUrl ()
 Get FeedUrl. More...
 
 create ()
 Create new item. More...
 
 read ()
 Read item from database. More...
 
 update ()
 Update item in database. More...
 
 delete ()
 Delete item from database. More...
 
- Public Member Functions inherited from ilCustomBlock
 __construct ($a_id=0)
 Constructor. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setContextObjId ($a_context_obj_id)
 Set ContextObjId. More...
 
 getContextObjId ()
 Get ContextObjId. More...
 
 setContextObjType ($a_context_obj_type)
 Set ContextObjType. More...
 
 getContextObjType ()
 Get ContextObjType. More...
 
 setContextSubObjId ($a_context_sub_obj_id)
 Set ContextSubObjId. More...
 
 getContextSubObjId ()
 Get ContextSubObjId. More...
 
 setContextSubObjType ($a_context_sub_obj_type)
 Set ContextSubObjType. More...
 
 getContextSubObjType ()
 Get ContextSubObjType. More...
 
 setType ($a_type)
 Set Type. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 create ()
 Create new item. More...
 
 read ()
 Read item from database. More...
 
 update ()
 Update item in database. More...
 
 delete ()
 Delete item from database. More...
 
 querygetBlocksForContext ()
 Query getBlocksForContext. More...
 
 queryBlocksForContext ($a_include_sub_obj=true)
 Query BlocksForContext. More...
 
 queryTitleForId ()
 Query TitleForId. More...
 
 queryCntBlockForContext ()
 Query CntBlockForContext. More...
 

Protected Attributes

 $feed_url
 
- Protected Attributes inherited from ilCustomBlock
 $id
 
 $context_obj_id
 
 $context_obj_type
 
 $context_sub_obj_id
 
 $context_sub_obj_type
 
 $type
 
 $title
 

Additional Inherited Members

- Static Public Member Functions inherited from ilCustomBlock
static multiBlockQuery ($a_context_obj_type, array $a_context_obj_ids)
 

Detailed Description

Custom block for external feeds.

Author
alex killing

Definition at line 12 of file class.ilExternalFeedBlock.php.

Constructor & Destructor Documentation

◆ __construct()

ilExternalFeedBlock::__construct (   $a_id = 0)

Constructor.

Parameters
int$a_id

Reimplemented from ilCustomBlock.

Definition at line 22 of file class.ilExternalFeedBlock.php.

23 {
24 if ($a_id > 0)
25 {
26 $this->setId($a_id);
27 $this->read();
28 }
29
30 }
setId($a_id)
Set Id.
read()
Read item from database.

References read(), and ilCustomBlock\setId().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilExternalFeedBlock::create ( )

Create new item.

Reimplemented from ilCustomBlock.

Definition at line 56 of file class.ilExternalFeedBlock.php.

57 {
58 global $ilDB, $ilLog;
59
60 parent::create();
61
62 $query = "INSERT INTO il_external_feed_block (".
63 " id".
64 ", feed_url".
65 " ) VALUES (".
66 $ilDB->quote($this->getId(), "integer")
67 .",".$ilDB->quote($this->getFeedUrl(), "text").")";
68 $ilDB->manipulate($query);
69
70 }
global $ilDB

References $ilDB, $ilLog, $query, getFeedUrl(), and ilCustomBlock\getId().

+ Here is the call graph for this function:

◆ delete()

ilExternalFeedBlock::delete ( )

Delete item from database.

Reimplemented from ilCustomBlock.

Definition at line 113 of file class.ilExternalFeedBlock.php.

114 {
115 global $ilDB;
116
117 parent::delete();
118
119 $query = "DELETE FROM il_external_feed_block".
120 " WHERE id = ".$ilDB->quote($this->getId(), "integer");
121
122 $ilDB->manipulate($query);
123
124 }

References $ilDB, $query, and ilCustomBlock\getId().

+ Here is the call graph for this function:

◆ getFeedUrl()

ilExternalFeedBlock::getFeedUrl ( )

Get FeedUrl.

Returns
string URL of the external news feed.

Definition at line 47 of file class.ilExternalFeedBlock.php.

References $feed_url.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ read()

ilExternalFeedBlock::read ( )

Read item from database.

Reimplemented from ilCustomBlock.

Definition at line 76 of file class.ilExternalFeedBlock.php.

77 {
78 global $ilDB;
79
80 parent::read();
81
82 $query = "SELECT * FROM il_external_feed_block WHERE id = ".
83 $ilDB->quote($this->getId(), "integer");
84 $set = $ilDB->query($query);
85 $rec = $ilDB->fetchAssoc($set);
86
87 $this->setFeedUrl($rec["feed_url"]);
88
89 }
setFeedUrl($a_feed_url)
Set FeedUrl.

References $ilDB, $query, ilCustomBlock\getId(), and setFeedUrl().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFeedUrl()

ilExternalFeedBlock::setFeedUrl (   $a_feed_url)

Set FeedUrl.

Parameters
string$a_feed_urlURL of the external news feed.

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

38 {
39 $this->feed_url = $a_feed_url;
40 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilExternalFeedBlock::update ( )

Update item in database.

Reimplemented from ilCustomBlock.

Definition at line 95 of file class.ilExternalFeedBlock.php.

96 {
97 global $ilDB;
98
99 parent::update();
100
101 $query = "UPDATE il_external_feed_block SET ".
102 " feed_url = ".$ilDB->quote($this->getFeedUrl(), "text").
103 " WHERE id = ".$ilDB->quote($this->getId(), "integer");
104
105 $ilDB->manipulate($query);
106
107 }

References $ilDB, $query, getFeedUrl(), and ilCustomBlock\getId().

+ Here is the call graph for this function:

Field Documentation

◆ $feed_url

ilExternalFeedBlock::$feed_url
protected

Definition at line 15 of file class.ilExternalFeedBlock.php.

Referenced by getFeedUrl().


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