Пример #1
0
 /**
  * @test
  * @group url
  */
 public function should_return_as_string()
 {
     $klimtoren = new URL('www.klimtoren.be');
     $this->assertEquals('http://www.klimtoren.be/', $klimtoren->toString());
     $this->assertEquals('http://www.klimtoren.be/', (string) $klimtoren);
 }
Пример #2
0
 /**
  * @param URL url
  * @return void
  */
 public function setUrl(URL $url)
 {
     $this->url = $url->toString();
 }
 /**
  * Find a website by it's url
  *
  * @param URL $URL
  * @return Website
  */
 public function websiteOfURL(URL $URL)
 {
     $qb = $this->em->createQueryBuilder();
     $qb->select('w, wo, l, t, i')->from($this->wsClass, 'w')->leftJoin('w.image', 'i')->leftJoin('w.objectives', 'wo')->leftJoin('wo.levels', 'l')->leftJoin('w.tags', 't')->where($qb->expr()->eq('w.url', '?1'))->setParameter(1, $URL->toString());
     return $qb->getQuery()->getOneOrNullResult();
 }