setName() public method

Set name.
public setName ( string $name ) : OperatorTranslation
$name string
return OperatorTranslation
Example #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);
     }
 }
Example #2
0
 protected function createSimpleOperator($type, $inputType, $operatorValue, $name, $locale = 'de')
 {
     $operator = new Operator();
     $operator->setType($type);
     $operator->setInputType($inputType);
     $operator->setOperator($operatorValue);
     $translation = new OperatorTranslation();
     $translation->setLocale($locale);
     $translation->setName($name);
     $translation->setOperator($operator);
     $this->em->persist($operator);
     $this->em->persist($translation);
     return $operator;
 }