Skip to content

Commit

Permalink
Allow Page entity class to be overridden.
Browse files Browse the repository at this point in the history
  • Loading branch information
dankempster committed Mar 25, 2015
1 parent 94740ad commit 2620313
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 17 deletions.
1 change: 1 addition & 0 deletions .idea/axstrad-page-bundle.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions .idea/webResources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class DefaultController extends Controller
{
/**
* @ParamConverter("page")
* @ParamConverter("page", class="%axstrad_page.entity.page.class%")
* @SeoPageData
*/
public function indexAction(Page $page)
Expand Down
4 changes: 3 additions & 1 deletion DependencyInjection/AxstradPageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');

if ($config['admin_enabled'] &&
array_key_exists('SonataAdminBundle', $container->getParameter('kernel.bundles'))
) {
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('admin.yml');
}
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- { name: sonata.admin, manager_type: orm, group: "Content", label: "Page" }
arguments:
- ~
- Axstrad\Bundle\PageBundle\Entity\Page
- %axstrad_page.entity.page.class%
- ~
calls:
- [ setTranslationDomain, [AxstradPageBundle]]
Expand Down
2 changes: 2 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
axstrad_page.entity.page.class: Axstrad\Bundle\PageBundle\Entity\Page
1 change: 1 addition & 0 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ $bundles = array(
// requires
new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new \Axstrad\Bundle\DoctrineExtensionsBundle\AxstradDoctrineExtensionsBundle(),
new \Axstrad\Bundle\ExtraFrameworkBundle\AxstradExtraFrameworkBundle(),
new \Sonata\SeoBundle\SonataSeoBundle(),
new \Symfony\Cmf\Bundle\SeoBundle\CmfSeoBundle(),
new \Axstrad\Bundle\SeoBundle\AxstradSeoBundle(),
Expand Down
1 change: 1 addition & 0 deletions Tests/Functional/TestAdmin/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function registerBundles()
// AxstradPageBundle and it's dependencies
new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new \Axstrad\Bundle\DoctrineExtensionsBundle\AxstradDoctrineExtensionsBundle(),
new \Axstrad\Bundle\ExtraFrameworkBundle\AxstradExtraFrameworkBundle(),
new \Sonata\SeoBundle\SonataSeoBundle(),
new \Symfony\Cmf\Bundle\SeoBundle\CmfSeoBundle(),
new \Burgov\Bundle\KeyValueFormBundle\BurgovKeyValueFormBundle(),
Expand Down
1 change: 1 addition & 0 deletions Tests/Functional/TestPage/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function registerBundles()
// Axstrad Bundles
new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new \Axstrad\Bundle\DoctrineExtensionsBundle\AxstradDoctrineExtensionsBundle(),
new \Axstrad\Bundle\ExtraFrameworkBundle\AxstradExtraFrameworkBundle(),
new \Axstrad\Bundle\PageBundle\AxstradPageBundle(),
new \Axstrad\Bundle\PageBundle\Tests\Functional\TestPage\AxstradTestPageBundle(),
);
Expand Down
1 change: 1 addition & 0 deletions Tests/Functional/TestPageExtension/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function registerBundles()
// Axstrad Bundles
new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new \Axstrad\Bundle\DoctrineExtensionsBundle\AxstradDoctrineExtensionsBundle(),
new \Axstrad\Bundle\ExtraFrameworkBundle\AxstradExtraFrameworkBundle(),
new \Axstrad\Bundle\PageBundle\AxstradPageBundle(),
new \Axstrad\Bundle\PageBundle\Tests\Functional\TestPageExtension\AxstradTestPageExtensionBundle(),
);
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"axstrad/content": "0.4.x-dev",
"axstrad/doctrine-extensions-bundle": ">=0.2.x-dev",
"axstrad/doctrine-extensions": "0.2.*",
"axstrad/extra-framework-bundle": "dev-develop@dev",
"axstrad/seo-bundle": ">=0.1.x-dev",
"doctrine/orm": "~2.3",
"doctrine/doctrine-bundle": "~1.2",
Expand Down

0 comments on commit 2620313

Please sign in to comment.