/**
  * @param Name $name
  * @param Kind $kind
  * @return ArrayCollection
  */
 public function partiesLikeNameAndKind(Name $name, Kind $kind)
 {
     $qb = $this->em->createQueryBuilder();
     $query = $qb->select('p')->from($this->partyClass, 'p')->join('p.kind', 'k')->where($qb->expr()->eq('k.id', '?1'), $qb->expr()->like('p.lastName', '?2'))->setParameter(1, $kind->id())->setParameter(2, '%' . $name->toString() . '%');
     $parties = $query->getQuery()->getResult();
     return $parties;
 }
Esempio n. 2
0
 /**
  * @return Name
  */
 public function name()
 {
     return Name::fromNative($this->name);
 }
Esempio n. 3
0
 /**
  * @return Asset
  */
 private function getAsset()
 {
     $klimtoren = $this->getKlimtoren();
     $guid = Guid::generate();
     $name = new Name('image-1.jpg');
     $mime = 'image/jpeg';
     $asset = new Asset($guid, $name, $mime, $klimtoren);
     $asset->setTitle($name->toString());
     return $asset;
 }
Esempio n. 4
0
 /**
  * @return Name
  */
 public function lastName()
 {
     return Name::fromNative($this->lastName);
 }
Esempio n. 5
0
 /**
  * @test
  * @group email
  */
 public function should_return_string()
 {
     $name = new Name('Karl Van Iseghem');
     $this->assertEquals('Karl Van Iseghem', $name->toString());
     $this->assertEquals('Karl Van Iseghem', (string) $name);
 }
 /**
  * @test
  * @group currrepo
  */
 public function should_return_null_when_no_structure_found()
 {
     $n_maths = new Name('wiskunde');
     $course = $this->courseRepo->courseOfName($n_maths);
     $curr = $this->currRepo->curriculumOfCourse($course);
     $n_struc = new Name('chapter 2');
     $structure = $this->currRepo->structure($curr, null, $n_struc->toString(), 'chapter');
     $this->assertNull($structure);
 }