-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'decendant-of-nodetype' of github.com:vcg-development/ne…
…os-development-collection into decendant-of-nodetype
- Loading branch information
Showing
138 changed files
with
12,503 additions
and
24,254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...ses/Security/Authorization/Privilege/Node/Doctrine/DescendantOfTypeConditionGenerator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
namespace Neos\ContentRepository\Security\Authorization\Privilege\Node\Doctrine; | ||
|
||
/* | ||
* This file is part of the Neos.ContentRepository package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
use Doctrine\Persistence\Mapping\ClassMetadata; | ||
use Doctrine\ORM\Query\Filter\SQLFilter as DoctrineSqlFilter; | ||
|
||
/** | ||
* A SQL generator to create a condition matching a node underneath a certain node type | ||
*/ | ||
class DescendantOfTypeConditionGenerator implements SqlGeneratorInterface | ||
{ | ||
private array $nodetypes; | ||
|
||
/** | ||
* @param array $nodetypes | ||
*/ | ||
public function __construct(array $nodetypes) | ||
{ | ||
$this->nodetypes = $nodetypes; | ||
} | ||
|
||
/** | ||
* Returns an SQL query part that matches all Nodes that are underneath one of the the given NodeType(s) | ||
* | ||
* @param DoctrineSqlFilter $sqlFilter | ||
* @param ClassMetadata $targetEntity | ||
* @param string $targetTableAlias | ||
* @return string | ||
*/ | ||
public function getSql(DoctrineSqlFilter $sqlFilter, ClassMetadata $targetEntity, $targetTableAlias) | ||
{ | ||
$nodetypeList = implode("','", $this->nodetypes); | ||
|
||
return "select * from public.neos_contentrepository_domain_model_nodedata n1 | ||
JOIN public.neos_contentrepository_domain_model_nodedata n2 ON n1.path LIKE CONCAT(n2.path, '%') | ||
WHERE n2.nodetype in ('" . $nodetypeList . "')"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.