예제 #1
0
파일: User.php 프로젝트: profcab/ilios
 /**
  * @param ReportInterface $report
  */
 public function addReport(ReportInterface $report)
 {
     $this->reports->add($report);
 }
예제 #2
0
파일: User.php 프로젝트: Okami-/ilios
 /**
  * @return ArrayCollection|ReportInterface[]
  */
 public function getReports()
 {
     //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->reports->matching($criteria)->getValues());
     $arr = $this->reports->filter(function (ReportInterface $entity) {
         return !$entity->isDeleted();
     })->toArray();
     $reIndexed = array_values($arr);
     return new ArrayCollection($reIndexed);
 }
예제 #3
0
파일: User.php 프로젝트: stopfstedt/ilios
 /**
  * @param ReportInterface $report
  */
 public function removeReport(ReportInterface $report)
 {
     $this->reports->removeElement($report);
 }