/** * Adds a post top the User's authored Posts. * * Post Author needs to be updated manually. * * @param Post $addPost * @return User */ public function addPost(Post $addPost) { if (!$this->getAuthoredPosts()->contains($addPost)) { $this->authoredPosts->add($addPost); } return $this; }
/** * Add a given option * * @param OptionInterface $option * @return $this */ public function addOption(OptionInterface $option) { if (!$this->hasOption($option)) { $this->options->add($option); } return $this; }
public function addOutpost(Outpost $outpost, $sync = true) { $this->outposts->add($outpost); if ($sync) { $outpost->setOwner($this, false); } }
/** * Add subnode * * @param \Elcodi\Component\Menu\Entity\Menu\Interfaces\NodeInterface $node Node * * @return $this self Object */ public function addSubnode(\Elcodi\Component\Menu\Entity\Menu\Interfaces\NodeInterface $node) { if ($node !== $this) { $this->subnodes->add($node); } return $this; }
/** * @param ThirdParty $thirdParty * * @return bool */ public function addThirdParty(ThirdParty $thirdParty) { if ($this->thirdPartyCredentials->contains($thirdParty)) { return false; } return $this->thirdPartyCredentials->add($thirdParty); }
/** * @param \AntiMattr\ShipmentTracking\Model\Tracking\CheckpointInterface */ public function addCheckpoint(CheckpointInterface $checkpoint) { $this->checkpoints->add($checkpoint); if ($this !== $checkpoint->getTracking()) { $checkpoint->setTracking($this); } }
/** * {@inheritdoc} */ public function addTagging(TaggingInterface $tagging) { if (!$this->hasTagging($tagging)) { $tagging->setTag($this); $this->taggings->add($tagging); } }
/** * @param Empresa $empresa */ public function addEmpresa($empresa) { if (!$this->empresas->contains($empresa)) { $empresa->setDirector($this); $this->empresas->add($empresa); } }
/** * @param Role $parent */ public function addParent(Role $parent) { if ($this->parents->contains($parent)) { throw new LogicException(sprintf("Parent role '%s' already assigned.", $parent->getId())); } $this->parents->add($parent); }
/** * {@inheritdoc} */ public function addTag(TagInterface $tag) { if ($this->tags->contains($tag)) { return; } $this->tags->add($tag); }
/** * @param Archivo $archivo */ public function addArchivo($archivo) { if (!$this->archivos->contains($archivo)) { $archivo->setDocumentable($this); $this->archivos->add($archivo); } }
/** * @param AntiMattr\Common\Product\OptionInterface */ public function addOption(OptionInterface $option) { $this->options->add($option); if ($this !== $option->getVariation()) { $option->setVariation($this); } }
public function testFirstAndLast() { $this->_coll->add('one'); $this->_coll->add('two'); $this->assertEquals($this->_coll->first(), 'one'); $this->assertEquals($this->_coll->last(), 'two'); }
/** * {@inheritdoc} */ public function addTerm(TermInterface $term) { if (!$this->hasOption($term)) { $this->terms->add($term); } return $this; }
/** * Add submissionFiles * * @param ArticleSubmissionFile $articleSubmissionFile * @return $this */ public function addArticleSubmissionFile(ArticleSubmissionFile $articleSubmissionFile) { if (!$this->articleSubmissionFiles->contains($articleSubmissionFile)) { $this->articleSubmissionFiles->add($articleSubmissionFile); } return $this; }
/** * Add item. * * @param \SWP\Component\Bridge\Model\Item $item * * @return Package */ public function addItem(\SWP\Component\Bridge\Model\Item $item) { if (!$this->items->contains($item)) { $this->items->add($item); $item->setPackage($this); } return $this; }
/** * @param Annonce $annonce */ public function addUser(Annonce $annonce) { if ($this->annonces->contains($annonce)) { return; } $this->annonces->add($annonce); $annonce->addProgrammeNeuf($this); }
/** * {@inheritdoc} */ public function addEmailLog(EmailLog $emailLog) { if (!$this->hasEmailLog($emailLog)) { $emailLog->setEmailTemplate($this); $this->emailLogs->add($emailLog); } return $this; }
/** * Set add image * * @param \Elcodi\Component\Media\Entity\Interfaces\ImageInterface $image Image object to be added * * @return $this self Object */ public function addImage(\Elcodi\Component\Media\Entity\Interfaces\ImageInterface $image) { $this->images->add($image); if (empty($this->principalImage)) { $this->setPrincipalImage($image); } return $this; }
/** * {@inheritdoc} */ public function save(TaskInterface $task) { if ($this->taskCollection->contains($task)) { return $this; } $this->taskCollection->add($task); return $this; }
/** * Add article * * @param Article $article * @return Citation */ public function addArticle(Article $article) { if (!$this->articles->contains($article)) { $this->articles->add($article); $article->addCitation($this); } return $this; }
/** * Add an attribute value * * @param AttributeValueInterface $attributeValue * * @return $this */ public function addAttributeValue(AttributeValueInterface $attributeValue) { if (!$this->attributeValues->contains($attributeValue)) { $attributeValue->setSubject($this); $this->attributeValues->add($attributeValue); } return $this; }
public function addItems(Collection $items) { foreach ($items as $item) { /* @var $answer Answer */ $this->items->add($item); $item->setMenu($this); } }
/** * @inheritdoc */ public function addField(FieldInterface $field) { if (is_null($field->getSequential())) { $field->setSequential($this->getFields()->count()); } $this->fields->add($field); return $this; }
/** * @param User $user */ public function addUser(User $user) { if ($this->users->contains($user)) { return; } $this->users->add($user); $user->addGroup($this); }
/** * {@inheritdoc} */ public function addField(FieldValueInterface $field) { if (!$this->hasField($field)) { $field->setSubject($this); $this->fields->add($field); } return $this; }
/** * {@inheritdoc} */ public function save(TaskExecutionInterface $execution) { if ($this->taskExecutionCollection->contains($execution)) { return $this; } $this->taskExecutionCollection->add($execution); return $this; }
/** * @param ClientMutation $mutation */ public function addMutation($mutation) { // $this->mutations is sorted by id descending, so we should add new // items at the start of the Collection. Doctrine collections don't // allow this right now, so we add it to the end. This is fixed in // getMutations. $this->mutations->add($mutation); }
/** * @param Scene $scene * * @return Chapter */ public function addScene(Scene $scene) { if (!$this->scenes->contains($scene)) { $scene->setChapter($this); $this->scenes->add($scene); } return $this; }
/** * @param Chapter $chapter * * @return Book */ public function addChapter(Chapter $chapter) { if (!$this->chapters->contains($chapter)) { $this->chapters->add($chapter); $chapter->setBook($this); } return $this; }