Removes a method to call after service initialization.
public removeMethodCall ( string $method ) : |
||
$method | string | The method name to remove |
Résultat | The current instance |
/** * @param Definition $definition */ private function clearMethodCalls(Definition $definition) { $methodCall = 'offsetSet'; while ($definition->hasMethodCall($methodCall)) { $definition->removeMethodCall($methodCall); } }
/** * Loads an ODM document managers bundle mapping information. * * There are two distinct configuration possibilities for mapping information: * * 1. Specify a bundle and optionally details where the entity and mapping information reside. * 2. Specify an arbitrary mapping location. * * @example * * doctrine.orm: * mappings: * MyBundle1: ~ * MyBundle2: yml * MyBundle3: { type: annotation, dir: Documents/ } * MyBundle4: { type: xml, dir: Resources/config/doctrine/mapping } * MyBundle5: * type: yml * dir: [bundle-mappings1/, bundle-mappings2/] * alias: BundleAlias * arbitrary_key: * type: xml * dir: %kernel.dir%/../src/vendor/DoctrineExtensions/lib/DoctrineExtensions/Documents * prefix: DoctrineExtensions\Documents\ * alias: DExt * * In the case of bundles everything is really optional (which leads to autodetection for this bundle) but * in the mappings key everything except alias is a required argument. * * @param array $documentManager A configured ODM entity manager. * @param Definition A Definition instance * @param ContainerBuilder $container A ContainerBuilder instance */ protected function loadDocumentManagerBundlesMappingInformation(array $documentManager, Definition $odmConfigDef, ContainerBuilder $container) { // reset state of drivers and alias map. They are only used by this methods and children. $this->drivers = array(); $this->aliasMap = array(); $this->loadMappingInformation($documentManager, $container); $this->registerMappingDrivers($documentManager, $container); if ($odmConfigDef->hasMethodCall('setDocumentNamespaces')) { // TODO: Can we make a method out of it on Definition? replaceMethodArguments() or something. $calls = $odmConfigDef->getMethodCalls(); foreach ($calls as $call) { if ($call[0] == 'setDocumentNamespaces') { $this->aliasMap = array_merge($call[1][0], $this->aliasMap); } } $method = $odmConfigDef->removeMethodCall('setDocumentNamespaces'); } $odmConfigDef->addMethodCall('setDocumentNamespaces', array($this->aliasMap)); }
/** * Remove a method to call after service initialization. * * @param string $method The method name to remove * * @return tubepress_api_ioc_DefinitionInterface The current instance * * @api * @since 4.0.0 */ public function removeMethodCall($method) { $this->_underlyingSymfonyDefinition->removeMethodCall($method); return $this; }
/** * @param array $bootstrapProfileConfig * @param string $key * @param Definition $bootstrapProfileDefinition * @param string $method */ private static function processBootstrapProfileConfigurationScalarReplacementElement(array $bootstrapProfileConfig, $key, Definition $bootstrapProfileDefinition, $method) { if (isset($bootstrapProfileConfig[$key])) { $bootstrapProfileDefinition->removeMethodCall($method); $bootstrapProfileDefinition->addMethodCall($method, [$bootstrapProfileConfig[$key]]); } }