Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixs from pull request comments

  • Loading branch information...
commit eab53d07d833174c65883588bd8f1d6fa5b904e0 1 parent 78d8c10
@JJK801 JJK801 authored
View
1  DependencyInjection/Configuration.php
@@ -377,6 +377,7 @@ private function getOrmEntityManagersNode()
return $v;
})
->end()
+ ->fixXmlConfig('parameter')
->children()
->scalarNode('class')->isRequired()->end()
->booleanNode('enabled')->defaultFalse()->end()
View
12 ManagerConfigurator.php
@@ -62,17 +62,18 @@ private function enableFilters(EntityManager $entityManager)
$filterCollection = $entityManager->getFilters();
foreach ($this->enabledFilters as $filter) {
- $oFilter = $filterCollection->enable($filter);
- if( null !== $oFilter ) {
- $this->setFilterParameters($filter, $oFilter);
+ $filterObject = $filterCollection->enable($filter);
+ if( null !== $filterObject ) {
+ $this->setFilterParameters($filter, $filterObject);
}
}
}
/**
- * Enable filters for an given entity manager
+ * Set defaults parameters for a given filter
*
- * @param EntityManager $entityManager
+ * @param string Filter name
+ * @param object Filter object
*
* @return null
*/
@@ -84,6 +85,5 @@ private function setFilterParameters($name, $filter)
$filter->setParameter($paramName, $paramValue);
}
}
- return $this;
}
}
View
8 Resources/config/schema/doctrine-1.0.xsd
@@ -173,19 +173,13 @@
<xsd:complexType name="filter" mixed="true">
<xsd:choice minOccurs="0">
- <xsd:element name="parameters" type="parameters" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="parameter" type="parameter" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="class" type="xsd:string" />
<xsd:attribute name="enabled" type="xsd:boolean" />
</xsd:complexType>
- <xsd:complexType name="parameters">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="parameter" type="parameter" minOccurs="0" maxOccurs="unbounded" />
- </xsd:choice>
- </xsd:complexType>
-
<xsd:complexType name="parameter">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
View
2  Tests/DependencyInjection/AbstractDoctrineExtensionTest.php
@@ -769,7 +769,7 @@ public function testAddFilter()
$this->assertDICDefinitionMethodCallCount($definition, 'addFilter', $args, 2);
$definition = $container->getDefinition('doctrine.orm.default_manager_configurator');
- $this->assertDICConstructorArguments($definition, array(array('soft_delete', 'myFilter'), array('myFilter' => array('myParameter' => 'myValue'))));
+ $this->assertDICConstructorArguments($definition, array(array('soft_delete', 'myFilter'), array('myFilter' => array('myParameter' => 'myValue', 'mySecondParameter' => 'mySecondValue'))));
// Let's create the instance to check the configurator work.
/** @var $entityManager \Doctrine\ORM\EntityManager */
View
5 Tests/DependencyInjection/Fixtures/config/xml/orm_filters.xml
@@ -14,9 +14,8 @@
<orm>
<filter name="soft_delete" enabled="true" >Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter</filter>
<filter name="myFilter" enabled="true" class="Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\TestFilter">
- <parameters>
- <parameter name="myParameter">myValue</parameter>
- </parameters>
+ <parameter name="myParameter">myValue</parameter>
+ <parameter name="mySecondParameter">mySecondValue</parameter>
</filter>
</orm>
</config>
View
1  Tests/DependencyInjection/Fixtures/config/yml/orm_filters.yml
@@ -15,3 +15,4 @@ doctrine:
enabled: true
parameters:
myParameter: myValue
+ mySecondParameter: mySecondValue
Please sign in to comment.
Something went wrong with that request. Please try again.