Código PHP:
<?php
namespace CBGAppBundleEntity;
use DoctrineORMMapping as ORM;
use CBGUserBundleEntityUser;
/**
* Producto
*
* @ORM\Table(name="producto")
* @ORM\Entity
*/
class Producto
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="nombre", type="string", length=255)
*/
private $nombre;
/**
* @var string
*
* @ORM\Column(name="tipo", type="string", length=255)
*/
private $tipo;
/**
* @var float
*
* @ORM\Column(name="precio", type="float")
*/
private $precio;
/**
* @ORM\ManyToOne(targetEntity="User")
*/
private $owner;
///Getters y setters...
Código PHP:
<?php
namespace CBGUserBundleEntity;
use FOSUserBundleEntityUser as BaseUser;
use DoctrineORMMapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="host_user")
*/
class User extends BaseUser {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function __construct() {
parent::__construct();
}
}
Código:
Symfony > doctrine:schema:update --dump-sql [Doctrine\ORM\Mapping\MappingException] The target-entity CBG\AppBundle\Entity\User cannot be found in 'CBG\AppBundle\Entity\Producto#owner'. doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]] The command terminated with an error status (1)