That's actually how the functionality was designed, I don't see why you'd want to remove the prefix...
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 26 August 2014 16:56, <[email protected]> wrote: > Hello, > > I'm having a bit of trouble implementing Embeddables. I exposed the > problem on SO > <http://stackoverflow.com/questions/25502930/doctrine-wont-fetch-embedded-field>, > which I'm pasting here. > > <?php namespace Blah; > > use Doctrine\ORM\Mapping as ORM; > > /** > * @ORM\Entity > * @ORM\Table(name="test") > */ > class Test { > > /** > * @ORM\Id > * @ORM\GeneratedValue > * @ORM\Column(type="integer") > * @var integer > */ > private $id; > > /** > * @ORM\Embedded(class="Name") > * @var Name > */ > private $name; > > public function __construct(Name $name) > { > $this->name = $name; > } > > public function getId() > { > return $this->id; > } > > /** > * @return Name > */ > public function getName() > { > return $this->name; > } > > } > > /** > * @ORM\Embeddable > */ > class Name { > > /** > * @ORM\Column(type="string") > */ > private $value; > > public function __construct($value) > { > $this->value = $value; > } > > public function __toString() > { > return $this->value; > } > > } > > What I want is to input a Name type object into Test, have in persisted in > the database as a string. When I retrieve the entity, I want name to be of > type Name, not string. > > Seeing the query logs, Doctrine is trying to insert/fetch the column > strangely named as *name_value* instead of *name*. > > I tried using > @ORM\Column(type="string") > > in the entity in the name property, and it kind of works. But instead of a > Name type, I get a string when Doctrine fetches the entity. > > I also tried setting > @ORM\Column(type="string", name="name") > > in the value object, value property, only to have Doctrine name the field > as *name_name* instead of *name_value*. > > The database schema was created manually. > I'm using Laravel and Doctrine using mitchellvanw/laravel-doctrine. > > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
