当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Pdf_Action::getDestination方法代码示例

本文整理汇总了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;
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:45,代码来源:Pdf.php

示例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;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:22,代码来源:Pdf_Pack.php


注:本文中的Zend_Pdf_Action::getDestination方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。