Created
March 8, 2011 23:13
-
-
Save johnwards/861330 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace WhiteOctober\FormBuilderBundle\Document; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @mongodb:Document(collection="forms") | |
*/ | |
class FormBuilder | |
{ | |
/** @mongodb:Id */ | |
private $id; | |
/** | |
* @validation:NotBlank | |
* @mongodb:Field(type="string") | |
*/ | |
private $name; | |
/** | |
* @validation:NotBlank | |
* @mongodb:Field(type="string") | |
*/ | |
private $short_url; | |
/** | |
* @validation:NotBlank | |
* @mongodb:Field(type="string") | |
*/ | |
private $welcome_text; | |
/** | |
* @validation:AssertType("boolean") | |
* @mongodb:Field(type="boolean") | |
*/ | |
private $self_registration; | |
/** | |
* @mongodb:ReferenceMany(targetDocument="Page", cascade={"persist", "remove"}) | |
*/ | |
private $pages; | |
public function __construct() | |
{ | |
$this->pages = new ArrayCollection; | |
} | |
public function setName($name) | |
{ | |
$this->name = $name; | |
} | |
public function getName() | |
{ | |
return $this->name; | |
} | |
public function setSelfRegistration($self_registration) { | |
$this->self_registration = $self_registration; | |
} | |
public function getSelfRegistration() { | |
return $this->self_registration; | |
} | |
public function setShortUrl($short_url) { | |
$this->short_url = $short_url; | |
} | |
public function getShortUrl() { | |
return $this->short_url; | |
} | |
public function setWelcomeText($welcome_text) { | |
$this->welcome_text = $welcome_text; | |
} | |
public function getWelcomeText() { | |
return $this->welcome_text; | |
} | |
public function setId($id) { | |
$this->id = $id; | |
} | |
public function getId() { | |
return $this->id; | |
} | |
public function setPages($pages) { | |
$this->pages = $pages; | |
} | |
public function getPages() { | |
return $this->pages; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace WhiteOctober\FormBuilderBundle\Document; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @mongodb:Document(collection="pages") | |
*/ | |
class Page | |
{ | |
/** @mongodb:Id */ | |
private $id; | |
/** | |
* @validation:NotBlank | |
* @mongodb:Field(type="string") | |
*/ | |
private $title; | |
/** | |
* @validation:NotBlank | |
* @mongodb:Field(type="int") | |
*/ | |
private $page_number; | |
/** | |
* @mongodb:EmbedMany(targetDocument="Element") | |
*/ | |
private $elements; | |
/** | |
* @mongodb:ReferenceOne(targetDocument="FormBuilder") | |
*/ | |
private $form_builder; | |
public function __construct() | |
{ | |
$this->elements = new ArrayCollection; | |
} | |
public function setElements($elements) { | |
$this->elements = $elements; | |
} | |
public function getElements() { | |
return $this->elements; | |
} | |
public function setId($id) { | |
$this->id = $id; | |
} | |
public function getId() { | |
return $this->id; | |
} | |
public function setTitle($title) { | |
$this->title = $title; | |
} | |
public function getTitle() { | |
return $this->title; | |
} | |
public function setFormBuilder($form_builder) { | |
$this->form_builder = $form_builder; | |
} | |
public function getFormBuilder() { | |
return $this->form_builder; | |
} | |
public function setPageNumber($page_number) { | |
$this->page_number = $page_number; | |
} | |
public function getPageNumber() { | |
return $this->page_number; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment