Repository fix
This commit is contained in:
18
app/model/Database/Repository/DictTypeRepository.php
Normal file
18
app/model/Database/Repository/DictTypeRepository.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Model\Database\Repository;
|
||||
|
||||
use App\Model\Database\Entity\DictType;
|
||||
|
||||
/**
|
||||
* @method DictType|NULL find($id, ?int $lockMode = NULL, ?int $lockVersion = NULL)
|
||||
* @method DictType|NULL findOneBy(array $criteria, array $orderBy = NULL)
|
||||
* @method DictType[] findAll()
|
||||
* @method DictType[] findBy(array $criteria, array $orderBy = NULL, ?int $limit = NULL, ?int $offset = NULL)
|
||||
* @extends AbstractRepository<DictType>
|
||||
*/
|
||||
class DictTypeRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
namespace App;
|
||||
|
||||
use Kdyby;
|
||||
use Nette;
|
||||
|
||||
class DictTypes extends Nette\Object
|
||||
{
|
||||
private $em;
|
||||
private $dicttypes;
|
||||
|
||||
public function __construct(Kdyby\Doctrine\EntityManager $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->dicttypes = $em->getRepository(DictType::class);
|
||||
}
|
||||
|
||||
public function find($value)
|
||||
{
|
||||
return $this->dicttypes->find($value);
|
||||
}
|
||||
|
||||
|
||||
public function findBy($criteria = [],$orderBy = [])
|
||||
{
|
||||
return $this->dicttypes->findBy($criteria,$orderBy);
|
||||
}
|
||||
|
||||
public function findPairs($criteria,$value,$orderBy,$key)
|
||||
{
|
||||
return $this->dicttypes->findPairs($criteria,$value,$orderBy,$key);
|
||||
}
|
||||
|
||||
public function findAssoc($criteria, $key = NULL)
|
||||
{
|
||||
return $this->dicttypes->findAssoc($criteria,$key);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
namespace App;
|
||||
|
||||
use Kdyby;
|
||||
use Nette;
|
||||
|
||||
class Dictionaries extends Nette\Object
|
||||
{
|
||||
private $em;
|
||||
private $dictionaries;
|
||||
|
||||
public function __construct(Kdyby\Doctrine\EntityManager $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->dictionaries = $em->getRepository(Dictionary::class);
|
||||
}
|
||||
|
||||
public function findAll($criteria = [],$orderBy = [])
|
||||
{
|
||||
return $this->dictionaries->findBy($criteria,$orderBy);
|
||||
}
|
||||
|
||||
public function findPairs($criteria,$value,$orderBy,$key)
|
||||
{
|
||||
return $this->dictionaries->findPairs($criteria,$value,$orderBy,$key);
|
||||
}
|
||||
}
|
||||
18
app/model/Database/Repository/DictionaryRepository.php
Normal file
18
app/model/Database/Repository/DictionaryRepository.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Model\Database\Repository;
|
||||
|
||||
use App\Model\Database\Entity\Dictionary;
|
||||
|
||||
/**
|
||||
* @method Dictionary|NULL find($id, ?int $lockMode = NULL, ?int $lockVersion = NULL)
|
||||
* @method Dictionary|NULL findOneBy(array $criteria, array $orderBy = NULL)
|
||||
* @method Dictionary[] findAll()
|
||||
* @method Dictionary[] findBy(array $criteria, array $orderBy = NULL, ?int $limit = NULL, ?int $offset = NULL)
|
||||
* @extends AbstractRepository<Dictionary>
|
||||
*/
|
||||
class DictionaryRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
16
app/model/Database/Repository/PronunciationRepository.php
Normal file
16
app/model/Database/Repository/PronunciationRepository.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Model\Database\Repository;
|
||||
|
||||
use App\Model\Database\Entity\Pronunciation;
|
||||
/**
|
||||
* @method Pronunciation|NULL find($id, ?int $lockMode = NULL, ?int $lockVersion = NULL)
|
||||
* @method Pronunciation|NULL findOneBy(array $criteria, array $orderBy = NULL)
|
||||
* @method Pronunciation[] findAll()
|
||||
* @method Pronunciation[] findBy(array $criteria, array $orderBy = NULL, ?int $limit = NULL, ?int $offset = NULL)
|
||||
* @extends AbstractRepository<Pronunciation>
|
||||
*/
|
||||
class PronunciationRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
namespace App;
|
||||
|
||||
use Kdyby;
|
||||
use Nette;
|
||||
|
||||
class Pronunciations extends Nette\Object
|
||||
{
|
||||
private $em;
|
||||
private $pronunciations;
|
||||
|
||||
public function __construct(Kdyby\Doctrine\EntityManager $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->pronunciations = $em->getRepository(Pronunciation::class);
|
||||
}
|
||||
|
||||
public function find($value)
|
||||
{
|
||||
return $this->pronunciations->find($value);
|
||||
}
|
||||
|
||||
|
||||
public function findBy($criteria = [],$orderBy = [])
|
||||
{
|
||||
return $this->pronunciations->findBy($criteria,$orderBy);
|
||||
}
|
||||
|
||||
public function findPairs($criteria,$value,$orderBy,$key)
|
||||
{
|
||||
return $this->pronunciations->findPairs($criteria,$value,$orderBy,$key);
|
||||
}
|
||||
}
|
||||
18
app/model/Database/Repository/TermFlagRepository.php
Normal file
18
app/model/Database/Repository/TermFlagRepository.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Model\Database\Repository;
|
||||
|
||||
use App\Model\Database\Entity\TermFlag;
|
||||
|
||||
/**
|
||||
* @method TermFlag|NULL find($id, ?int $lockMode = NULL, ?int $lockVersion = NULL)
|
||||
* @method TermFlag|NULL findOneBy(array $criteria, array $orderBy = NULL)
|
||||
* @method TermFlag[] findAll()
|
||||
* @method TermFlag[] findBy(array $criteria, array $orderBy = NULL, ?int $limit = NULL, ?int $offset = NULL)
|
||||
* @extends AbstractRepository<TermFlag>
|
||||
*/
|
||||
class TermFlagRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
namespace App;
|
||||
|
||||
use Kdyby;
|
||||
use Nette;
|
||||
|
||||
class TermFlags extends Nette\Object
|
||||
{
|
||||
private $em;
|
||||
private $termFlags;
|
||||
|
||||
public function __construct(Kdyby\Doctrine\EntityManager $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->termFlags = $em->getRepository(TermFlag::class);
|
||||
}
|
||||
|
||||
public function find($value)
|
||||
{
|
||||
return $this->termFlags->find($value);
|
||||
}
|
||||
|
||||
public function findBy($criteria = [],$orderBy = [])
|
||||
{
|
||||
return $this->termFlags->findBy($criteria,$orderBy);
|
||||
}
|
||||
|
||||
public function findPairs($criteria,$value,$orderBy,$key)
|
||||
{
|
||||
return $this->termFlags->findPairs($criteria,$value,$orderBy,$key);
|
||||
}
|
||||
|
||||
public function findAssoc($criteria,$key)
|
||||
{
|
||||
return $this->termFlags->findAssoc($criteria,$key);
|
||||
}
|
||||
}
|
||||
18
app/model/Database/Repository/TermRepository.php
Normal file
18
app/model/Database/Repository/TermRepository.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Model\Database\Repository;
|
||||
|
||||
use App\Model\Database\Entity\Term;
|
||||
|
||||
/**
|
||||
* @method Term|NULL find($id, ?int $lockMode = NULL, ?int $lockVersion = NULL)
|
||||
* @method Term|NULL findOneBy(array $criteria, array $orderBy = NULL)
|
||||
* @method Term[] findAll()
|
||||
* @method Term[] findBy(array $criteria, array $orderBy = NULL, ?int $limit = NULL, ?int $offset = NULL)
|
||||
* @extends AbstractRepository<Term>
|
||||
*/
|
||||
class TermRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
16
app/model/Database/Repository/TranslationRepository.php
Normal file
16
app/model/Database/Repository/TranslationRepository.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Model\Database\Repository;
|
||||
|
||||
use App\Model\Database\Entity\Translation;
|
||||
/**
|
||||
* @method Translation|NULL find($id, ?int $lockMode = NULL, ?int $lockVersion = NULL)
|
||||
* @method Translation|NULL findOneBy(array $criteria, array $orderBy = NULL)
|
||||
* @method Translation[] findAll()
|
||||
* @method Translation[] findBy(array $criteria, array $orderBy = NULL, ?int $limit = NULL, ?int $offset = NULL)
|
||||
* @extends AbstractRepository<Translation>
|
||||
*/
|
||||
class TranslationRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
namespace App;
|
||||
|
||||
use Kdyby;
|
||||
use Nette;
|
||||
|
||||
class Translations extends Nette\Object
|
||||
{
|
||||
private $em;
|
||||
private $translations;
|
||||
|
||||
public function __construct(Kdyby\Doctrine\EntityManager $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->translations = $em->getRepository(Translation::class);
|
||||
}
|
||||
|
||||
public function find($value)
|
||||
{
|
||||
return $this->translations->find($value);
|
||||
}
|
||||
|
||||
|
||||
public function findBy($criteria = [],$orderBy = [])
|
||||
{
|
||||
return $this->translations->findBy($criteria,$orderBy);
|
||||
}
|
||||
|
||||
public function findPairs($criteria,$value,$orderBy,$key)
|
||||
{
|
||||
return $this->translations->findPairs($criteria,$value,$orderBy,$key);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,14 @@
|
||||
namespace App\Model\Database;
|
||||
|
||||
use App\Model\Database\Entity\User;
|
||||
use App\Model\Database\Entity\Translation;
|
||||
use App\Model\Database\Repository\UserRepository;
|
||||
use App\Model\Database\Repository\TranslationRepository;
|
||||
use App\Model\Database\Repository\TermRepository;
|
||||
use App\Model\Database\Repository\TermFlagRepository;
|
||||
use App\Model\Database\Repository\PronunciationRepository;
|
||||
use App\Model\Database\Repository\DictTypeRepository;
|
||||
use App\Model\Database\Repository\DictionaryRepository;
|
||||
|
||||
/**
|
||||
* @mixin EntityManager
|
||||
@@ -16,4 +23,34 @@ trait TRepositories
|
||||
return $this->getRepository(User::class);
|
||||
}
|
||||
|
||||
public function getTranslationRepository(): TranslationRepository
|
||||
{
|
||||
return $this->getRepository(Translation::class);
|
||||
}
|
||||
|
||||
public function getTermRepository(): TermRepository
|
||||
{
|
||||
return $this->getRepository(Term::class);
|
||||
}
|
||||
|
||||
public function getTermFlagRepository(): TermFlagRepository
|
||||
{
|
||||
return $this->getRepository(TermFlag::class);
|
||||
}
|
||||
|
||||
public function getPronunciationRepository(): PronunciationRepository
|
||||
{
|
||||
return $this->getRepository(Pronunciation::class);
|
||||
}
|
||||
|
||||
public function getDictTypeRepository(): DictTypeRepository
|
||||
{
|
||||
return $this->getRepository(DictType::class);
|
||||
}
|
||||
|
||||
public function getDictionaryRepository(): DictionaryRepository
|
||||
{
|
||||
return $this->getRepository(Dictionary::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user