Q
Q
Quber2016-07-06 05:25:10
symfony
Quber, 2016-07-06 05:25:10

Why doesn't embedded class work in Doctrine 2 and Symfony 2/3?

I'm trying to add an embedded class for an entity according to the documentation , but it doesn't work. Symphony cannot detect Embedded and Embeddable annotations.

<?php

/** @Entity */
class User
{
    /** @Embedded(class = "Address") */
    private $address;
}

/** @Embeddable */
class Address
{
    /** @Column(type = "string") */
    private $country;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MetaDone, 2016-07-06
@MetaDone

clear the doctrine metadata cache and try
console doctrine:cache:clear-metadata again - something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question