本文整理汇总了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));
}
}
}
示例2: removeMixin
/**
* {@inheritdoc}
*/
public function removeMixin($mixinName)
{
return $this->node->removeMixin($mixinName);
}