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. | |
News item category.
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 );
| Attr. Name | Type | Comment | Optional | Read-only |
|---|---|---|---|---|
| name | text | Category name. | no | no |
| description | text | Category description. | no | no |
| static news_category::create | ( | $ | name, | |
| $ | description | |||
| ) | [static] |
Create new news_category entity.
| name | [string] Category name. | |
| description | [string] Category description. |
| Exception | on error. |
| 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:
| 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.
| cond | [string] Additinal condition appended to 'SELECT * FROM news_categories'. |
| 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().