Modules/Groupware/Email/Item/Model/Inbox.php

Show: inherited
Table of Contents

\Conjoon_Modules_Groupware_Email_Item_Model_Inbox

Package: Conjoon\Groupware\Email\Model

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

Constant  HASH = 'hash'
Constant  UID = 'uid'
Constant  MESSAGE_ID = 'message_id'

Properties

Propertyprotectedstring  $_name= ''groupware_email_items_inbox''

The name of the table in the underlying datastore this class represents.

Default value'groupware_email_items_inbox'Details
Type
string
Propertyprotectedstring  $_primary= ''groupware_email_items_id''

The name of the column that denotes the primary key for this table

Default value'groupware_email_items_id'Details
Type
string
PropertyprotectedString  $_tblPrefix= '""'
staticinherited

Default table prefix.

Inherited from: \Conjoon_Db_Table::$$_tblPrefix
Default value""Details
Type
String
Inherited_from
\Conjoon_Db_Table::$$_tblPrefix  

Methods

methodpublic__construct( string | array $config = array(), \unknown_type $definition = null ) : void
inherited

__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.

Parameters
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
methodpublicaddInboxData( array $data ) : bool

Adds the specified data to the inbox table. Takes care of sending large data as a stream into the table.

Parameters
Name Type Description
$data array
Returns
Type Description
bool
Throws
Exception Description
\Conjoon_Exception
methodpubliccomputeMessageHash( string $rawHeader, string $rawBody ) : string
static

A 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.

Parameters
Name Type Description
$rawHeader string
$rawBody string
Returns
Type Description
string
methodpublicgetDecoratableMethods( ) : void

methodpublicgetLatestEmailItemsFor( integer $userId, integer $minDate, array $sortInfo ) : array

Fetches 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'.

Parameters
Name Type Description
$userId integer

The id of the user

$minDate integer

A timestamp

$sortInfo array

An array with sortInfo.

Returns
Type Description
array
methodpublicgetLatestItemCount( \interger $userId, \$integer $minDate ) : integer

Returns the total number of emails which fetched_timestamp is greater than or equal to minDate

Parameters
Name Type Description
$userId \interger
$minDate \$integer
Returns
Type Description
integer The total number of items fetched since minDate, or 0 if there where no items
methodpublicgetMatchingUids( array $uids, integer $accountId ) : array

Returns 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.

Parameters
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.

Returns
Type Description
array
methodpublicgetMessageIdForItem( integer $itemId ) : string

Returns 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.

Parameters
Name Type Description
$itemId integer
Returns
Type Description
string
methodpublicgetRepresentedEntity( ) : void

methodpublicgetTablePrefix( ) : String
staticinherited

Returns the table prefix.

Inherited from: \Conjoon_Db_Table::getTablePrefix()
Returns
Type Description
String
methodpublicisUniqueKeyPresent( string $uid, integer $accountId,  $type ) : boolean

Checks 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.

Parameters
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
Returns
Type Description
boolean true if the data was found, otherwise false.
methodpublicsetTablePrefix( String $prefix ) : void
staticinherited

Sets the table prefix.

Inherited from: \Conjoon_Db_Table::setTablePrefix()
Parameters
Name Type Description
$prefix String
Documentation was generated by DocBlox 0.18.1.