這是如何定義CountryTranslation:
<?php
namespace Minn\AdsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
/**
* @ORM\Entity
* @ORM\Table(
* uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
* "locale", "object_id", "field"
* })}
*)
*/
class CountryTranslation extends AbstractPersonalTranslation {
/*
* Convenient constructor
*
* @param string $locale
* @param string $field
* @param string $value
*/
/*public function __construct($locale, $field, $value) {
$this->setLocale($locale);
$this->setField($field);
$this->setContent($value);
}*/
public function __construct() {
/*this must be an empty one!*/
}
/**
* @ORM\ManyToOne(targetEntity="Country", inversedBy="translations")
* @ORM\JoinColumn(name="object_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $object;
}
給我們您的實體CountryTranslation的declation。 –
如果你看看創建的實體,你能告訴我們'$ id'的類型是什麼嗎? – Javad