<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;class ProfileLink { /** * @var int */ private $id; /** * @var datetime */ private $createdAt; /** * @var \Doctrine\Common\Collections\Collection */ private $entries; /** * Constructor */ public function __construct() { $this->entries = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * Set createdAt. * * @param datetime * * @return ProfileLink */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt. * * @return datetime */ public function getCreatedAt() { return $this->createdAt; } /** * Add profileLinkEntry. * * @param \App\Entity\ProfileLinkEntry $profileLinkEntry * * @return ProfileLink */ public function addProfileLinkEntry(\App\Entity\ProfileLinkEntry $profileLinkEntry) { $this->entries[] = $profileLinkEntry; return $this; } /** * Remove profileLinkEntry. * * @param \App\Entity\ProfileLinkEntry $profileLinkEntry * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeProfileLinkEntry(\App\Entity\ProfileLinkEntry $profileLinkEntry) { return $this->entries->removeElement($profileLinkEntry); } /** * Get profileLinkEntries. * * @return \Doctrine\Common\Collections\Collection */ public function getProfileLinkEntries() { return $this->entries; } public function getEntryByTypeID($typeID) { if (empty($this->entries)) { return null; } /* @var $entry \App\Entity\ProfileLinkEntry */ foreach ($this->entries as $entry) { $entryTypeID = $entry->getLinkType()->getId(); if ($entryTypeID == $typeID) { return $entry; } } return null; }}