Modules/Groupware/Feeds/Item/Facade.php

Show: inherited
Table of Contents

\Conjoon_Modules_Groupware_Feeds_Item_Facade

Package: Default

Author
Thorsten Suckow-Homberg  

Properties

Propertyprivate\Conjoon_Modules_Groupware_Feeds_Account_Facade  $_accountFacade= 'null'

Default valuenullDetails
Type
\Conjoon_Modules_Groupware_Feeds_Account_Facade
Propertyprivate\Conjoon_Modules_Groupware_Feeds_Item_Builder  $_builder= 'null'

Default valuenullDetails
Type
\Conjoon_Modules_Groupware_Feeds_Item_Builder
Propertyprivate\Conjoon_Modules_Groupware_Feeds_Item_Facade  $_instance= 'null'
static

Default valuenullDetails
Type
\Conjoon_Modules_Groupware_Feeds_Item_Facade
Propertyprivate\Conjoon_Modules_Groupware_Feeds_Item_Model_Item  $_itemModel= 'null'

Default valuenullDetails
Type
\Conjoon_Modules_Groupware_Feeds_Item_Model_Item
Propertyprivate\Conjoon_Modules_Groupware_Feeds_Item_ListBuilder  $_listBuilder= 'null'

Methods

methodprivate__clone( ) : void

methodprivate__construct( ) : void

methodprivate_addItemIfNotExists( array $data, integer $accountId, boolean $clearCache = true ) : integer

Adds a feed item into the data storage for the specified account, if it does not already exist.

Parameters
Name Type Description
$data array
$accountId integer
$clearCache boolean

Whether or not to clear the feedlist cache for the corresponding account. Cache will be cleaed if the item was actually added.

Returns
Type Description
integer The id of the added item as provided by the data storage
Throws
Exception Description
\InvalidArgumentException
methodprivate_getAccountIdsForFeedIds( array $feedIds ) : array

Returns the account ids for the passed feed ids.

Parameters
Name Type Description
$feedIds array

integer $feedIds

Returns
Type Description
array
methodprivate_getBuilder( ) : \Conjoon_Builder

Returns
Type Description
\Conjoon_Builder
methodprivate_getFeedItems( integer $userId, integer $accountId ) : \Conjoon_Modules_Groupware_Feeds_Item_Dto

Returns the feed items for the user and the specified account.

If the account is not specified, all feed items for all accounts for the user will be returned.

Parameters
Name Type Description
$userId integer
$accountId integer
Returns
Type Description
\Conjoon_Modules_Groupware_Feeds_Item_Dto
methodprivate_getListBuilder( ) : \Conjoon_Builder

Returns
Type Description
\Conjoon_Builder
methodprivate_removeListCacheForAccountIds( array $accountIds ) : void

Removes the cache for the specified account ids.

Parameters
Name Type Description
$accountIds array
methodprivate_removeListCacheForFeedIds( array $feedIds ) : void

Removes the cache for the account ids that own the specified feed ids.

Parameters
Name Type Description
$feedIds array
methodpublicdeleteFeedItemsForAccountId( integer $accountId ) : void

Deletes all feed items for the specified account id.

Parameters
Name Type Description
$accountId integer
Throws
Exception Description
\InvalidArgumentException
methodpublicdeleteOldFeedItems( integer $userId ) : void

Deletes all feed items for the specified user based on the deleteInterval.

Parameters
Name Type Description
$userId integer
Throws
Exception Description
\InvalidArgumentException
methodpublicgetFeedContent( integer $id, integer $accountId, integer $userId ) : \Conjoon_Modules_Groupware_Feeds_Item_Dto

Returns an Conjoon_Modules_Groupware_Feeds_Item_Dto for the specified item id and the specified accountId.

Parameters
Name Type Description
$id integer
$accountId integer
$userId integer
Returns
Type Description
\Conjoon_Modules_Groupware_Feeds_Item_Dto
Throws
Exception Description
\InvalidArgumentExceptions
methodpublicgetFeedItemsForAccount( integer $accountId, integer $userId ) : array

Returns an array of feed items for the specified account id.

Parameters
Name Type Description
$accountId integer
$userId integer
Returns
Type Description
array Conjoon_Modules_Groupware_Feeds_Item_Dto
Throws
Exception Description
\InvalidArgumentExceptions
methodpublicgetFeedItemsForUser( integer $userId ) : array

Returns an array of feed items for all accounts that belong to the specified user.

Parameters
Name Type Description
$userId integer
Returns
Type Description
array Conjoon_Modules_Groupware_Feeds_Item_Dto
Throws
Exception Description
\InvalidArgumentExceptions
methodpublicgetInstance( ) : void
static

methodpublicgetItemsForAccount( integer $accountId ) : array

returns a list of items for the specified account id.

Parameters
Name Type Description
$accountId integer
Returns
Type Description
array Conjoon_Modules_Groupware_Feeds_Item_Dto
Throws
Exception Description
\InvalidArgumentException
methodpublicimportAndAddFeedItems( integer $accountId, integer $userId, boolean $useReaderCache = false, boolean $useConditionalGet = false ) : array

Imports and adds the items for the requested feed uri and adds them to the account specified in $accountId if they do not already exist.

The account's lastUpdated property will also be set, and the item lists cache will be cleaned, if feed items have been actually added.

Parameters
Name Type Description
$accountId integer
$userId integer
$useReaderCache boolean
$useConditionalGet boolean
Returns
Type Description
array Returns an array with the recently added Conjoon_Modules_Groupware_Feeds_Item_Dto
Throws
Exception Description
\Exception
methodpublicsetItemsRead( array $read, array $unread ) : void

Sets the items for the specified ids either to read or unread.

Parameters
Name Type Description
$read array

integer $read

$unread array

integer$unread

methodpublicsyncAndGetFeedItemsForUser( integer $userId,  $removeOld, integer $timeout ) : array

Returns an array of Conjoon_Modules_Groupware_Feeds_Item_Dto and also reads out new feed items and returns them along with items out of the data storage.

If $removeold is set to true, the emthod will alos delete old feed items out of the data storage.

Parameters
Name Type Description
$userId integer
$removeOld
$timeout integer

The timeout for the http connection that is responsible for querying accounts for new feed items. Depending on the number of accounts that have to be queried, this should be set to a high enough value.

Returns
Type Description
array Conjoon_Modules_Groupware:Feeds_Item_Dto
Documentation was generated by DocBlox 0.18.1.