GraphAware\Neo4j\OGM\Tests\Integration\Model\User::setCurrentCompany PHP Méthode

setCurrentCompany() public méthode

public setCurrentCompany ( Company $company )
$company Company
    public function setCurrentCompany(Company $company)
    {
        $this->currentCompany = $company;
    }

Usage Example

 public function testEntityIsPersistedWithRelationship()
 {
     $company = new Company('Acme');
     $user = new User('ikwattro');
     $user->setCurrentCompany($company);
     $company->addEmployee($user);
     $this->em->persist($user);
     $this->em->flush();
     $this->assertGraphExist('(u:User {login:"******"})-[r:WORKS_AT]->(c:Company {name:"Acme"})');
 }
All Usage Examples Of GraphAware\Neo4j\OGM\Tests\Integration\Model\User::setCurrentCompany