# Extending Lead entity giving "DoctrineORMMappingMappingException" error

**URL:** <https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8410>\
**Category:** Development\
**Created:** [May 3, 2017, 12:14pm UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8410 "2017-05-03T12:14:37Z")\
**Posts on this page:** 2\
**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, 12:14pm UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8410/1 "2017-05-03T12:14:37Z")

</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, 12:14pm UTC](https://forum.mautic.org/t/extending-lead-entity-giving-doctrineormmappingmappingexception-error/8410/2 "2017-05-03T12:14:37Z")

</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
