Created
April 8, 2011 23:29
-
-
Save apathyboy/910931 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 Sub6\PilotNocBundle\Entity; | |
| use Doctrine\Common\Collections\ArrayCollection; | |
| /** | |
| * @orm:Entity | |
| * @orm:Table(name="server") | |
| */ | |
| class Server | |
| { | |
| /** | |
| * Unique identifier for the server. | |
| * | |
| * @var int | |
| * | |
| * @orm:Id | |
| * @orm:Column(type="integer") | |
| * @orm:generatedValue | |
| */ | |
| protected $id; | |
| /** | |
| * FQDN for the server. | |
| * | |
| * @var string | |
| * | |
| * @orm:Column | |
| */ | |
| protected $hostname; | |
| /** | |
| * Often multiple server's are used for common tasks. By assigning a category | |
| * to a server it is easy to group servers together as well as provide additional | |
| * Attributes common to each server in a category. | |
| * | |
| * @var \Doctrine\Common\Collections\ArrayCollection | |
| * | |
| * @orm:ManyToMany(targetEntity="Category") | |
| * @orm:JoinTable(name="servers_categories", | |
| * joinColumns={@orm:JoinColumn(name="user_id", referencedColumnName="id")}, | |
| * inverseJoinColumns={@orm:JoinColumn(name="category_id", referencedColumnName="id")}) | |
| */ | |
| protected $categories; | |
| /** | |
| * Attributes are individual pieces of data stored for server. Attributes | |
| * provide a way to create new data fields and add them to servers or Categories, | |
| * making it much easier to customize what information is tracked for a server. | |
| * | |
| * @var \Doctrine\Common\Collections\ArrayCollection | |
| * | |
| * @orm:ManyToMany(targetEntity="Attribute") | |
| * @orm:JoinTable(name="servers_attributes", | |
| * joinColumns={@orm:JoinColumn(name="server_id", referencedColumnName="id")}, | |
| * inverseJoinColumns={@orm:JoinColumn(name="attribute_id", referencedColumnName="id", unique=true)}) | |
| */ | |
| protected $attributes; | |
| /** | |
| * Constructor for the Server class. | |
| */ | |
| public function __construct() | |
| { | |
| $this->categories = new ArrayCollection(); | |
| $this->attributes = new ArrayCollection(); | |
| } | |
| /** | |
| * Returns the FQDN for the server. | |
| * | |
| * @return string | |
| */ | |
| public function getHostname() | |
| { | |
| return $this->hostname; | |
| } | |
| /** | |
| * Sets a new FQDN for the server. | |
| * | |
| * @param string $hostname | |
| * @return void | |
| */ | |
| public function setHostname($hostname) | |
| { | |
| $this->hostname = $hostname; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment