Skip to content

Instantly share code, notes, and snippets.

@comfuture
Created May 13, 2011 01:52
Show Gist options
  • Save comfuture/969832 to your computer and use it in GitHub Desktop.
Save comfuture/969832 to your computer and use it in GitHub Desktop.
article class that contains orm and form annotations
<?php
/**
* @Entity
* @Form(method="POST")
*/
class Article
{
/** @Id @GeneratedValue @Column(type="integer") */
private $id;
/**
* @ManyToOne(targetEntity="User", reversedBy="articles")
* @FormItem(type="hidden")
*/
private $user;
/** @Column(type="string", length=255) */
private $title;
/** @Column(type="text") */
private $content;
/**
* @Column(type="string", length=1)
* @FormItem(type="radio", options={
* {"text"="YES", "value"="Y"},
* {"text"="NO" , "value"="N"}
* })
*/
private $isPublic;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment