Modules/Groupware/Feeds/Item/Facade.php
\Conjoon_Modules_Groupware_Feeds_Item_Facade
- Author
- Thorsten Suckow-Homberg
Properties
Methods

_addItemIfNotExists(
array $data, integer $accountId, boolean $clearCache
=
true
)
:
integerAdds a feed item into the data storage for the specified account, if it does not already exist.
| 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. |
| Type | Description |
|---|---|
| integer | The id of the added item as provided by the data storage |
| Exception | Description |
|---|---|
| \InvalidArgumentException |

_getAccountFacade(
)
:
\Conjoon_Modules_Groupware_Feeds_Account_Facade| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Feeds_Account_Facade |

_getAccountIdsForFeedIds(
array $feedIds
)
:
arrayReturns the account ids for the passed feed ids.
| Name | Type | Description |
|---|---|---|
| $feedIds | array | integer $feedIds |
| Type | Description |
|---|---|
| array |

_getFeedItems(
integer $userId, integer $accountId
)
:
\Conjoon_Modules_Groupware_Feeds_Item_DtoReturns 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.
| Name | Type | Description |
|---|---|---|
| $userId | integer | |
| $accountId | integer |
| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Feeds_Item_Dto |

_getItemModel(
)
:
\Conjoon_Modules_Groupware_Feeds_Item_Model_Item| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Feeds_Item_Model_Item |

_removeListCacheForAccountIds(
array $accountIds
)
:
voidRemoves the cache for the specified account ids.
| Name | Type | Description |
|---|---|---|
| $accountIds | array |

_removeListCacheForFeedIds(
array $feedIds
)
:
voidRemoves the cache for the account ids that own the specified feed ids.
| Name | Type | Description |
|---|---|---|
| $feedIds | array |

deleteFeedItemsForAccountId(
integer $accountId
)
:
voidDeletes all feed items for the specified account id.
| Name | Type | Description |
|---|---|---|
| $accountId | integer |
| Exception | Description |
|---|---|
| \InvalidArgumentException |

deleteOldFeedItems(
integer $userId
)
:
voidDeletes all feed items for the specified user based on the deleteInterval.
| Name | Type | Description |
|---|---|---|
| $userId | integer |
| Exception | Description |
|---|---|
| \InvalidArgumentException |

getFeedContent(
integer $id, integer $accountId, integer $userId
)
:
\Conjoon_Modules_Groupware_Feeds_Item_DtoReturns an Conjoon_Modules_Groupware_Feeds_Item_Dto for the specified item id and the specified accountId.
| Name | Type | Description |
|---|---|---|
| $id | integer | |
| $accountId | integer | |
| $userId | integer |
| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Feeds_Item_Dto |
| Exception | Description |
|---|---|
| \InvalidArgumentExceptions |

getFeedItemsForAccount(
integer $accountId, integer $userId
)
:
arrayReturns an array of feed items for the specified account id.
| Name | Type | Description |
|---|---|---|
| $accountId | integer | |
| $userId | integer |
| Type | Description |
|---|---|
| array | Conjoon_Modules_Groupware_Feeds_Item_Dto |
| Exception | Description |
|---|---|
| \InvalidArgumentExceptions |

getFeedItemsForUser(
integer $userId
)
:
arrayReturns an array of feed items for all accounts that belong to the specified user.
| Name | Type | Description |
|---|---|---|
| $userId | integer |
| Type | Description |
|---|---|
| array | Conjoon_Modules_Groupware_Feeds_Item_Dto |
| Exception | Description |
|---|---|
| \InvalidArgumentExceptions |

getItemsForAccount(
integer $accountId
)
:
arrayreturns a list of items for the specified account id.
| Name | Type | Description |
|---|---|---|
| $accountId | integer |
| Type | Description |
|---|---|
| array | Conjoon_Modules_Groupware_Feeds_Item_Dto |
| Exception | Description |
|---|---|
| \InvalidArgumentException |

importAndAddFeedItems(
integer $accountId, integer $userId, boolean $useReaderCache
=
false, boolean $useConditionalGet
=
false
)
:
arrayImports 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.
| Name | Type | Description |
|---|---|---|
| $accountId | integer | |
| $userId | integer | |
| $useReaderCache | boolean | |
| $useConditionalGet | boolean |
| Type | Description |
|---|---|
| array | Returns an array with the recently added Conjoon_Modules_Groupware_Feeds_Item_Dto |
| Exception | Description |
|---|---|
| \Exception |

setItemsRead(
array $read, array $unread
)
:
voidSets the items for the specified ids either to read or unread.
| Name | Type | Description |
|---|---|---|
| $read | array | integer $read |
| $unread | array | integer$unread |

syncAndGetFeedItemsForUser(
integer $userId, $removeOld, integer $timeout
)
:
arrayReturns 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.
| 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. |
| Type | Description |
|---|---|
| array | Conjoon_Modules_Groupware:Feeds_Item_Dto |