id; } /** * Set url * * @param string $url */ public function setUrl($url) { $this->url = $url; } /** * Get url * * @return string */ public function getUrl() { return $this->url; } /** * Set name * * @param string $name */ public function setName($name) { $this->name = $name; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set type * * @param ElementType $type */ public function setType(ElementType $type = null) { $this->type = $type; } /** * Get type * * @return ElementType */ public function getType() { return $this->type; } public function __construct($url = null) { //$this->tags = new ArrayCollection(); $this->url = $url; } public function __toString() { return $this->name; } /** * Add tags * * @param Tag $tags */ public function addTag(Tag $tags) { $this->tags[] = $tags; } /** * Get tags * * @return Doctrine\Common\Collections\Collection */ public function getTags() { return $this->tags; } public function setTags($tags) { $this->tags = $tags; } /** * Set owner * * @param User $owner */ public function setOwner(User $owner) { $this->owner = $owner; } /** * Get owner * * @return User */ public function getOwner() { return $this->owner; } /** * Add elements_favorites * * @param UsersElementsFavorites $elementsFavorites */ public function addUsersElementsFavorites(UsersElementsFavorites $elementsFavorites) { $this->elements_favorites[] = $elementsFavorites; } /** * Get elements_favorites * * @return Doctrine\Common\Collections\Collection */ public function getElementsFavorites() { return $this->elements_favorites; } /** * Set group * * @param Group $group */ public function setGroup($group) { $this->group = $group; } /** * Get group * * @return Group */ public function getGroup() { return $this->group; } /** * Set embed * * @param string $code */ public function setEmbed($code) { $this->embed = $code; } /** * Get embed * * @return string */ public function getEmbed() { return $this->embed; } /** * Set created * * @param date $created */ public function setCreated($created) { $this->created = $created; } /** * Get created * * @return date */ 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; } /** * Etablie des relation vers des tags. * (Supprime les anciens tags, au niveau de l'objet seulement) * * @param array $ids */ public function setTagsWithIds(EntityManager $em, $ids) { $tags = $em->getRepository('MuzichCoreBundle:Tag')->findByIds($ids)->execute(); $this->tags = null; // Pour les nouveaux ids restants foreach ($tags as $tag) { $this->addTag($tag); } } public function getCountFavorite() { return count($this->elements_favorites); } public function setGroupToId() { $this->group = $this->group->getId(); } }