/**
  * @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;
 }
示例#2
0
 /**
  * @param Name name
  * @return void
  */
 public function setName(Name $name)
 {
     $this->name = $name->toString();
 }
示例#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;
 }
示例#4
0
文件: Party.php 项目: bakgat/notos
 /**
  * @param Name lastName
  * @return void
  */
 public function setLastName(Name $lastName)
 {
     $this->lastName = $lastName->toString();
 }
示例#5
0
文件: NameTest.php 项目: bakgat/notos
 /**
  * @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);
 }