php driver
This commit is contained in:
parent
415c2a95f2
commit
7021f002f2
@ -758,10 +758,6 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
*/
|
||||
public function testEntityListeners()
|
||||
{
|
||||
if ($this instanceof PHPMappingDriverTest) {
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
$em = $this->_getTestEntityManager();
|
||||
$factory = $this->createClassMetadataFactory($em);
|
||||
$superClass = $factory->getMetadataFor('Doctrine\Tests\Models\Company\CompanyContract');
|
||||
@ -816,10 +812,6 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
*/
|
||||
public function testCallEntityListeners()
|
||||
{
|
||||
if ($this instanceof PHPMappingDriverTest) {
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
$em = $this->_getTestEntityManager();
|
||||
$factory = $this->createClassMetadataFactory($em);
|
||||
$flexClass = $factory->getMetadataFor('Doctrine\Tests\Models\Company\CompanyFixContract');
|
||||
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
|
||||
$metadata->setInheritanceType(\Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_JOINED);
|
||||
$metadata->setTableName( 'company_contracts');
|
||||
$metadata->setDiscriminatorColumn(array(
|
||||
'name' => 'discr',
|
||||
'type' => 'string',
|
||||
));
|
||||
|
||||
$metadata->mapField(array(
|
||||
'id' => true,
|
||||
'name' => 'id',
|
||||
'fieldName' => 'id',
|
||||
));
|
||||
|
||||
$metadata->mapField(array(
|
||||
'type' => 'boolean',
|
||||
'name' => 'completed',
|
||||
'fieldName' => 'completed',
|
||||
));
|
||||
|
||||
$metadata->setDiscriminatorMap(array(
|
||||
"fix" => "CompanyFixContract",
|
||||
"flexible" => "CompanyFlexContract",
|
||||
"flexultra" => "CompanyFlexUltraContract"
|
||||
));
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'ContractSubscriber', 'postPersistHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'ContractSubscriber', 'prePersistHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'ContractSubscriber', 'postUpdateHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'ContractSubscriber', 'preUpdateHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'ContractSubscriber', 'postRemoveHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'ContractSubscriber', 'preRemoveHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'ContractSubscriber', 'preFlushHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'ContractSubscriber', 'postLoadHandler');
|
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$metadata->mapField(array(
|
||||
'type' => 'integer',
|
||||
'name' => 'fixPrice',
|
||||
'fieldName' => 'fixPrice',
|
||||
));
|
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$metadata->mapField(array(
|
||||
'type' => 'integer',
|
||||
'name' => 'hoursWorked',
|
||||
'fieldName' => 'hoursWorked',
|
||||
));
|
||||
|
||||
$metadata->mapField(array(
|
||||
'type' => 'integer',
|
||||
'name' => 'pricePerHour',
|
||||
'fieldName' => 'pricePerHour',
|
||||
));
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
$metadata->mapField(array(
|
||||
'type' => 'integer',
|
||||
'name' => 'maxPrice',
|
||||
'fieldName' => 'maxPrice',
|
||||
));
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'ContractSubscriber', 'postPersistHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'ContractSubscriber', 'prePersistHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'ContractSubscriber', 'postUpdateHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'ContractSubscriber', 'preUpdateHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'ContractSubscriber', 'postRemoveHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'ContractSubscriber', 'preRemoveHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'ContractSubscriber', 'preFlushHandler');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'ContractSubscriber', 'postLoadHandler');
|
||||
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'FlexUltraContractSubscriber', 'prePersistHandler1');
|
||||
$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'FlexUltraContractSubscriber', 'prePersistHandler2');
|
Loading…
Reference in New Issue
Block a user