本文整理汇总了PHP中Zend_Pdf_Action::getDestination方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Action::getDestination方法的具体用法?PHP Zend_Pdf_Action::getDestination怎么用?PHP Zend_Pdf_Action::getDestination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Pdf_Action
的用法示例。
在下文中一共展示了Zend_Pdf_Action::getDestination方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _cleanUpAction
/**
* Walk through action and its chained actions tree and remove nodes
* if they are GoTo actions with an unresolved target.
*
* Returns null if root node is deleted or updated action overwise.
*
* @todo Give appropriate name and make method public
*
* @param Zend_Pdf_Action $action
* @param boolean $refreshPagesHash Refresh page collection hashes before processing
* @return Zend_Pdf_Action|null
*/
protected function _cleanUpAction(Zend_Pdf_Action $action, $refreshPageCollectionHashes = true)
{
if ($this->_pageReferences === null || $refreshPageCollectionHashes) {
$this->_refreshPagesHash();
}
// Named target is an action
if ($action instanceof Zend_Pdf_Action_GoTo &&
$this->resolveDestination($action->getDestination(), false) === null) {
// Action itself is a GoTo action with an unresolved destination
return null;
}
// Walk through child actions
$iterator = new RecursiveIteratorIterator($action, RecursiveIteratorIterator::SELF_FIRST);
$actionsToClean = array();
$deletionCandidateKeys = array();
foreach ($iterator as $chainedAction) {
if ($chainedAction instanceof Zend_Pdf_Action_GoTo &&
$this->resolveDestination($chainedAction->getDestination(), false) === null) {
// Some child action is a GoTo action with an unresolved destination
// Mark it as a candidate for deletion
$actionsToClean[] = $iterator->getSubIterator();
$deletionCandidateKeys[] = $iterator->getSubIterator()->key();
}
}
foreach ($actionsToClean as $id => $action) {
unset($action->next[$deletionCandidateKeys[$id]]);
}
return $action;
}
示例2: _cleanUpAction
protected function _cleanUpAction(Zend_Pdf_Action $action, $refreshPageCollectionHashes = true)
{
if ($this->_pageReferences === null || $refreshPageCollectionHashes) {
$this->_refreshPagesHash();
}
if ($action instanceof Zend_Pdf_Action_GoTo && $this->resolveDestination($action->getDestination(), false) === null) {
return null;
}
$iterator = new RecursiveIteratorIterator($action, RecursiveIteratorIterator::SELF_FIRST);
$actionsToClean = array();
$deletionCandidateKeys = array();
foreach ($iterator as $chainedAction) {
if ($chainedAction instanceof Zend_Pdf_Action_GoTo && $this->resolveDestination($chainedAction->getDestination(), false) === null) {
$actionsToClean[] = $iterator->getSubIterator();
$deletionCandidateKeys[] = $iterator->getSubIterator()->key();
}
}
foreach ($actionsToClean as $id => $action) {
unset($action->next[$deletionCandidateKeys[$id]]);
}
return $action;
}