I am developing an application using Symfony2. The problem comes when trying to generate getters an setters for BalidatzeTaldea.php entity using sudo php app/console doctrine:generate:entities Anotatzailea/AnotatzaileaBundle
The code for the entity is the following:
<?php
namespace Anotatzailea\AnotatzaileaBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
*@ORM\Table(name="BalidatzeTaldea")
*@ORM\Entity
*/
class BalidatzeTaldea
{
/**
* @var integer $BalTalId
*
* @ORM\Column(name="BalTalId", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $BalTalId;
/**
* @ORM\OneToMany(targetEntity="Erabiltzailea", mappedBy="BalidatzeTaldea")
*/
protected $Erabiltzaileak;
/**
* @var integer $ErabGaitasuna
*
* @ORM\Column(name="ErabGaitasuna", type="integer")
*/
private $ErabGaitasuna;
public function __construct()
{
$this->Erabiltzaileak = new ArrayCollection();
}
}
Getters/Setters for other entities in the Entity folder are generated correctly. What can I do? Thanks.
I know this is old, but i just ran into this problem myself...
I had
/*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
And the setter/getter generation did not work. Changed it to
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
And it worked! The extra *
in the first line of the comment seems to change something. I also noticed it changed my IDE syntax highlighting.
From your code, it seems you had the two *
in the first comment line, but if someone else stumbles on this, i hope it helps.
Delete the cache directory --> "app/cache" and try again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With