Skip to content

Instantly share code, notes, and snippets.

@rodrigodiez
Created October 22, 2013 15:33
Show Gist options
  • Save rodrigodiez/7102847 to your computer and use it in GitHub Desktop.
Save rodrigodiez/7102847 to your computer and use it in GitHub Desktop.
FooNamespace\FooClass:
FooNamespace\BarClass:
setting1: value
setting2: value
<?php
class FooService
{
protected $container;
public function __construct(Symfony\Component\DependencyInjection\Container $container)
{
$this->container = $container;
}
public function createFooObject(\stdClass $obj1)
{
$config = $this->container->getParameter('foo_service.config');
if(!is_array($config) || !array_key_exists(get_class($obj1), $config)){
throw new \Exception('Config for class ' . get_class($obj1) . ' not found');
}
}
}
@rodrigodiez
Copy link
Author

You rocks! Thanks for show me the way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment