Can't create simple query for DB.
My Entity Givetask:
<?php
namespace RoSky\Bundle\GwsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* GivenTask
*/
class GivenTask
{
/**
* @var integer
*/
private $id;
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $squad;
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $task;
/**
* Constructor
*/
public function __construct()
{
$this->squad = new \Doctrine\Common\Collections\ArrayCollection();
$this->task = new \Doctrine\Common\Collections\ArrayCollection();
}
...GETTER SETTERS
My Entity Squad:
<?php
namespace RoSky\Bundle\GwsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Squad
*/
class Squad
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $name;
.....GETTERS SETTERS
My .yaml config GivenTask Entity:
RoSky\Bundle\GwsBundle\Entity\GivenTask:
type: entity
fields:
id:
id: true
type: integer
generator:
strategy: AUTO
manyToMany:
squad:
targetEntity: Squad
joinTable:
name: SquadToGivenTask
joinColumns:
given_task_id:
referencedColumnName: id
nullable: false
inverseJoinColumns:
squad_id:
referencedColumnName: id
nullable: false
task:
targetEntity: Task
joinTable:
name: TaskToGivenTask
joinColumns:
given_task_id:
referencedColumnName: id
nullable: false
inverseJoinColumns:
task_id:
referencedColumnName: id
nullable: false
lifecycleCallbacks: { }
My .yaml config Squad Entity:
RoSky\Bundle\GwsBundle\Entity\Squad:
type: entity
fields:
id:
id: true
type: integer
generator:
strategy: AUTO
name:
type: string
length: 100
nullable: false
lifecycleCallbacks: { }
Now i trying to make a Query...
$test = $this->em->getRepository('RoSkyGwsBundle:GivenTask')->findBySquad(4);
And... I got Doctrine Exception:
ContextErrorException: Notice: Undefined index: joinColumns in /home/DEA7H/Documents/Server/GraphWebSystem/www/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1665
WHAT IS THIS? =)
Details:
Symfony: 2.4
Doctrine: 2.2.3
ORDBMS: PostgreSQL 9.2
Thanks in Advance.
php app/console doctrine:schema:validate
– Kal Zekdor