partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit dfe4b5a5360ee591aba0de6fe927ca93be1a9832
parent 2d7a112110119901abec0eada43dd5bc6488eec9
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue, 26 May 2015 18:02:56 +0200

This bundle extends the FOSRestBundle so that it can read annotations of the parent class. That way, PartKeepr can
have one superclass with commonly used parameters (like start and limit for pagination) without the need of re-defining
common parameters for each child class.

The current limitation is that it currently only works for direct descendants and not for the whole class hierarchy.

Diffstat:
Asrc/PartKeepr/RESTBundle/DependencyInjection/PartKeeprRESTExtension.php | 25+++++++++++++++++++++++++
Asrc/PartKeepr/RESTBundle/PartKeeprRESTBundle.php | 13+++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/RESTBundle/DependencyInjection/PartKeeprRESTExtension.php b/src/PartKeepr/RESTBundle/DependencyInjection/PartKeeprRESTExtension.php @@ -0,0 +1,25 @@ +<?php + +namespace PartKeepr\RESTBundle\DependencyInjection; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Loader; + +/** + * This is the class that loads and manages your bundle configuration + * + * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} + */ +class PartKeeprRESTExtension extends Extension +{ + /** + * {@inheritdoc} + */ + public function load(array $configs, ContainerBuilder $container) + { + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('request.xml'); + } +} diff --git a/src/PartKeepr/RESTBundle/PartKeeprRESTBundle.php b/src/PartKeepr/RESTBundle/PartKeeprRESTBundle.php @@ -0,0 +1,13 @@ +<?php + +namespace PartKeepr\RESTBundle; + +use Symfony\Component\HttpKernel\Bundle\Bundle; + +class PartKeeprRESTBundle extends Bundle +{ + public function getParent() + { + return 'FOSRestBundle'; + } +}