Skip to content

Instantly share code, notes, and snippets.

@ikwattro
Created November 16, 2016 00:37
Show Gist options
  • Save ikwattro/20056e0991a8bf3a540d1524335ac452 to your computer and use it in GitHub Desktop.
Save ikwattro/20056e0991a8bf3a540d1524335ac452 to your computer and use it in GitHub Desktop.
<?php
use GraphAware\Neo4j\OGM\Annotations as OGM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @OGM\Node(label="Character")
*/
class Character
{
/**
* @var int
*
* @OGM\GraphId()
*/
protected $id;
/**
* @var string
*
* @OGM\Property(type="string")
*/
protected $name;
/**
* @var Character[]
*
* @OGM\Relationship(type="ALLY_OF", direction="OUTGOING", targetEntity="Character", mappedBy="ally", collection=true)
*/
protected $allies;
public function __construct()
{
$this->allies = new ArrayCollection();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment