本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository::countByName方法的典型用法代码示例。如果您正苦于以下问题:PHP WorkspaceRepository::countByName方法的具体用法?PHP WorkspaceRepository::countByName怎么用?PHP WorkspaceRepository::countByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository
的用法示例。
在下文中一共展示了WorkspaceRepository::countByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: repairCommand
/**
* Repair inconsistent nodes
*
* This command analyzes and repairs the node tree structure and individual nodes
* based on the current node type configuration.
*
* The following checks will be performed:
*
* {pluginDescriptions}
* <b>Examples:</b>
*
* ./flow node:repair
*
* ./flow node:repair --node-type TYPO3.Neos.NodeTypes:Page
*
* @param string $nodeType Node type name, if empty update all declared node types
* @param string $workspace Workspace name, default is 'live'
* @param boolean $dryRun Don't do anything, but report actions
* @param boolean $cleanup If FALSE, cleanup tasks are skipped
* @return void
*/
public function repairCommand($nodeType = null, $workspace = 'live', $dryRun = false, $cleanup = true)
{
$this->pluginConfigurations = self::detectPlugins($this->objectManager);
if ($this->workspaceRepository->countByName($workspace) === 0) {
$this->outputLine('Workspace "%s" does not exist', array($workspace));
exit(1);
}
if ($nodeType !== null) {
if ($this->nodeTypeManager->hasNodeType($nodeType)) {
$nodeType = $this->nodeTypeManager->getNodeType($nodeType);
} else {
$this->outputLine('Node type "%s" does not exist', array($nodeType));
exit(1);
}
}
if ($dryRun) {
$this->outputLine('Dry run, not committing any changes.');
}
foreach ($this->pluginConfigurations as $pluginConfiguration) {
/** @var NodeCommandControllerPluginInterface $plugin */
$plugin = $pluginConfiguration['object'];
$this->outputLine('<b>' . $plugin->getSubCommandShortDescription('repair') . '</b>');
$this->outputLine();
$plugin->invokeSubCommand('repair', $this->output, $nodeType, $workspace, $dryRun, $cleanup);
$this->outputLine();
}
$this->outputLine('Node repair finished.');
}