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


PHP PhabricatorApplicationTransaction::getIgnoreOnNoEffect方法代码示例

本文整理汇总了PHP中PhabricatorApplicationTransaction::getIgnoreOnNoEffect方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransaction::getIgnoreOnNoEffect方法的具体用法?PHP PhabricatorApplicationTransaction::getIgnoreOnNoEffect怎么用?PHP PhabricatorApplicationTransaction::getIgnoreOnNoEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorApplicationTransaction的用法示例。


在下文中一共展示了PhabricatorApplicationTransaction::getIgnoreOnNoEffect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mergePHIDOrEdgeTransactions

 protected function mergePHIDOrEdgeTransactions(PhabricatorApplicationTransaction $u, PhabricatorApplicationTransaction $v)
 {
     $result = $u->getNewValue();
     foreach ($v->getNewValue() as $key => $value) {
         if ($u->getTransactionType() == PhabricatorTransactions::TYPE_EDGE) {
             if (empty($result[$key])) {
                 $result[$key] = $value;
             } else {
                 // We're merging two lists of edge adds, sets, or removes. Merge
                 // them by merging individual PHIDs within them.
                 $merged = $result[$key];
                 foreach ($value as $dst => $v_spec) {
                     if (empty($merged[$dst])) {
                         $merged[$dst] = $v_spec;
                     } else {
                         // Two transactions are trying to perform the same operation on
                         // the same edge. Normalize the edge data and then merge it. This
                         // allows transactions to specify how data merges execute in a
                         // precise way.
                         $u_spec = $merged[$dst];
                         if (!is_array($u_spec)) {
                             $u_spec = array('dst' => $u_spec);
                         }
                         if (!is_array($v_spec)) {
                             $v_spec = array('dst' => $v_spec);
                         }
                         $ux_data = idx($u_spec, 'data', array());
                         $vx_data = idx($v_spec, 'data', array());
                         $merged_data = $this->mergeEdgeData($u->getMetadataValue('edge:type'), $ux_data, $vx_data);
                         $u_spec['data'] = $merged_data;
                         $merged[$dst] = $u_spec;
                     }
                 }
                 $result[$key] = $merged;
             }
         } else {
             $result[$key] = array_merge($value, idx($result, $key, array()));
         }
     }
     $u->setNewValue($result);
     // When combining an "ignore" transaction with a normal transaction, make
     // sure we don't propagate the "ignore" flag.
     if (!$v->getIgnoreOnNoEffect()) {
         $u->setIgnoreOnNoEffect(false);
     }
     return $u;
 }
开发者ID:sethkontny,项目名称:phabricator,代码行数:47,代码来源:PhabricatorApplicationTransactionEditor.php


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