ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\CompositeRelation::setValue PHP Method

setValue() public method

Set value.
public setValue ( $value )
    public function setValue($value)
    {
        $this->value = $value;
    }

Usage Example

Example #1
0
 /**
  * @Given there are Composite identifier objects
  */
 public function thereIsACompositeIdentifierObject()
 {
     $item = new CompositeItem();
     $item->setField1('foobar');
     $this->manager->persist($item);
     for ($i = 0; $i < 4; ++$i) {
         $label = new CompositeLabel();
         $label->setValue('foo-' . $i);
         $rel = new CompositeRelation();
         $rel->setCompositeLabel($label);
         $rel->setCompositeItem($item);
         $rel->setValue('somefoobardummy');
         $this->manager->persist($label);
         $this->manager->persist($rel);
     }
     $this->manager->flush();
 }