本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Repository\NodeDataRepository::findByPath方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeDataRepository::findByPath方法的具体用法?PHP NodeDataRepository::findByPath怎么用?PHP NodeDataRepository::findByPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Repository\NodeDataRepository
的用法示例。
在下文中一共展示了NodeDataRepository::findByPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pruneSite
/**
* Remove given site all nodes for that site and all domains associated.
*
* @param Site $site
* @return void
*/
public function pruneSite(Site $site)
{
$siteNodePath = '/sites/' . $site->getNodeName();
$this->nodeDataRepository->removeAllInPath($siteNodePath);
$siteNodes = $this->nodeDataRepository->findByPath($siteNodePath);
foreach ($siteNodes as $siteNode) {
$this->nodeDataRepository->remove($siteNode);
}
$domainsForSite = $this->domainRepository->findBySite($site);
foreach ($domainsForSite as $domain) {
$this->domainRepository->remove($domain);
}
$this->siteRepository->remove($site);
$this->emitSitePruned($site);
}
示例2: pruneSite
/**
* Remove given site all nodes for that site and all domains associated.
*
* @param Site $site
* @return void
*/
public function pruneSite(Site $site)
{
$siteNodePath = NodePaths::addNodePathSegment(static::SITES_ROOT_PATH, $site->getNodeName());
$this->nodeDataRepository->removeAllInPath($siteNodePath);
$siteNodes = $this->nodeDataRepository->findByPath($siteNodePath);
foreach ($siteNodes as $siteNode) {
$this->nodeDataRepository->remove($siteNode);
}
$domainsForSite = $this->domainRepository->findBySite($site);
foreach ($domainsForSite as $domain) {
$this->domainRepository->remove($domain);
}
$this->siteRepository->remove($site);
$this->emitSitePruned($site);
}
示例3: removeContentDimensionsFromRootAndSitesNode
/**
* Remove dimensions on nodes "/" and "/sites"
*
* This empties the content dimensions on those nodes, so when traversing via the Node API from the root node,
* the nodes below "/sites" are always reachable.
*
* @param string $workspaceName
* @param boolean $dryRun
* @return void
*/
public function removeContentDimensionsFromRootAndSitesNode($workspaceName, $dryRun)
{
$workspace = $this->workspaceRepository->findByIdentifier($workspaceName);
$rootNodes = $this->nodeDataRepository->findByPath('/', $workspace);
$sitesNodes = $this->nodeDataRepository->findByPath('/sites', $workspace);
$this->output->outputLine('Checking for root and site nodes with content dimensions set ...');
/** @var \TYPO3\TYPO3CR\Domain\Model\NodeData $rootNode */
foreach ($rootNodes as $rootNode) {
if ($rootNode->getDimensionValues() !== []) {
if ($dryRun === false) {
$rootNode->setDimensions([]);
$this->nodeDataRepository->update($rootNode);
$this->output->outputLine('Removed content dimensions from root node');
} else {
$this->output->outputLine('Found root node with content dimensions set.');
}
}
}
/** @var \TYPO3\TYPO3CR\Domain\Model\NodeData $sitesNode */
foreach ($sitesNodes as $sitesNode) {
if ($sitesNode->getDimensionValues() !== []) {
if ($dryRun === false) {
$sitesNode->setDimensions([]);
$this->nodeDataRepository->update($sitesNode);
$this->output->outputLine('Removed content dimensions from node "/sites"');
} else {
$this->output->outputLine('Found node "/sites"');
}
}
}
}