本文整理汇总了PHP中TYPO3\Neos\Domain\Repository\SiteRepository::findByNodeName方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteRepository::findByNodeName方法的具体用法?PHP SiteRepository::findByNodeName怎么用?PHP SiteRepository::findByNodeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Neos\Domain\Repository\SiteRepository
的用法示例。
在下文中一共展示了SiteRepository::findByNodeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportCommand
/**
* Export sites content
*
* This command exports all or one specific site with all its content into an XML format.
*
* If the package key option is given, the site(s) will be exported to the given package in the default
* location Resources/Private/Content/Sites.xml.
*
* If the filename option is given, any resources will be exported to files in a folder named "Resources"
* alongside the XML file.
*
* If neither the filename nor the package key option are given, the XML will be printed to standard output and
* assets will be embedded into the XML in base64 encoded form.
*
* @param string $siteNode the node name of the site to be exported; if none given will export all sites
* @param boolean $tidy Whether to export formatted XML
* @param string $filename relative path and filename to the XML file to create. Any resource will be stored in a sub folder "Resources".
* @param string $packageKey Package to store the XML file in. Any resource will be stored in a sub folder "Resources".
* @param string $nodeTypeFilter Filter the node type of the nodes, allows complex expressions (e.g. "TYPO3.Neos:Page", "!TYPO3.Neos:Page,TYPO3.Neos:Text")
* @return void
*/
public function exportCommand($siteNode = null, $tidy = false, $filename = null, $packageKey = null, $nodeTypeFilter = null)
{
if ($siteNode === null) {
$sites = $this->siteRepository->findAll()->toArray();
} else {
$sites = $this->siteRepository->findByNodeName($siteNode)->toArray();
}
if (count($sites) === 0) {
$this->outputLine('Error: No site for exporting found');
$this->quit(1);
}
if ($packageKey !== null) {
$this->siteExportService->exportToPackage($sites, $tidy, $packageKey, $nodeTypeFilter);
if ($siteNode !== null) {
$this->outputLine('The site "%s" has been exported to package "%s".', array($siteNode, $packageKey));
} else {
$this->outputLine('All sites have been exported to package "%s".', array($packageKey));
}
} elseif ($filename !== null) {
$this->siteExportService->exportToFile($sites, $tidy, $filename, $nodeTypeFilter);
if ($siteNode !== null) {
$this->outputLine('The site "%s" has been exported to "%s".', array($siteNode, $filename));
} else {
$this->outputLine('All sites have been exported to "%s".', array($filename));
}
} else {
$this->output($this->siteExportService->export($sites, $tidy, $nodeTypeFilter));
}
}