Created
June 11, 2017 13:02
This file contains 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
/** | |
* @ORM\Entity(repositoryClass="AppBundle\Repository\GenusRepository") | |
* @ORM\Table(name="genus") | |
*/ | |
class Genus | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* @ORM\Column(type="integer") | |
*/ | |
private $id; | |
/** | |
* @Assert\NotBlank() | |
* @ORM\Column(type="string") | |
*/ | |
private $name; | |
/** | |
* @Assert\NotBlank() | |
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\SubFamily") | |
* @ORM\JoinColumn(nullable=false) | |
*/ | |
private $subFamily; | |
/** | |
* @Assert\NotBlank() | |
* @Assert\Range(min=0, minMessage="Negative species! Come on...") | |
* @ORM\Column(type="integer") | |
*/ | |
private $speciesCount; | |
/** | |
* @ORM\Column(type="string", nullable=true) | |
*/ | |
private $funFact; | |
/** | |
* @ORM\Column(type="boolean") | |
*/ | |
private $isPublished = true; | |
/** | |
* @return mixed | |
*/ | |
public function getisPublished() | |
{ | |
return $this->isPublished; | |
} | |
/** | |
* @Assert\NotBlank() | |
* @ORM\Column(type="date") | |
*/ | |
private $firstDiscoveredAt; | |
/** | |
* @ORM\OneToMany(targetEntity="GenusNote", mappedBy="genus") | |
* @ORM\OrderBy({"createdAt" = "DESC"}) | |
*/ | |
private $notes; | |
public function __construct() | |
{ | |
$this->notes = new ArrayCollection(); | |
} | |
public function getName() | |
{ | |
return $this->name; | |
} | |
public function setName($name) | |
{ | |
$this->name = $name; | |
} | |
/** | |
* @return SubFamily | |
*/ | |
public function getSubFamily() | |
{ | |
return $this->subFamily; | |
} | |
public function setSubFamily(SubFamily $subFamily = null) | |
{ | |
$this->subFamily = $subFamily; | |
} | |
public function getSpeciesCount() | |
{ | |
return $this->speciesCount; | |
} | |
public function setSpeciesCount($speciesCount) | |
{ | |
$this->speciesCount = $speciesCount; | |
} | |
public function getFunFact() | |
{ | |
return '**TEST** '.$this->funFact; | |
} | |
public function setFunFact($funFact) | |
{ | |
$this->funFact = $funFact; | |
} | |
public function getUpdatedAt() | |
{ | |
return new \DateTime('-'.rand(0, 100).' days'); | |
} | |
public function setIsPublished($isPublished) | |
{ | |
$this->isPublished = $isPublished; | |
} | |
/** | |
* @return ArrayCollection|GenusNote[] | |
*/ | |
public function getNotes() | |
{ | |
return $this->notes; | |
} | |
public function getFirstDiscoveredAt() | |
{ | |
return $this->firstDiscoveredAt; | |
} | |
public function setFirstDiscoveredAt(\DateTime $firstDiscoveredAt = null) | |
{ | |
$this->firstDiscoveredAt = $firstDiscoveredAt; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment