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


PHP NodeInterface::removeMixin方法代码示例

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


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

示例1: processNode

 /**
  * Process - or update - a given node.
  *
  * Provides common processing for both touch and update commands.
  *
  * @param OutputInterface $output     used for status updates.
  * @param NodeInterface   $node       the node to manipulate.
  * @param array           $operations to execute on that node.
  */
 public function processNode(OutputInterface $output, NodeInterface $node, array $operations)
 {
     $operations = array_merge(array('setProp' => array(), 'removeProp' => array(), 'addMixins' => array(), 'removeMixins' => array(), 'applyClosures' => array(), 'dump' => false), $operations);
     foreach ($operations['setProp'] as $set) {
         $parts = explode('=', $set);
         $output->writeln(sprintf('<comment> > Setting property </comment>%s<comment> to </comment>%s', $parts[0], $parts[1]));
         $node->setProperty($parts[0], $parts[1]);
     }
     foreach ($operations['removeProp'] as $unset) {
         $output->writeln(sprintf('<comment> > Unsetting property </comment>%s', $unset));
         $node->setProperty($unset, null);
     }
     foreach ($operations['addMixins'] as $addMixin) {
         $output->writeln(sprintf('<comment> > Adding mixin </comment>%s', $addMixin));
         $node->addMixin($addMixin);
     }
     foreach ($operations['removeMixins'] as $removeMixin) {
         $output->writeln(sprintf('<comment> > Removing mixin </comment>%s', $removeMixin));
         $node->removeMixin($removeMixin);
     }
     foreach ($operations['applyClosures'] as $closure) {
         if ($closure instanceof \Closure) {
             $output->writeln('<comment> > Applying closure</comment>');
         } else {
             $closureString = $closure;
             $closure = create_function('$session, $node', $closure);
             $output->writeln(sprintf('<comment> > Applying closure: %s</comment>', strlen($closureString) > 75 ? substr($closureString, 0, 72) . '...' : $closureString));
         }
         $closure($this->session, $node);
     }
     if ($operations['dump']) {
         $output->writeln('<info>Node dump: </info>');
         /** @var $property PropertyInterface */
         foreach ($node->getProperties() as $property) {
             $value = $property->getValue();
             if (!is_string($value)) {
                 $value = print_r($value, true);
             }
             $output->writeln(sprintf('<comment> - %s = </comment>%s', $property->getName(), $value));
         }
     }
 }
开发者ID:frogriotcom,项目名称:phpcr-utils,代码行数:51,代码来源:PhpcrHelper.php

示例2: removeMixin

 /**
  * {@inheritdoc}
  */
 public function removeMixin($mixinName)
 {
     return $this->node->removeMixin($mixinName);
 }
开发者ID:sulu,项目名称:sulu,代码行数:7,代码来源:SuluNode.php


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