本文整理匯總了PHP中Opus_Document::setServerDateModifiedByIds方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opus_Document::setServerDateModifiedByIds方法的具體用法?PHP Opus_Document::setServerDateModifiedByIds怎麽用?PHP Opus_Document::setServerDateModifiedByIds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Opus_Document
的用法示例。
在下文中一共展示了Opus_Document::setServerDateModifiedByIds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateDocuments
/**
* make sure documents related to Collection[Role|]s in subtree are updated
* (XML-Cache and server_date_published)
*
* @param Opus_Collection Starting point for recursive update to documents
*/
protected function updateDocuments($model)
{
if (is_null($model) || is_null($model->getId())) {
// TODO explain why this is right
return;
}
$collections = Opus_Db_TableGateway::getInstance('Opus_Db_Collections');
$collectionIdSelect = $collections->selectSubtreeById($model->getId(), 'id');
$documentFinder = new Opus_DocumentFinder();
$documentFinder->setCollectionId($collectionIdSelect);
// clear affected documents from cache
$xmlCache = new Opus_Model_Xml_Cache();
$xmlCache->removeAllEntriesWhereSubSelect($documentFinder->getSelectIds());
// update ServerDateModified for affected documents
$date = new Opus_Date();
$date->setNow();
Opus_Document::setServerDateModifiedByIds($date, $documentFinder->ids());
}
示例2: invalidateDocumentCacheFor
protected function invalidateDocumentCacheFor(Opus_Model_AbstractDb $model)
{
$documentFinder = new Opus_DocumentFinder();
$documentFinder->setDependentModel($model);
$select = $documentFinder->getSelectIds();
$ids = $documentFinder->Ids();
$xmlCache = new Opus_Model_Xml_Cache();
$xmlCache->removeAllEntriesWhereSubSelect($select);
$date = new Opus_Date();
$date->setNow();
Opus_Document::setServerDateModifiedByIds($date, $ids);
}