Sulu\Bundle\ResourceBundle\Entity\OperatorValueTranslation::setOperatorValue PHP Method

setOperatorValue() public method

Set operatorValue.
public setOperatorValue ( OperatorValue $operatorValue ) : OperatorValueTranslation
$operatorValue OperatorValue
return OperatorValueTranslation
    public function setOperatorValue(\Sulu\Bundle\ResourceBundle\Entity\OperatorValue $operatorValue)
    {
        $this->operatorValue = $operatorValue;
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Get translation by locale.
  *
  * @return 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;
 }
All Usage Examples Of Sulu\Bundle\ResourceBundle\Entity\OperatorValueTranslation::setOperatorValue