I have an entity in \vendor
folder, that I cannot change/touch, but when I use it in project, I need to add one more parameter to that object (description
).
So I have code:
namespace SoftNation\Sylius\MyExtendBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use SoftNation\Sylius\ExtendBundle\Entity\ExtendTranslation;
/**
* @ORM\Table(name="softnation_sylius_extend_translation")
*/
class MyExtendTranslation extends ExtendTranslation
{
/**
* @ORM\Column(type="text")
*/
protected $description;
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}
}
now when I try:
bin/console doctrine:migrations:diff
I get next error:
[Doctrine\DBAL\Schema\SchemaException]
The table with name
'shop_beta_dev.softnation_sylius_extend_translation' already exists.
All I want is that I can do:
$extend = new ExtendTranslation;
$extend->setDescription('StackOverflowRocks');