本文整理汇总了PHP中Opus_Document::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Opus_Document::delete方法的具体用法?PHP Opus_Document::delete怎么用?PHP Opus_Document::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opus_Document
的用法示例。
在下文中一共展示了Opus_Document::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reject
/**
* Rejects documents and adds the given Person as referee.
*
* @param array $docIds
* @param mixed $userId
* @param Opus_Person $person
*
* FIXME capture success or failure for display afterwards
*/
public function reject(array $docIds = null, $userId = null, $person = null)
{
$logger = Zend_Registry::get('Zend_Log');
foreach ($docIds as $docId) {
$logger->debug('Deleting document with id: ' . $docId);
$document = new Opus_Document($docId);
if (isset($person)) {
$document->addPersonReferee($person);
}
$enrichment = $document->addEnrichment();
$enrichment->setKeyName('review.rejected_by')->setValue($userId);
$document->delete();
}
return;
}
示例2: changeState
/**
* Performs state change on document.
* @param Opus_Document $document
* @param string $targetState
*
* TODO enforcing permissions and throwing exceptions (OPUSVIER-1959)
*/
public function changeState($document, $targetState)
{
switch ($targetState) {
case 'deleted':
$document->delete();
break;
case 'removed':
$document->deletePermanent();
break;
default:
$document->setServerState($targetState);
$document->store();
break;
}
}