Relations | |
| $categories | |
| [dbo_bag] Bag for relation categories (news_category). | |
Basic DBO Methods | |
| __construct ($no_session=false) | |
| static | create ($email, $realname) |
| Create new news_subscriber entity. | |
| static | get () |
| Get news_subscriber entity from DB. | |
| static | try_get () |
| Try to get news_subscriber entity from DB. | |
| static | query ($cond=null) |
| Query news_subscriber entities from DB limited by some condition. | |
Newsletter subscriber.
CREATE TABLE news_subscribers ( news_subscriber_id SERIAL PRIMARY KEY, -- Subscriber's e-mail. email TEXT NOT NULL, -- Subscriber's real name. realname TEXT, -- row insertion timestamp _insert_time TIMESTAMP DEFAULT current_timestamp NOT NULL, -- row update timestamp _update_time TIMESTAMP ); 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 |
|---|---|---|---|---|
| text | Subscriber's e-mail. | no | no | |
| realname | text | Subscriber's real name. | yes | no |
| Bag Name | Item Type | Comment | Owned | Ordered | Min - Max |
|---|---|---|---|---|---|
| categories | news_category | Categories subscriber wants to receive. | no | no | 0 - unlimited |
| static news_subscriber::create | ( | $ | email, | |
| $ | realname | |||
| ) | [static] |
Create new news_subscriber entity.
| [string] Subscriber's e-mail. | ||
| realname | [string] Subscriber's real name. |
| Exception | on error. |
| static news_subscriber::get | ( | ) | [static] |
Get news_subscriber 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_subscriber::query | ( | $ | cond = null |
) | [static] |
Query news_subscriber entities from DB limited by some condition.
| cond | [string] Additinal condition appended to 'SELECT * FROM news_subscribers'. |
| static news_subscriber::try_get | ( | ) | [static] |
Try to get news_subscriber entity from DB.
Return NULL on failure.
This method accepts same argumesnts as news_subscriber::get().
| news_subscriber::$categories |
[dbo_bag] Bag for relation categories (news_category).
Categories subscriber wants to receive.