Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 3
0
 public function addOutpost(Outpost $outpost, $sync = true)
 {
     $this->outposts->add($outpost);
     if ($sync) {
         $outpost->setOwner($this, false);
     }
 }
Esempio n. 4
0
 /**
  * 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);
     }
 }
Esempio n. 7
0
 /**
  * {@inheritdoc}
  */
 public function addTagging(TaggingInterface $tagging)
 {
     if (!$this->hasTagging($tagging)) {
         $tagging->setTag($this);
         $this->taggings->add($tagging);
     }
 }
Esempio n. 8
0
 /**
  * @param Empresa $empresa
  */
 public function addEmpresa($empresa)
 {
     if (!$this->empresas->contains($empresa)) {
         $empresa->setDirector($this);
         $this->empresas->add($empresa);
     }
 }
Esempio n. 9
0
 /**
  * @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);
 }
Esempio n. 10
0
 /**
  * {@inheritdoc}
  */
 public function addTag(TagInterface $tag)
 {
     if ($this->tags->contains($tag)) {
         return;
     }
     $this->tags->add($tag);
 }
Esempio n. 11
0
 /**
  * @param Archivo $archivo
  */
 public function addArchivo($archivo)
 {
     if (!$this->archivos->contains($archivo)) {
         $archivo->setDocumentable($this);
         $this->archivos->add($archivo);
     }
 }
Esempio n. 12
0
 /**
  * @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');
 }
Esempio n. 14
0
 /**
  * {@inheritdoc}
  */
 public function addTerm(TermInterface $term)
 {
     if (!$this->hasOption($term)) {
         $this->terms->add($term);
     }
     return $this;
 }
Esempio n. 15
0
 /**
  * Add submissionFiles
  *
  * @param  ArticleSubmissionFile $articleSubmissionFile
  * @return $this
  */
 public function addArticleSubmissionFile(ArticleSubmissionFile $articleSubmissionFile)
 {
     if (!$this->articleSubmissionFiles->contains($articleSubmissionFile)) {
         $this->articleSubmissionFiles->add($articleSubmissionFile);
     }
     return $this;
 }
Esempio n. 16
0
 /**
  * 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;
 }
Esempio n. 17
0
 /**
  * @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;
 }
Esempio n. 19
0
 /**
  * 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;
 }
Esempio n. 20
0
 /**
  * {@inheritdoc}
  */
 public function save(TaskInterface $task)
 {
     if ($this->taskCollection->contains($task)) {
         return $this;
     }
     $this->taskCollection->add($task);
     return $this;
 }
Esempio n. 21
0
 /**
  * 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;
 }
Esempio n. 23
0
 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;
 }
Esempio n. 25
0
 /**
  * @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;
 }
Esempio n. 28
0
 /**
  * @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);
 }
Esempio n. 29
0
 /**
  * @param Scene $scene
  *
  * @return Chapter
  */
 public function addScene(Scene $scene)
 {
     if (!$this->scenes->contains($scene)) {
         $scene->setChapter($this);
         $this->scenes->add($scene);
     }
     return $this;
 }
Esempio n. 30
0
 /**
  * @param Chapter $chapter
  *
  * @return Book
  */
 public function addChapter(Chapter $chapter)
 {
     if (!$this->chapters->contains($chapter)) {
         $this->chapters->add($chapter);
         $chapter->setBook($this);
     }
     return $this;
 }