1

I am having two entities A and B. Let's say entity A has a primary key 'foo' and the entity B has a variable named 'bar'. I am trying to establish the "Many to one" association between these two. And when i run "update schema" command on my terminal, it is giving me this result:

"Nothing to update - your database is already in sync with the current entity metadata."

here's the code:

class A
{
    /**
    * @var int
    * @ORM\Column(name="foo", type="integer")
    * @ORM\Id
    * @ORM\GeneratedValue(strategy="AUTO")
    * @ORM\ManyToOne(targetEntity="B", inversedBy="bar")
    */
    private $foo;
}

and

class B
{
     /**
     * @var int
     * @ORM\Column(name="bar", type="integer")
     * @ORM\OneToMany(targetEntity="A", mappedBy="foo")
     */
     private $bar;
}
Matteo
  • 37,680
  • 11
  • 100
  • 115
Kavya Rao
  • 11
  • 1
  • 2

1 Answers1

0

I think the * @ORM\Entity is missing

  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the questioner. – Mohammad Akbari Mar 23 '17 at 19:55