# Extending Lead entity giving "DoctrineORMMappingMappingException" error

**URL:** <https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8405>\
**Category:** Development\
**Created:** [May 3, 2017, 11:21am UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8405 "2017-05-03T11:21:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kumar2112](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Kumar2112](https://forum.mautic.org/u/Kumar2112)\
**Post date:** [May 3, 2017, 11:21am UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8405/1 "2017-05-03T11:21:05Z")

</div>

Hi i am creating a new plugin .thats why i need to extend the leadentity so i tried to extend the leadentity like this  
  
  
  
/\*\*

- Class Lead.  
  
\*/  
  
class Liaselead extends Lead  
  
{  
  
  
  
  
  
  
  
/\*\*  
- @var DateTime  
  
\*/  
  
  
  
private $pushedToLiase;  
  
  
  
/\*\*  
- @var  
  
\*  
  
\*/  
  
  
  
private $liase;  
  
  
  
/\*\*  
- Constructor.  
  
\*/  
  
  
  
  
  
public function \_\_construct(){  
  
if(is\_subclass\_of($this,‘MauticLeadBundleEntityLead’)){  
  
$parent=get\_parent\_class($this);  
  
$reflectionProperty = new ReflectionProperty($parent,‘id’);  
  
$reflectionProperty-\>setAccessible(true);  
  
}  
  
parent::\_\_construct();  
  
}  
  
  
  
/\*\*  
- @param ORMClassMetadata $metadata  
  
\*/  
  
  
  
public static function loadMetadata(ORMClassMetadata $metadata)  
  
{  
  
parent::loadMetadata($metadata);  
  
$builder-\>createField(‘pushedToLiase’, ‘datetime’)  
  
-\>columnName(‘pushed\_to\_liase’)  
  
-\>nullable()  
  
-\>build();  
  
}  
  
  
  
/\*\*  
- @param DateTime $date  
  
\*/  
  
public function setPushedToLiase($pushedtoliase){  
  
$this-\>pushedToLiase=$pushedtoliase;  
  
return this;  
  
}  
  
  
  
/\*\*  
- @return /DateTime pushed to liase  
  
\*/  
  
public function getPushedToLiase(){  
  
return $this-\>pushedToLiase;  
  
}  
  
  
  
/\*\*  
- @set MauticPluginMauticSendToLiaseBundleEntityLiase  
  
\*/  
  
public function setLiase(MauticPluginMauticSendToLiaseBundleEntityLiase $liase=null)  
  
{  
  
$this-\>liase = $liase;  
  
return $this;  
  
}  
  
  
  
/\*\*  
- @return MauticPluginMauticSendToLiaseBundleEntityLiase  
  
\*/  
  
public function getLiase()  
  
{  
  
return $this-\>liase;  
  
}  
  
}  
  
  
  
But when i run command app/console doctrine:schema:update --force it showin me this error  
  
  
  
[DoctrineORMMappingMappingException]  
  
Duplicate definition of column ‘id’ on entity ‘MauticPluginMauticSendToLiaseBundleEntityLiaselead’ in a field or discrimin  
  
ator column mapping.  
  
  
  
please help me how i can fix this issue.  
  
thanx in advance

---

<div class="post-metadata">

**Author:** ![Kumar2112](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Kumar2112](https://forum.mautic.org/u/Kumar2112)\
**Post date:** [May 3, 2017, 11:21am UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8405/2 "2017-05-03T11:21:05Z")

</div>

Hi i am creating a new plugin .thats why i need to extend the leadentity so i tried to extend the leadentity like this

/\*\*

- Class Lead.  
\*/  
class Liaselead extends Lead  
{

But when i run command app/console doctrine:schema:update --force it showin me this error

[DoctrineORMMappingMappingException]  
Duplicate definition of column ‘id’ on entity ‘MauticPluginMauticSendToLiaseBundleEntityLiaselead’ in a field or discrimin  
ator column mapping.

please help me how i can fix this issue.  
thanx in advance

---

<div class="post-metadata">

**Author:** ![Mautist](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mautist/32/1761_2.png) [@Mautist](https://forum.mautic.org/u/Mautist)\
**Post date:** [July 24, 2020, 9:24pm UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8405/3 "2020-07-24T21:24:42Z")

</div>

Did anyone found a solution for this?
