Skip to content

Instantly share code, notes, and snippets.

@matej21
Created March 27, 2014 13:38
Show Gist options
  • Save matej21/9807723 to your computer and use it in GitHub Desktop.
Save matej21/9807723 to your computer and use it in GitHub Desktop.
<?php
public function beforeCompile()
{
$builder = $this->getContainerBuilder();
$targetServiceDef = $builder->getDefinition($this->prefix('serviceName'));
foreach ($builder->findByTag('myTag') as $name => $attrs) {
$def = $builder->getDefinition($name);
$targetServideDef->addSetup('addFoo', array($def));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment