Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save doctrinebot/b853bc3327fe797e02a1 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1007 - https://github.com/doctrine/doctrine2/issues/1592
/** @Entity */
class Category
{
/**
* @Id
* @GeneratedValue
*/
private $id;
/**
* @OneToMany(targetEntity="Article", mappedBy="category")
*/
private $articles;
// other propertiess like name
// methods
}
/** @Entity */
class Category
{
/**
* @Id
* @GeneratedValue
*/
private $id;
/**
* @Column
*/
private $visibility;
/**
* @ManyToOne(targetEntity="Article", inversedBy="articles")
*/
private $category;
// other properties like name and text
// methods
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment