Ejemplo n.º 1
0
 /**
  * @param OfferingInterface $offering
  */
 public function addOffering(OfferingInterface $offering)
 {
     $this->offerings->add($offering);
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function removeOffering(OfferingInterface $offering)
 {
     if ($this->offerings->contains($offering)) {
         $this->offerings->removeElement($offering);
         $offering->removeLearnerGroup($this);
     }
 }
Ejemplo n.º 3
0
 /**
  * @return ArrayCollection|Offering[]
  */
 public function getInstructedOfferings()
 {
     //criteria not 100% reliable on many to many relationships
     //fix in https://github.com/doctrine/doctrine2/pull/1399
     // $criteria = Criteria::create()->where(Criteria::expr()->eq("deleted", false));
     // return new ArrayCollection($this->instructedOfferings->matching($criteria)->getValues());
     $arr = $this->instructedOfferings->filter(function ($entity) {
         return !$entity->isDeleted();
     })->toArray();
     $reIndexed = array_values($arr);
     return new ArrayCollection($reIndexed);
 }
Ejemplo n.º 4
0
 /**
  * @param Offering $report
  */
 public function addInstructedOffering(Offering $instructedOffering)
 {
     $this->instructedOfferings->add($instructedOffering);
 }