Sulu\Bundle\ResourceBundle\Api\OperatorValue::getTranslation PHP Метод

getTranslation() приватный Метод

Get translation by locale.
private getTranslation ( ) : OperatorValueTranslation
Результат Sulu\Bundle\ResourceBundle\Entity\OperatorValueTranslation
    private function getTranslation()
    {
        $operatorTranslation = null;
        foreach ($this->entity->getTranslations() as $translation) {
            if ($translation->getLocale() == $this->locale) {
                $operatorTranslation = $translation;
            }
        }
        if (!$operatorTranslation) {
            $operatorTranslation = new OperatorValueTranslation();
            $operatorTranslation->setLocale($this->locale);
            $operatorTranslation->setOperatorValue($this->entity);
            $this->entity->addTranslation($operatorTranslation);
        }
        return $operatorTranslation;
    }