Modules/Groupware/Feeds/Account/Model/Account.php
\Conjoon_Modules_Groupware_Feeds_Account_Model_Account
Table data gateway. Models the table <tt>groupware_feeds_accounts</tt>.
- Parent(s)
- \Conjoon_BeanContext_Decoratable < ?\Zend_Db_Table
- Author
- Thorsten Suckow-Homberg
- Category
- Model
- Uses
- \Conjoon_Db_Table
Properties

string
$_name= ''groupware_feeds_accounts''
The name of the table in the underlying datastore this class represents.
'groupware_feeds_accounts'Details- Type
- string

string
$_primary= ''id''
The name of the column that denotes the primary key for this table
'id'Details- Type
- string

String
$_tblPrefix= '""'
""Details- Type
- String
- Inherited_from
- \Conjoon_Db_Table::$$_tblPrefix
Methods

__construct(
string | array $config
=
array(), \unknown_type $definition
=
null
)
:
void__construct() - For concrete implementation of Conjoon_Db_Table
Inherited from: \Conjoon_Db_Table::__construct()This constructor automatically prepends the prefix as defined using setTablePrefix() to this table's name.
| Name | Type | Description |
|---|---|---|
| $config | string | array | string can reference a Zend_Registry key for a db adapter OR it can refernece the name of a table |
| $definition | \unknown_type |

addAccount(
array $data, integer $userId
)
:
integerAdds a new account.
| Name | Type | Description |
|---|---|---|
| $data | array | An associative array with the key/value pairs. |
| $userId | integer | The id of the user for which the account gets added |
| Type | Description |
|---|---|
| integer | The id of the newly added data |

deleteAccount(
integer $id, boolean $removeFeedItems
=
true
)
:
booleanRemoves the account with the specified id entirely.
| Name | Type | Description |
|---|---|---|
| $id | integer | |
| $removeFeedItems | boolean | Whether or not to remove corresponding feed items. Defaults to true. |
| Type | Description |
|---|---|
| boolean | true if the account was deleted, otherwise false |

getAccount(
integer $id
)
:
\Zend_Db_Table_rowReturns the account with the specified id.
| Name | Type | Description |
|---|---|---|
| $id | integer | The id of the account to query. |
| Type | Description |
|---|---|
| \Zend_Db_Table_row |

getAccountsForUser(
int $id
)
:
\Zend_Db_Table_RowsetReturns all feeds accounts for the specified user-id.
| Name | Type | Description |
|---|---|---|
| $id | int | The id of the user to get the email accounts for |
| Type | Description |
|---|---|
| \Zend_Db_Table_Rowset |

getAccountsToUpdate(
integer $userId, integer $time
)
:
\Zend_Db_Table_RowsetReturns all accounts which need to be updated with new feed items.
Based on the passed timestamp, only those accounts get returned where the $time minus the last_update field of an account is greater than the value of the update_field of the account.
| Name | Type | Description |
|---|---|---|
| $userId | integer | The id of the user the accounts belong to |
| $time | integer | The timestamp that is used to measure if a new update of a specific account is neccessary |
| Type | Description |
|---|---|
| \Zend_Db_Table_Rowset |

setLastUpdated(
mixed $id, integer $timestamp
)
:
integerUpdates last_update field of one or more rows.
| Name | Type | Description |
|---|---|---|
| $id | mixed | Either an integer with teh id of the row to update or a numeric array with the ids of the rows to update |
| $timestamp | integer | The timestamp value for the last_updated field |
| Type | Description |
|---|---|
| integer | The number of rows updated |

updateAccount(
integer $id, array $data
)
:
booleanUpdates the account with the specified id with the passed values.
| Name | Type | Description |
|---|---|---|
| $id | integer | The of the account to update |
| $data | array | an associative array with key/value pairs. |
| Type | Description |
|---|---|
| boolean | true if the account was updated, otherwise, false |