I had to update my Symfony version from 4.2 to 4.4 therefore updating the DoctrineBehaviors bundle too.
$this->getId();$this->getTranslatable()->getId()
I'm getting Attempted to call an undefined method named "getId".
It existed in the 1.6 version in trait TranslationMethods
<?php
namespace App\Entity;
use App\Entity\Traits\AuthorableTrait;
use App\Entity\Traits\GedmoTrait;
use App\Entity\Traits\SeoTrait;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
use Symfony\Component\Serializer\Normalizer\NormalizableInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* @ORM\Entity(repositoryClass="App\Repository\ProfessionRepository")
* @ORM\Table(name="profession_translation")
* @ORM\HasLifecycleCallbacks
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
*/
class ProfessionTranslation implements NormalizableInterface, TranslationInterface
{
use TranslationTrait;
use SeoTrait;
use GedmoTrait;
use AuthorableTrait;
/**
* Id.
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
I had to update my Symfony version from 4.2 to 4.4 therefore updating the DoctrineBehaviors bundle too.
$this->getId();
$this->getTranslatable()->getId()
I'm getting Attempted to call an undefined method named "getId".
It existed in the 1.6 version in trait TranslationMethods