small fixes
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Model\Database\Entity\Attributes\TId;
|
||||
* @ORM\Entity(repositoryClass="App\Model\Database\Repository\SuffixRepository")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*
|
||||
* @property int $id
|
||||
* @property String $text
|
||||
*/
|
||||
class Suffix extends AbstractEntity
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Model\Database\Entity\Attributes\TId;
|
||||
* @ORM\Table(name="`translation`")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*
|
||||
* @property int $id
|
||||
* @property Dictionary $dictionary
|
||||
* @property Language $lang1
|
||||
* @property Language $lang2
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Model\Database\Facade;
|
||||
|
||||
use App\Model\Database\Entity\Dictionary;
|
||||
use App\Model\Database\Entity\Term;
|
||||
use App\Model\Database\Entity\Translation;
|
||||
use App\Model\Database\EntityManager;
|
||||
|
||||
|
||||
@@ -27,7 +29,7 @@ class TermFacade
|
||||
/**
|
||||
* @param mixed[] $data
|
||||
*/
|
||||
public function findByString()
|
||||
public function findByString(String $term,Dictionary $d,String $clen = null)
|
||||
{
|
||||
$query = $this->em->createQueryBuilder('t')->select('t')
|
||||
->addSelect('s1')
|
||||
@@ -36,18 +38,18 @@ class TermFacade
|
||||
->leftJoin('t.suffix1','s1')
|
||||
->leftJoin('t.suffix2','s2');
|
||||
if ($this->direction == 1) {
|
||||
$query->where('t.string1 LIKE :str')->setParameter('str',"test"."%");
|
||||
$query->where('t.string1 LIKE :str')->setParameter('str', $term."%");
|
||||
$query->orderBy('t.string1,t.id','ASC');
|
||||
} else if ($this->direction == 2) {
|
||||
$query->where('t.string2 LIKE :str')->setParameter('str', "test"."%");
|
||||
$query->where('t.string2 LIKE :str')->setParameter('str', $term."%");
|
||||
$query->orderBy('t.string2','ASC');
|
||||
$query->addOrderBy('t.order2','ASC');
|
||||
}
|
||||
$query->andWhere('t.dictionary = :dict')->setParameter(':dict',1);
|
||||
//if ($this->clen)
|
||||
// $query->andWhere('t.member LIKE :clen')->setParameter('clen','%'."".'%');
|
||||
$query->andWhere('t.dictionary = :dict')->setParameter(':dict',$d->id);
|
||||
if ($clen)
|
||||
$query->andWhere('t.member LIKE :clen')->setParameter('clen','%'.$clen.'%');
|
||||
|
||||
return $query->getQuery()->getResult();
|
||||
return $query->getQuery();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user