示例#1
0
 /**
  * @param $data
  * @param $group
  */
 private function setParent($data, $group)
 {
     if (isset($data['parent']) && isset($data['parent']['id'])) {
         $parent = $this->groupOfId($data['parent']['id']);
         if ($parent) {
             $parent->addChild($group);
             $this->groupRepo->update($parent);
         }
     }
 }
 /**
  * @test
  * @group currrepo
  */
 public function should_add_objective_level()
 {
     $cg_K1A = $this->groupRepo->groupOfName('1KA');
     $objective = $this->currRepo->objectiveOfCode('D0.1.a');
     $level = 2;
     $this->currRepo->addObjectiveLevel($objective, $cg_K1A, $level);
     $this->em->clear();
     $result = $this->currRepo->objectiveOfCode('D0.1.a');
     $this->assertCount(2, $result->levels());
     $this->assertInstanceOf('Bakgat\\Notos\\Domain\\Model\\Curricula\\ObjectiveControlLevel', $result->levels()[1]);
 }
 /**
  * @test
  * @group grouprepo
  */
 public function should_return_null_when_group_of_id_not_found()
 {
     $id = 9999999999;
     $group = $this->groupRepo->groupOfId($id);
     $this->assertNull($group);
 }
示例#4
0
 public function eventsOfGroup($groupId)
 {
     $group = $this->groupRepo->groupOfId($groupId);
     return $this->calendarRepo->eventsOfGroup($group);
 }
 private function get1KA()
 {
     $n_1KA = new Name('1KA');
     $group = $this->groupRepo->groupOfName($n_1KA);
     return $group;
 }