Modules/Groupware/Email/Item/Model/Inbox.php
\Conjoon_Modules_Groupware_Email_Item_Model_Inbox
Table data gateway. Models the table <tt>groupware_email_items_inbox</tt>.
- Parent(s)
- \Conjoon_BeanContext_Decoratable < ?\Zend_Db_Table
- Author
- Thorsten Suckow-Homberg
- Category
- Model
- Uses
- \Conjoon_Db_Table
Constants
Properties

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

string
$_primary= ''groupware_email_items_id''
The name of the column that denotes the primary key for this table
'groupware_email_items_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 |

addInboxData(
array $data
)
:
boolAdds the specified data to the inbox table. Takes care of sending large data as a stream into the table.
| Name | Type | Description |
|---|---|---|
| $data | array |
| Type | Description |
|---|---|
| bool |
| Exception | Description |
|---|---|
| \Conjoon_Exception |

computeMessageHash(
string $rawHeader, string $rawBody
)
:
stringA helper method for computing a unique hash for a message.
If the implementation of the algorithm changes, the inbox-table's column "hash" has to be changed accordingly.
| Name | Type | Description |
|---|---|---|
| $rawHeader | string | |
| $rawBody | string |
| Type | Description |
|---|---|
| string |

getLatestEmailItemsFor(
integer $userId, integer $minDate, array $sortInfo
)
:
arrayFetches all email items for the specified user where fetched_timestamp is greater than or equal to $minDate. This query will respect all accounts of the user and all folders that are of the meta-type 'inbox'.
| Name | Type | Description |
|---|---|---|
| $userId | integer | The id of the user |
| $minDate | integer | A timestamp |
| $sortInfo | array | An array with sortInfo. |
| Type | Description |
|---|---|
| array |

getLatestItemCount(
\interger $userId, \$integer $minDate
)
:
integerReturns the total number of emails which fetched_timestamp is greater than or equal to minDate
| Name | Type | Description |
|---|---|---|
| $userId | \interger | |
| $minDate | \$integer |
| Type | Description |
|---|---|
| integer | The total number of items fetched since minDate, or 0 if there where no items |

getMatchingUids(
array $uids, integer $accountId
)
:
arrayReturns the rows found in the database, matching the account-id and the submitted $uids. Only those rows will be returned, where the field "uid" matches the value in the corresponding index of $uid.
| Name | Type | Description |
|---|---|---|
| $uids | array | A list of uid to look up |
| $accountId | integer | The id of the account for which the presence of the uids should be checked. |
| Type | Description |
|---|---|
| array |

getMessageIdForItem(
integer $itemId
)
:
stringReturns the message id from the specified item.
Returns empty string if the item was not found or if no message-id was explicit set for this item.
| Name | Type | Description |
|---|---|---|
| $itemId | integer |
| Type | Description |
|---|---|
| string |

isUniqueKeyPresent(
string $uid, integer $accountId, $type
)
:
booleanChecks if there is an entry for the specified hash/uid/message_id in the inbox-table.
A uid/message-id/hash will only be treated as a duplicate, if the specific value already exists for an email that was alreatdy downloaded with the specific $accountId.
| Name | Type | Description |
|---|---|---|
| $uid | string | The uid as generated from the server's uidl support, or the message_id as transported by the message-header |
| $accountId | integer | The id of the account for which the uid should be looked up |
| $type |
| Type | Description |
|---|---|
| boolean | true if the data was found, otherwise false. |