GraphAware\Neo4j\OGM\Tests\Integration\Model\BothTest::addOther PHP Метод

addOther() публичный Метод

public addOther ( BothTest $other )
$other BothTest
    public function addOther(BothTest $other)
    {
        $this->others->add($other);
    }

Usage Example

 /**
  * @throws \Exception
  *
  * @group both-x
  */
 public function testBothRelationshipFlush()
 {
     $this->clearDb();
     $other1 = new BothTest('a');
     $other2 = new BothTest('b');
     $other3 = new BothTest('c');
     $other1->addOther($other2);
     $other1->addOther($other3);
     $this->em->persist($other1);
     $this->em->flush();
     $this->assertGraphExist('(b:Both {name:"b"})-[:RELATES]-(a:Both {name:"a"})-[:RELATES]-(c:Both {name:"c"})');
 }