47 lines
902 B
PHP
47 lines
902 B
PHP
<?php
|
|
namespace App;
|
|
|
|
use Kdyby;
|
|
use Nette;
|
|
|
|
class Terms extends Nette\Object
|
|
{
|
|
private $em;
|
|
private $termsDao;
|
|
private $terms;
|
|
|
|
public function __construct(Kdyby\Doctrine\EntityManager $em)
|
|
{
|
|
$this->em = $em;
|
|
$this->terms = $em->getRepository(Term::class);
|
|
$this->termsDao = $em->getDao(Term::class);
|
|
}
|
|
|
|
public function findAll($criteria = [],$orderBy = [])
|
|
{
|
|
return $this->terms->findBy($criteria,$orderBy);
|
|
}
|
|
|
|
public function findBy($criteria = [],$orderBy = [])
|
|
{
|
|
return $this->terms->findBy($criteria,$orderBy);
|
|
}
|
|
|
|
public function find($id)
|
|
{
|
|
return $this->terms->find($id);
|
|
}
|
|
|
|
|
|
public function findPairs($criteria,$value,$orderBy,$key)
|
|
{
|
|
return $this->terms->findPairs($criteria,$value,$orderBy,$key);
|
|
}
|
|
|
|
public function fetch($query)
|
|
{
|
|
return $this->termsDao->fetch($query);
|
|
}
|
|
|
|
}
|