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

setCompositeLabel() public method

Set compositeLabel.
public setCompositeLabel ( $compositeLabel )
    public function setCompositeLabel($compositeLabel)
    {
        $this->compositeLabel = $compositeLabel;
    }

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();
 }