I have a problem with Symfony2 (beta1). I use FixtureLoader.php. When I try 
to generate a new instance of  one of my entities i get the error Message 
"Entity {myEntity} is missing an assigned ID ". The entity has an ID as the 
other entities that I use. All other istances work without problems. The 
entity contains links two entities ('Book' and 'Tag') in a many-to-many 
association. Entity was generated by Symfony based on the metadata.
The code generating theerror- message from fixturloader is simply "$bt=new 
BookTag();" The entitie's code is listed below.

Any suggestions as to what  could be the problem?



<?php

namespace Company\MedBooksBundle\Entity;

/**
 * Company\MedBooksBundle\Entity\BookTag
 *
 * @orm:Table(name="book_tag")
 * @orm:Entity
 */

class BookTag
{
       /**
     * @var integer $id
     *
     * @orm:Column(name="id", type="integer", nullable=false)
     * @orm:Id
     * @orm:GeneratedValue(strategy="IDENTITY")
     */
    
    
    private $id;


    /**
     * @var integer $tagId
     *
     * @orm:Column(name="tag_id", type="integer", nullable=false)
     * @orm:Id
     * @orm:GeneratedValue(strategy="NONE")
     */
    private $tagId;

    /**
     * @var integer $bookId
     *
     * @orm:Column(name="book_id", type="integer", nullable=false)
     * @orm:Id
     * @orm:GeneratedValue(strategy="NONE")
     */
    private $bookId;

    /**
     * @var Tag
     *
     * @orm:ManyToOne(targetEntity="Tag")
     * @orm:JoinColumns({
     *   @orm:JoinColumn(name="tag_id", referencedColumnName="id")
     * })
     */
    private $tag;

    /**
     * @var Book
     *
     * @orm:ManyToOne(targetEntity="Book")
     * @orm:JoinColumns({
     *   @orm:JoinColumn(name="book_id", referencedColumnName="id")
     * })
     */
    private $book;



    /**
     * Set id
     *
     * @param integer $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * Get id
     *
     * @return integer $id
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set tagId
     *
     * @param integer $tagId
     */
    public function setTagId($tagId)
    {
        $this->tagId = $tagId;
    }

    /**
     * Get tagId
     *
     * @return integer $tagId
     */
    public function getTagId()
    {
        return $this->tagId;
    }

    /**
     * Set bookId
     *
     * @param integer $bookId
     */
    public function setBookId($bookId)
    {
        $this->bookId = $bookId;
    }

    /**
     * Get bookId
     *
     * @return integer $bookId
     */
    public function getBookId()
    {
        return $this->bookId;
    }

    /**
     * Set tag
     *
     * @param Company\MedBooksBundle\Entity\Tag $tag
     */
    public function setTag(\Company\MedBooksBundle\Entity\Tag $tag)
    {
        $this->tag = $tag;
    }

    /**
     * Get tag
     *
     * @return Company\MedBooksBundle\Entity\Tag $tag
     */
    public function getTag()
    {
        return $this->tag;
    }

    /**
     * Set book
     *
     * @param Company\MedBooksBundle\Entity\Book $book
     */
    public function setBook(\Company\MedBooksBundle\Entity\Book $book)
    {
        $this->book = $book;
    }

    /**
     * Get book
     *
     * @return Company\MedBooksBundle\Entity\Book $book
     */
    public function getBook()
    {
        return $this->book;
    }



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to