Newsletterdeveloper's documentation

news_item Class Reference
[DBO Model API]

DBO for news_item entity. More...

List of all members.

Relations

 $category
 [dbo_bag] Bag for relation category (news_category).

Basic DBO Methods

 __construct ($no_session=false)
static create ($title, $content)
 Create new news_item entity.
static get ()
 Get news_item entity from DB.
static try_get ()
 Try to get news_item entity from DB.
static query ($cond=null)
 Query news_item entities from DB limited by some condition.


Detailed Description

DBO for news_item entity.

Site news item.

Diagram
inline_dotgraph_3.dot
SQL Code
 CREATE TABLE news_items
 (
   news_item_id SERIAL PRIMARY KEY,
   -- Mail subject, rss feed title, ...
   title TEXT NOT NULL,
   -- Repeats info from the title with more detail.
   content TEXT NOT NULL,
   -- relation N:1 news_item.category --> news_category
   category_news_category_id INTEGER,
   -- row insertion timestamp
   _insert_time TIMESTAMP DEFAULT current_timestamp NOT NULL,
   -- row update timestamp
   _update_time TIMESTAMP
 );
Entity attributes
Attr. NameTypeCommentOptionalRead-only
titletextMail subject, rss feed title, ...nono
contenttextRepeats info from the title with more detail.nono
Entity relations
Bag NameItem TypeCommentOwnedOrderedMin - Max
categorynews_categoryNews category this item belongs to.nono1 - 1


Constructor & Destructor Documentation

news_item::__construct ( no_session = false  ) 

Reimplemented from dbo.

References get().


Member Function Documentation

static news_item::create ( title,
content 
) [static]

Create new news_item entity.

Parameters:
title [string] Mail subject, rss feed title, ...
content [string] Repeats info from the title with more detail.
Returns:
[news_item] Entity DBO.
Exceptions:
Exception on error.
Relations

static news_item::get (  )  [static]

Get news_item entity from DB.

This method can be used to get single object from database. You can call it in following ways:

  • type::get(1) - get object with given ID
  • type::get('WHERE x = ?', 1) - get object by condition
  • type::get(array('type_id' => 1, '' ...)) - get object from array
Returns:
[news_item] Entity DBO.
Exceptions:
Exception on error.

Reimplemented from dbo.

Referenced by __construct().

static news_item::query ( cond = null  )  [static]

Query news_item entities from DB limited by some condition.

Parameters:
cond [string] Additinal condition appended to 'SELECT * FROM news_items'.
Returns:
[array(news_item)] Array of entity DBOs.

static news_item::try_get (  )  [static]

Try to get news_item entity from DB.

Return NULL on failure.

This method accepts same argumesnts as news_item::get().

Returns:
[news_item|NULL] Entity DBO.


Member Data Documentation

news_item::$category

[dbo_bag] Bag for relation category (news_category).

News category this item belongs to.


The documentation for this class was generated from the following file:
Documentation for Newsletter, Tue Nov 11 07:50:02 2008.