Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-25613: Add a way to register resources with the rest root (#1619)
- Loading branch information
Showing
12 changed files
with
1,322 additions
and
953 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
eZ/Bundle/EzPublishRestBundle/DependencyInjection/Configuration.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,38 @@ | ||
<?php | ||
/** | ||
* This file is part of the eZ Publish Kernel package. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Bundle\EzPublishRestBundle\DependencyInjection; | ||
|
||
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Configuration as SiteAccessConfiguration; | ||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
|
||
class Configuration extends SiteAccessConfiguration | ||
{ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder(); | ||
$rootNode = $treeBuilder->root('ez_publish_rest'); | ||
|
||
$this->addRestRootResourcesSection($rootNode); | ||
|
||
return $treeBuilder; | ||
} | ||
|
||
public function addRestRootResourcesSection($rootNode) | ||
{ | ||
$systemNode = $this->generateScopeBaseNode($rootNode); | ||
$systemNode | ||
->arrayNode('rest_root_resources') | ||
->prototype('array') | ||
->children() | ||
->scalarNode('mediaType')->isRequired()->end() | ||
->scalarNode('href')->isRequired()->end() | ||
->end() | ||
->end() | ||
->end(); | ||
} | ||
} |
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.