Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created June 9, 2012 17:06
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 enricostano/2901817 to your computer and use it in GitHub Desktop.
Save enricostano/2901817 to your computer and use it in GitHub Desktop.
Gara Entity
<?php
namespace StanoSas\Bundle\DocumentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\Common\Collections\ArrayCollection;
use StanoSas\Bundle\UserBundle\Entity\User;
/**
* StanoSas\Bundle\DocumentBundle\Entity\Gara
*
* @ORM\Table()
* @ORM\Entity
* @ORM\HasLifecycleCallbacks
*/
class Gara
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var datetime $created
*
* @ORM\Column(name="created", type="datetime")
* @Gedmo\Timestampable(on="create")
*/
private $created;
/**
* @var datetime $updated
*
* @ORM\Column(name="updated", type="datetime")
* @Gedmo\Timestampable(on="update")
*/
private $updated;
/**
* @var date $start
*
* @ORM\Column(name="start", type="date")
*/
private $start;
/**
* @var date $stop
*
* @ORM\Column(name="stop", type="date")
*/
private $stop;
/**
* @var string $name
*
* @ORM\Column(name="name", type="string", length=255)
* @Assert\NotBlank
*/
private $name;
/**
* @ORM\ManyToMany(targetEntity="Attachment")
* @ORM\JoinTable(name="gare_attachments",
* joinColumns={@ORM\JoinColumn(name="gara_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="attachment_id", referencedColumnName="id", unique=true)}
* )
*/
private $attachments;
/**
* @ORM\ManyToOne(targetEntity="StanoSas\Bundle\UserBundle\Entity\User")
* @ORM\JoinColumn(name="author_id", referencedColumnName="id")
*/
private $author;
/**
* @ORM\ManyToOne(targetEntity="Ente")
* @ORM\JoinColumn(name="ente_id", referencedColumnName="id")
*/
private $ente;
public function __construct()
{
$this->attachments = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set created
*
* @param datetime $created
*/
public function setCreated($created)
{
$this->created = $created;
}
/**
* Get created
*
* @return datetime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set updated
*
* @param datetime $updated
*/
public function setUpdated($updated)
{
$this->updated = $updated;
}
/**
* Get updated
*
* @return datetime
*/
public function getUpdated()
{
return $this->updated;
}
/**
* Set start
*
* @param date $start
*/
public function setStart($start)
{
$this->start = $start;
}
/**
* Get start
*
* @return date
*/
public function getStart()
{
return $this->start;
}
/**
* Set stop
*
* @param date $stop
*/
public function setStop($stop)
{
$this->stop = $stop;
}
/**
* Get stop
*
* @return date
*/
public function getStop()
{
return $this->stop;
}
/**
* Set name
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Add attachments
*
* @param StanoSas\Bundle\DocumentBundle\Entity\Attachment $attachments
*/
public function addAttachment(\StanoSas\Bundle\DocumentBundle\Entity\Attachment $attachments)
{
$this->attachments[] = $attachments;
}
/**
* Get attachments
*
* @return Doctrine\Common\Collections\Collection
*/
public function getAttachments()
{
return $this->attachments;
}
/**
* Set author
*
* @param StanoSas\Bundle\UserBundle\Entity\User $author
*/
public function setAuthor(\StanoSas\Bundle\UserBundle\Entity\User $author)
{
$this->author = $author;
}
/**
* Get author
*
* @return StanoSas\Bundle\UserBundle\Entity\User
*/
public function getAuthor()
{
return $this->author;
}
/**
* Set ente
*
* @param StanoSas\Bundle\DocumentBundle\Entity\Ente $ente
*/
public function setEnte(\StanoSas\Bundle\DocumentBundle\Entity\Ente $ente)
{
$this->ente = $ente;
}
/**
* Get ente
*
* @return StanoSas\Bundle\DocumentBundle\Entity\Ente
*/
public function getEnte()
{
return $this->ente;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment