Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace SciForum\Version2Bundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- use Symfony\Component\Validator\Mapping\ClassMetadata;
- use Symfony\Component\Validator\Constraints\NotBlank;
- use Symfony\Component\Validator\Constraints\MinLength;
- use Symfony\Component\Validator\Constraints\MaxLength;
- /**
- * @ORM\Entity(repositoryClass="SciForum\Version2Bundle\Repository\ConferenceRepository")
- * @ORM\Table(name="conferences")
- * @ORM\HasLifecycleCallbacks()
- */
- class Conference
- {
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $id;
- /**
- * @ORM\Column(type="integer")
- */
- protected $conf_type;
- /**
- * @ORM\Column(type="string")
- */
- protected $name_full;
- /**
- * @ORM\Column(type="string")
- */
- protected $name_iso4;
- /**
- * @ORM\Column(type="string")
- */
- protected $name_short;
- /**
- * @ORM\Column(type="string")
- */
- protected $name_system;
- /**
- * @ORM\Column(type="integer")
- */
- protected $edition;
- /**
- * @ORM\Column(type="date")
- */
- protected $date_start;
- /**
- * @ORM\Column(type="date")
- */
- protected $date_end;
- /**
- * @ORM\Column(type="date")
- */
- protected $date_abstract;
- /**
- * @ORM\Column(type="date")
- */
- protected $date_acceptance;
- /**
- * @ORM\Column(type="date")
- */
- protected $date_presentation;
- /**
- * @ORM\Column(type="string")
- */
- protected $description;
- /**
- * @ORM\Column(type="string")
- */
- protected $topics;
- /**
- * @ORM\Column(name="`call`", type="string")
- */
- protected $call;
- /**
- * @ORM\Column(type="string")
- */
- protected $proceedings;
- /**
- * @ORM\Column(type="string")
- */
- protected $instructions;
- /**
- * @ORM\Column(type="string")
- */
- protected $img;
- /**
- * @ORM\Column(type="string")
- */
- protected $organizer;
- /**
- * @ORM\Column(name="`schedule`", type="string")
- */
- protected $schedule;
- /**
- * @ORM\Column(type="string")
- */
- protected $registration;
- /**
- * @ORM\Column(type="string")
- */
- protected $contact;
- /**
- * @ORM\Column(type="integer")
- */
- protected $state;
- /**
- * @ORM\Column(type="string")
- */
- protected $welcome_page;
- /**
- * @ORM\Column(type="boolean")
- */
- protected $is_html_conference;
- /**
- * @ORM\Column(type="string")
- */
- protected $html_conference_location;
- /**
- * @ORM\OneToMany(targetEntity="Paper", mappedBy="conference")
- */
- protected $papers;
- /**
- * @ORM\OneToMany(targetEntity="Section", mappedBy="conference")
- */
- protected $sections;
- /**
- * @ORM\OneToMany(targetEntity="Sponsor", mappedBy="conference")
- * @ORM\OrderBy({"ordernum" = "ASC"})
- */
- protected $sponsors;
- /**
- * @ORM\OneToMany(targetEntity="Video", mappedBy="conference")
- */
- protected $videos;
- /**
- * @ORM\OneToOne(targetEntity="CDRom", mappedBy="conf")
- */
- protected $cdrom;
- /**
- * @ORM\OneToOne(targetEntity="ConferenceState", inversedBy="conf")
- * @ORM\JoinColumn(name="state", referencedColumnName="id")
- */
- protected $conf_state;
- /**
- * @ORM\ManyToOne(targetEntity="ConferenceType", inversedBy="conf")
- * @ORM\JoinColumn(name="conf_type", referencedColumnName="id")
- */
- protected $conf_type_object;
- /**
- * @ORM\OneToMany(targetEntity="Submission", mappedBy="conference")
- */
- protected $submissions;
- /**
- * @ORM\OneToMany(targetEntity="ConferenceAdmin", mappedBy="conference")
- */
- protected $conference_admins;
- public function __construct()
- {
- $this->papers = new ArrayCollection();
- $this->sections = new ArrayCollection();
- $this->sponsors = new ArrayCollection();
- $this->videos = new ArrayCollection();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set conf_type
- *
- * @param integer $confType
- */
- public function setConfType($confType)
- {
- $this->conf_type = $confType;
- }
- /**
- * Get conf_type
- *
- * @return integer
- */
- public function getConfType()
- {
- return $this->conf_type;
- }
- /**
- * Set name_full
- *
- * @param string $nameFull
- */
- public function setNameFull($nameFull)
- {
- $this->name_full = $nameFull;
- }
- /**
- * Get name_full
- *
- * @return string
- */
- public function getNameFull()
- {
- return $this->name_full;
- }
- /**
- * Set name_short
- *
- * @param string $nameShort
- */
- public function setNameShort($nameShort)
- {
- $this->name_short = $nameShort;
- }
- /**
- * Get name_short
- *
- * @return string
- */
- public function getNameShort()
- {
- return $this->name_short;
- }
- /**
- * Set name_system
- *
- * @param string $nameSystem
- */
- public function setNameSystem($nameSystem)
- {
- $this->name_system = $nameSystem;
- }
- /**
- * Get name_system
- *
- * @return string
- */
- public function getNameSystem()
- {
- return $this->name_system;
- }
- /**
- * Set edition
- *
- * @param integer $edition
- */
- public function setEdition($edition)
- {
- $this->edition = $edition;
- }
- /**
- * Get edition
- *
- * @return integer
- */
- public function getEdition()
- {
- return $this->edition;
- }
- /**
- * Set date_start
- *
- * @param date $dateStart
- */
- public function setDateStart($dateStart)
- {
- $this->date_start = $dateStart;
- }
- /**
- * Get date_start
- *
- * @return date
- */
- public function getDateStart()
- {
- return $this->date_start;
- }
- /**
- * Set date_end
- *
- * @param date $dateEnd
- */
- public function setDateEnd($dateEnd)
- {
- $this->date_end = $dateEnd;
- }
- /**
- * Get date_end
- *
- * @return date
- */
- public function getDateEnd()
- {
- return $this->date_end;
- }
- /**
- * Set date_abstract
- *
- * @param date $dateAbstract
- */
- public function setDateAbstract($dateAbstract)
- {
- $this->date_abstract = $dateAbstract;
- }
- /**
- * Get date_abstract
- *
- * @return date
- */
- public function getDateAbstract()
- {
- return $this->date_abstract;
- }
- /**
- * Set date_acceptance
- *
- * @param date $dateAcceptance
- */
- public function setDateAcceptance($dateAcceptance)
- {
- $this->date_acceptance = $dateAcceptance;
- }
- /**
- * Get date_acceptance
- *
- * @return date
- */
- public function getDateAcceptance()
- {
- return $this->date_acceptance;
- }
- /**
- * Set date_presentation
- *
- * @param date $datePresentation
- */
- public function setDatePresentation($datePresentation)
- {
- $this->date_presentation = $datePresentation;
- }
- /**
- * Get date_presentation
- *
- * @return date
- */
- public function getDatePresentation()
- {
- return $this->date_presentation;
- }
- /**
- * Set description
- *
- * @param string $description
- */
- public function setDescription($description)
- {
- $this->description = $description;
- }
- /**
- * Get description
- *
- * @return string
- */
- public function getDescription()
- {
- $s = str_replace("\\'", "'", $this->description);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set topics
- *
- * @param string $topics
- */
- public function setTopics($topics)
- {
- $this->topics = $topics;
- }
- /**
- * Get topics
- *
- * @return string
- */
- public function getTopics()
- {
- $s = str_replace("\\'", "'", $this->topics);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set call
- *
- * @param string $call
- */
- public function setCall($call)
- {
- $this->call = $call;
- }
- /**
- * Get call
- *
- * @return string
- */
- public function getCall()
- {
- $s = str_replace("\\'", "'", $this->call);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set proceedings
- *
- * @param string $proceedings
- */
- public function setProceedings($proceedings)
- {
- $this->proceedings = $proceedings;
- }
- /**
- * Get proceedings
- *
- * @return string
- */
- public function getProceedings()
- {
- $s = str_replace("\\'", "'", $this->proceedings);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set instructions
- *
- * @param string $instructions
- */
- public function setInstructions($instructions)
- {
- $this->instructions = $instructions;
- }
- /**
- * Get instructions
- *
- * @return string
- */
- public function getInstructions()
- {
- $s = str_replace("\\'", "'", $this->instructions);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set img
- *
- * @param string $img
- */
- public function setImg($img)
- {
- $this->img = $img;
- }
- /**
- * Get img
- *
- * @return string
- */
- public function getImg()
- {
- return $this->img;
- }
- /**
- * Set organizer
- *
- * @param string $organizer
- */
- public function setOrganizer($organizer)
- {
- $this->organizer = $organizer;
- }
- /**
- * Get organizer
- *
- * @return string
- */
- public function getOrganizer()
- {
- $s = str_replace("\\'", "'", $this->organizer);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set schedule
- *
- * @param string $schedule
- */
- public function setSchedule($schedule)
- {
- $this->schedule = $schedule;
- }
- /**
- * Get schedule
- *
- * @return string
- */
- public function getSchedule()
- {
- $s = str_replace("\\'", "'", $this->schedule);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set registration
- *
- * @param string $registration
- */
- public function setRegistration($registration)
- {
- $this->registration = $registration;
- }
- /**
- * Get registration
- *
- * @return string
- */
- public function getRegistration()
- {
- $s = str_replace("\\'", "'", $this->registration);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set contact
- *
- * @param string $contact
- */
- public function setContact($contact)
- {
- $this->contact = $contact;
- }
- /**
- * Get contact
- *
- * @return string
- */
- public function getContact()
- {
- $s = str_replace("\\'", "'", $this->contact);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set state
- *
- * @param integer $state
- */
- public function setState($state)
- {
- $this->state = $state;
- }
- /**
- * Get state
- *
- * @return integer
- */
- public function getState()
- {
- return $this->state;
- }
- /**
- * Set welcome_page
- *
- * @param string $welcomePage
- */
- public function setWelcomePage($welcomePage)
- {
- $this->welcome_page = $welcomePage;
- }
- /**
- * Get welcome_page
- *
- * @return string
- */
- public function getWelcomePage()
- {
- $s = str_replace("\\'", "'", $this->welcome_page);
- $s = str_replace('\\"', '"', $s);
- return $s;
- }
- /**
- * Set is_html_conference
- *
- * @param boolean $isHtmlConference
- */
- public function setIsHtmlConference($isHtmlConference)
- {
- $this->is_html_conference = $isHtmlConference;
- }
- /**
- * Get is_html_conference
- *
- * @return boolean
- */
- public function getIsHtmlConference()
- {
- return $this->is_html_conference;
- }
- /**
- * Set html_conference_location
- *
- * @param string $htmlConferenceLocation
- */
- public function setHtmlConferenceLocation($htmlConferenceLocation)
- {
- $this->html_conference_location = $htmlConferenceLocation;
- }
- /**
- * Get html_conference_location
- *
- * @return string
- */
- public function getHtmlConferenceLocation()
- {
- return $this->html_conference_location;
- }
- /**
- * Add papers
- *
- * @param SciForum\Version2Bundle\Entity\Paper $papers
- */
- public function addPaper(\SciForum\Version2Bundle\Entity\Paper $papers)
- {
- $this->papers[] = $papers;
- }
- /**
- * Get papers
- *
- * @return Doctrine\Common\Collections\Collection
- */
- public function getPapers()
- {
- return $this->papers;
- }
- /**
- * Add sections
- *
- * @param SciForum\Version2Bundle\Entity\Section $sections
- */
- public function addSection(\SciForum\Version2Bundle\Entity\Section $sections)
- {
- $this->sections[] = $sections;
- }
- /**
- * Get sections
- *
- * @return Doctrine\Common\Collections\Collection
- */
- public function getSections()
- {
- return $this->sections;
- }
- /**
- * Add sponsors
- *
- * @param SciForum\Version2Bundle\Entity\Sponsor $sponsors
- */
- public function addSponsor(\SciForum\Version2Bundle\Entity\Sponsor $sponsors)
- {
- $this->sponsors[] = $sponsors;
- }
- /**
- * Get sponsors
- *
- * @return Doctrine\Common\Collections\Collection
- */
- public function getSponsors()
- {
- return $this->sponsors;
- }
- /**
- * Add videos
- *
- * @param SciForum\Version2Bundle\Entity\Video $videos
- */
- public function addVideo(\SciForum\Version2Bundle\Entity\Video $videos)
- {
- $this->videos[] = $videos;
- }
- /**
- * Get videos
- *
- * @return Doctrine\Common\Collections\Collection
- */
- public function getVideos()
- {
- return $this->videos;
- }
- /**
- * Set cdrom
- *
- * @param SciForum\Version2Bundle\Entity\CDRom $cdrom
- */
- public function setCdrom(\SciForum\Version2Bundle\Entity\CDRom $cdrom)
- {
- $this->cdrom = $cdrom;
- }
- /**
- * Get cdrom
- *
- * @return SciForum\Version2Bundle\Entity\CDRom
- */
- public function getCdrom()
- {
- return $this->cdrom;
- }
- /**
- * Set submission
- *
- * @param SciForum\Version2Bundle\Entity\Submission $submission
- */
- public function setSubmissions(\SciForum\Version2Bundle\Entity\Submission $submission)
- {
- $this->submissions = $submissions;
- }
- /**
- * Get submission
- *
- * @return SciForum\Version2Bundle\Entity\Submission
- */
- public function getSubmissions()
- {
- return $this->submissions;
- }
- /**
- * Add conference_admins
- *
- * @param SciForum\Version2Bundle\Entity\ConferenceAdmin $conferenceAdmins
- */
- public function addConferenceAdmin(\SciForum\Version2Bundle\Entity\ConferenceAdmin $conferenceAdmins)
- {
- $this->conference_admins[] = $conferenceAdmins;
- }
- /**
- * Get conference_admins
- *
- * @return Doctrine\Common\Collections\Collection
- */
- public function getConferenceAdmins()
- {
- return $this->conference_admins;
- }
- /**
- * Set name_iso4
- *
- * @param string $nameIso4
- */
- public function setNameIso4($nameIso4)
- {
- $this->name_iso4 = $nameIso4;
- }
- /**
- * Get name_iso4
- *
- * @return string
- */
- public function getNameIso4()
- {
- return $this->name_iso4;
- }
- /**
- * Set conf_state
- *
- * @param SciForum\Version2Bundle\Entity\ConferenceState $confState
- */
- public function setConfState(\SciForum\Version2Bundle\Entity\ConferenceState $confState)
- {
- $this->conf_state = $confState;
- }
- /**
- * Get conf_state
- *
- * @return SciForum\Version2Bundle\Entity\ConferenceState
- */
- public function getConfState()
- {
- return $this->conf_state;
- }
- /**
- * Set conf_type_object
- *
- * @param SciForum\Version2Bundle\Entity\ConferenceType $confTypeObject
- */
- public function setConfTypeObject(\SciForum\Version2Bundle\Entity\ConferenceType $confTypeObject)
- {
- $this->conf_type_object = $confTypeObject;
- }
- /**
- * Get conf_type_object
- *
- * @return SciForum\Version2Bundle\Entity\ConferenceType
- */
- public function getConfTypeObject()
- {
- return $this->conf_type_object;
- }
- public static function loadValidatorMetadata(ClassMetadata $metadata)
- {
- $full_blank = new NotBlank();
- $full_min = new MinLength(10);
- $iso_blank = new NotBlank();
- $iso_min = new MinLength(10);
- $short_blank = new NotBlank();
- $short_min = new MinLength(3);
- $full_blank->message = "The name full should not be blank";
- $full_min->message = "The name full is too short. It should have {{ limit }} characters or more";
- $iso_blank->message = "The name iso should not be blank";
- $iso_min->message = "The name iso is too short. It should have {{ limit }} characters or more";
- $short_blank->message = "The name short should not be blank";
- $short_min->message = "The name short is too short. It should have {{ limit }} characters or more";
- $metadata->addPropertyConstraint('name_full', $full_blank);
- $metadata->addPropertyConstraint('name_full', $full_min );
- $metadata->addPropertyConstraint('name_iso4', $iso_blank);
- $metadata->addPropertyConstraint('name_iso4', $iso_min );
- $metadata->addPropertyConstraint('name_short', $short_blank);
- $metadata->addPropertyConstraint('name_short', $short_min );
- }
- public function __toString()
- {
- return $this->name_full;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment