This is some weird behaviour I witnessed today and I wonder why.. I`ll get straight to the point:
So we are using a2lix translations with symfony and fos elasticabundle
class Class
{
use Translatable;
}
class ClassTranslation implements \A2lix\I18nDoctrineBundle\Doctrine\Interfaces\OneLocaleInterface
{
use Translation;
}
In this scenario once I run
php app/console fos:elastica:populate
I`m getting:
[InvalidArgumentException] Parameter 'locale' does not exist.
But the parameter is actually in the trait(from the vendor that include 2 traits translatable methods and translatable properties)
The questions is why does this happen. We have the property from the trait yet once we run the command it does not find it.
Ok now here comes the strange part!
In this scenario everything works as expected:
class Class
{
use Translatable;
}
class ClassTranslation
{
use Translation;
}
If I decide not to implement the interface the command runs smoothly, the interface just forces you to have getter and setter for the locale atribute. I just wonder why does this happen.