Skip to content

Instantly share code, notes, and snippets.

@pdrosos
Last active December 24, 2015 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdrosos/6764963 to your computer and use it in GitHub Desktop.
Save pdrosos/6764963 to your computer and use it in GitHub Desktop.
One-To-Many, Self-referencing association with Typo3 Flow and Doctrine 2
<?php
namespace My\Package\Domain\Model;
use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
/**
* @Flow\Entity
*/
class Task {
/**
* @var \Doctrine\Common\Collections\ArrayCollection<\My\Package\Domain\Model\Task>
* @ORM\OneToMany(mappedBy="parentTask")
**/
protected $relatedTasks;
/**
* @var \My\Package\Domain\Model\Task
* @ORM\ManyToOne(inversedBy="relatedTasks")
**/
protected $parentTask;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment