Ошибка, когда targetEntity находится в другом пакете

Я получаю следующую ошибку при попытке сделать./app/console doctrine:migrate:diff:

 [Doctrine\ORM\Mapping\MappingException]                                        
  Class VNN\CoreBundle\Entity\Game is not a valid entity or mapped super class. 

Вот строка, которая ее вызывает:

/**
 * @ORM\ManyToOne(targetEntity="VNN\CoreBundle\Entity\Game")

Вот соответствующая часть моего класса:

Что Я понимаю, что речь идет не о том, что невозможно найтиVNN\CoreBundle\Entity\Game, а о том, что Gameне является допустимым объектом. Так вотGame.php:

id;
    }

    public function getHomeSchool()
    {
        if ($this->homeSchoolId > 0) {
            return $this->homeSchool;
        } else {
            return FALSE;
        }
    }

    public function getAwaySchool()
    {
        if ($this->awaySchoolId > 0) {
            return $this->awaySchool;
        } else {
            return FALSE;
        }
    }

    public function recordIsValid()
    {
        if (!($this->homeSchoolId > 0)) {
            return FALSE;
        }

        if (!($this->awaySchoolId > 0)) {
            return FALSE;
        }

        return TRUE;
    }

    public function getSport()
    {
        return $this->sport;
    }

    public function getHumanDatetime()
    {
        $date = new \DateTime($this->datetime);
        return $date->format('F d, Y g:ia');
    }

    public function getDatetime()
    {
        $date = new \DateTime($this->datetime);
        return $date->format('m/d/Y g:i:s a');
    }

    public function getOpposingSchoolWithRespectToSchoolName($schoolName)
    {
        if ($schoolName == $this->getHomeSchool()->getName()) {
            return $this->getAwaySchool();
        } else {
            return $this->getHomeSchool();
        }
    }

    public function getHomeScore()
    {
        return $this->homeScore;
    }

    public function getAwayScore()
    {
        return $this->awayScore;
    }
}

А почему бы и не Game?

Обновление :У меня снова возникла точно такая же проблема, когда я попытался сделать то же самое с другим перекрестным -объектом пакета. Я нашел этот пост , но добавление -исправление -ведущей -косой черты не помогло мне, как это, очевидно, сделало для ОП.

7
задан Community 23 May 2017 в 12:31
поделиться