yaml driver
This commit is contained in:
parent
917aa70c97
commit
f0b04375de
@ -572,6 +572,17 @@ class YamlDriver extends FileDriver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Evaluate entityListeners
|
||||
if (isset($element['entityListeners'])) {
|
||||
foreach ($element['entityListeners'] as $className => $entityListener) {
|
||||
foreach ($entityListener as $eventName => $callbackElement){
|
||||
foreach ($callbackElement as $methodName){
|
||||
$metadata->addEntityListener($eventName, $className, $methodName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -759,7 +759,8 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
public function testEntityListeners()
|
||||
{
|
||||
if ( ! ($this instanceof AnnotationDriverTest)
|
||||
&& ! ($this instanceof XmlMappingDriverTest)) {
|
||||
&& ! ($this instanceof XmlMappingDriverTest)
|
||||
&& ! ($this instanceof YamlMappingDriverTest)) {
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
@ -818,7 +819,8 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
public function testCallEntityListeners()
|
||||
{
|
||||
if ( ! ($this instanceof AnnotationDriverTest)
|
||||
&& ! ($this instanceof XmlMappingDriverTest)) {
|
||||
&& ! ($this instanceof XmlMappingDriverTest)
|
||||
&& ! ($this instanceof YamlMappingDriverTest)) {
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
<post-persist method="postPersistHandler"/>
|
||||
<pre-persist method="prePersistHandler"/>
|
||||
|
||||
<post-update method="postPersistHandler"/>
|
||||
<post-update method="postUpdateHandler"/>
|
||||
<pre-update method="preUpdateHandler"/>
|
||||
|
||||
<post-remove method="postRemoveHandler"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<post-persist method="postPersistHandler"/>
|
||||
<pre-persist method="prePersistHandler"/>
|
||||
|
||||
<post-update method="postPersistHandler"/>
|
||||
<post-update method="postUpdateHandler"/>
|
||||
<pre-update method="preUpdateHandler"/>
|
||||
|
||||
<post-remove method="postRemoveHandler"/>
|
||||
|
@ -0,0 +1,30 @@
|
||||
Doctrine\Tests\Models\Company\CompanyContract:
|
||||
type: entity
|
||||
table: company_contracts
|
||||
inheritanceType: SINGLE_TABLE
|
||||
discriminatorMap:
|
||||
fix: CompanyFixContract
|
||||
flexible: CompanyFlexContract
|
||||
flexultra: CompanyFlexUltraContract
|
||||
entityListeners:
|
||||
ContractSubscriber:
|
||||
preFlush: [preFlushHandler]
|
||||
postLoad: [postLoadHandler]
|
||||
|
||||
postPersist: [postPersistHandler]
|
||||
prePersist: [prePersistHandler]
|
||||
|
||||
postUpdate: [postUpdateHandler]
|
||||
preUpdate: [preUpdateHandler]
|
||||
|
||||
postRemove: [postRemoveHandler]
|
||||
preRemove: [preRemoveHandler]
|
||||
|
||||
id:
|
||||
id:
|
||||
type: integer
|
||||
generator:
|
||||
strategy: AUTO
|
||||
fields:
|
||||
completed:
|
||||
type: boolean
|
@ -0,0 +1,5 @@
|
||||
Doctrine\Tests\Models\Company\CompanyFixContract:
|
||||
type: entity
|
||||
fields:
|
||||
fixPrice:
|
||||
type: integer
|
@ -0,0 +1,7 @@
|
||||
Doctrine\Tests\Models\Company\CompanyFlexContract:
|
||||
type: entity
|
||||
fields:
|
||||
hoursWorked:
|
||||
type: integer
|
||||
pricePerHour:
|
||||
type: integer
|
@ -0,0 +1,22 @@
|
||||
Doctrine\Tests\Models\Company\CompanyFlexUltraContract:
|
||||
type: entity
|
||||
entityListeners:
|
||||
ContractSubscriber:
|
||||
preFlush: [preFlushHandler]
|
||||
postLoad: [postLoadHandler]
|
||||
|
||||
postPersist: [postPersistHandler]
|
||||
prePersist: [prePersistHandler]
|
||||
|
||||
postUpdate: [postUpdateHandler]
|
||||
preUpdate: [preUpdateHandler]
|
||||
|
||||
postRemove: [postRemoveHandler]
|
||||
preRemove: [preRemoveHandler]
|
||||
|
||||
FlexUltraContractSubscriber:
|
||||
prePersist: [prePersistHandler1, prePersistHandler2]
|
||||
|
||||
fields:
|
||||
maxPrice:
|
||||
type: integer
|
Loading…
x
Reference in New Issue
Block a user