/** * Get infos about the attachments of a given object * * @param object $attachmentRepository [ref] the attachment Repository * @param int $fkid the id of the object (attachments.fk_id); * @param string $fkTableName the name of the table $fkid refers to (attachments.fk_table) * @param bool $storeListInSession if true, the attachment list will be stored within the session * @param int $counter if $counter > 0 the attachments are appended to existing attachments within the session * * @return array infos about the attachment on success, NULL else */ function getAttachmentInfos(&$attachmentRepository, $fkid, $fkTableName, $storeListInSession = true, $counter = 0) { $attachmentInfos = $attachmentRepository->getAttachmentInfosFor($fkid, $fkTableName); if ($storeListInSession) { storeAttachmentsInSession($attachmentInfos, $counter); } return $attachmentInfos; }
/** * Use repository manager, to get information about the attachments of a given object, * * @param object $repository [ref] the attachment Repository * @param int $objectID id of the object that owns the attachment (attachments.fk_id); * @param string $fkTableName the name of the table $fkid refers to (attachments.fk_table) * @param bool $storeListInSession if true, the attachment list will be stored within the session * @param int $counter if $counter > 0 the attachments are appended to existing attachments within the session * * @return array infos about the attachment on success, NULL else */ function getAttachMetaDataViaRepository(&$repository, $itemID, $fkTableName, $storeListInSession = true, $counter = 0) { $attach = $repository->getAttachmentInfosFor($itemID, $fkTableName); if ($storeListInSession) { $this->storeInSession(); } return $attach; }