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. | |
Site news item.
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 );
| Attr. Name | Type | Comment | Optional | Read-only |
|---|---|---|---|---|
| title | text | Mail subject, rss feed title, ... | no | no |
| content | text | Repeats info from the title with more detail. | no | no |
| Bag Name | Item Type | Comment | Owned | Ordered | Min - Max |
|---|---|---|---|---|---|
| category | news_category | News category this item belongs to. | no | no | 1 - 1 |
| static news_item::create | ( | $ | title, | |
| $ | content | |||
| ) | [static] |
Create new news_item entity.
| title | [string] Mail subject, rss feed title, ... | |
| content | [string] Repeats info from the title with more detail. |
| Exception | on error. |
| 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:
| 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.
| cond | [string] Additinal condition appended to 'SELECT * FROM news_items'. |
| 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().
| news_item::$category |
[dbo_bag] Bag for relation category (news_category).
News category this item belongs to.