Crear entidad especial con annotation - Symfony2
namespace Cupon\OfertaBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** @ORM\Entity */ class Venta { ... /** * @ORM\Id * @ORM\ManyToOne(targetEntity="Cupon\OfertaBundle\Entity\Oferta") */ protected $oferta; /** * @ORM\Id * @ORM\ManyToOne(targetEntity="Cupon\UsuarioBundle\Entity\Usuario") */ protected $usuario; ... public function setOferta(\Cupon\OfertaBundle\Entity\Oferta $oferta) { $this-> oferta = $oferta; } ... }
Comentarios
Publicar un comentario