Sulu\Bundle\ResourceBundle\Entity\OperatorTranslation::setOperator PHP Method

setOperator() public method

Set operator.
public setOperator ( Operator $operator ) : OperatorTranslation
$operator Operator
return OperatorTranslation
    public function setOperator(\Sulu\Bundle\ResourceBundle\Entity\Operator $operator)
    {
        $this->operator = $operator;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Process translations of an operator.
  *
  * @param ObjectManager $manager
  * @param Operator $operator
  * @param \DOMNodeList $translations
  */
 protected function processTranslations($manager, $operator, $translations)
 {
     /** @var $node DOMNode */
     foreach ($translations as $node) {
         $translation = new OperatorTranslation();
         $translation->setLocale($node->getAttribute('locale'));
         $translation->setName($node->nodeValue);
         $translation->setOperator($operator);
         $operator->addTranslation($translation);
         $manager->persist($translation);
     }
 }
All Usage Examples Of Sulu\Bundle\ResourceBundle\Entity\OperatorTranslation::setOperator