sonata-project/SonataDoctrineORMAdminBundle — pull request #194 by ClementGautier (2013-03-27 16:26:45+00:00)
Title: Fixed OneToOne associations

I had an issue with OneToOne associaiton when the field name is different than the attribute name.

First class:

```php
class SpecialArticle
{
/**
* @ORM\Id
* @ORM\OneToOne(targetEntity="Article", inversedBy="specialArticle", cascade={"persist", "remove"})
* @ORM\JoinColumn(name="id", referencedColumnName="id")
*/
private $article;
}
``̀`
Second class:
``̀`php
classArticle
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

/**
* @ORM\OneToOne(targetEntity="ETS\CatalogBundle\Entity\SpecialArticle", mappedBy="article", cascade={"remove"})
*/
private $specialArticle;
}
``̀`

Note: I'm not using entity inheritance, I'm using composition pattern instead.