Newsletterdeveloper's documentation

news_category Class Reference
[DBO Model API]

DBO for news_category entity. More...

List of all members.

Basic DBO Methods

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


Detailed Description

DBO for news_category entity.

News item category.

Diagram
inline_dotgraph_2.dot
SQL Code
 CREATE TABLE news_categories
 (
   news_category_id SERIAL PRIMARY KEY,
   -- Category name.
   name TEXT NOT NULL,
   -- Category description.
   description TEXT NOT NULL
 );
 CREATE TABLE categories_news_subscriber_news_category
 (
   news_subscriber_id INTEGER NOT NULL,
   news_category_id INTEGER NOT NULL
 );
Entity attributes
Attr. NameTypeCommentOptionalRead-only
nametextCategory name.nono
descriptiontextCategory description.nono


Constructor & Destructor Documentation

news_category::__construct ( no_session = false  ) 

Reimplemented from dbo.

References get().


Member Function Documentation

static news_category::create ( name,
description 
) [static]

Create new news_category entity.

Parameters:
name [string] Category name.
description [string] Category description.
Returns:
[news_category] Entity DBO.
Exceptions:
Exception on error.
Relations

static news_category::get (  )  [static]

Get news_category 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_category] Entity DBO.
Exceptions:
Exception on error.

Reimplemented from dbo.

Referenced by __construct().

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

Query news_category entities from DB limited by some condition.

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

static news_category::try_get (  )  [static]

Try to get news_category entity from DB.

Return NULL on failure.

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

Returns:
[news_category|NULL] Entity DBO.


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