Loading module/Application/src/Application/Entity/Db/Repository/IndividuRepository.php +6 −1 Changes for module/Application/src/Application/Entity/Db/Repository/IndividuRepository.php: 6 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -25,11 +25,12 @@ class IndividuRepository extends DefaultEntityRepository * Recherche d'individu, en SQL pure. * * @param string $text * @param string $type (doctorant, acteur, ...) * @param integer $limit * * @return array */ public function findByText($text, $limit = 100) public function findByText($text, $type = null, $limit = 100) { if (strlen($text) < 2) return []; Loading @@ -37,6 +38,10 @@ class IndividuRepository extends DefaultEntityRepository $criteres = explode(' ', $text); $sql = sprintf('SELECT * FROM INDIVIDU i JOIN INDIVIDU_RECH ir on ir.id = i.id WHERE rownum <= %s ', (int)$limit); if ($type !== null) { $sql = sprintf('SELECT * FROM INDIVIDU i JOIN INDIVIDU_RECH ir on ir.id = i.id WHERE i.type = \'%s\' AND rownum <= %s ', $type, (int)$limit); $tmp = null; } $sqlCri = []; foreach ($criteres as $c) { Loading Loading
module/Application/src/Application/Entity/Db/Repository/IndividuRepository.php +6 −1 Changes for module/Application/src/Application/Entity/Db/Repository/IndividuRepository.php: 6 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -25,11 +25,12 @@ class IndividuRepository extends DefaultEntityRepository * Recherche d'individu, en SQL pure. * * @param string $text * @param string $type (doctorant, acteur, ...) * @param integer $limit * * @return array */ public function findByText($text, $limit = 100) public function findByText($text, $type = null, $limit = 100) { if (strlen($text) < 2) return []; Loading @@ -37,6 +38,10 @@ class IndividuRepository extends DefaultEntityRepository $criteres = explode(' ', $text); $sql = sprintf('SELECT * FROM INDIVIDU i JOIN INDIVIDU_RECH ir on ir.id = i.id WHERE rownum <= %s ', (int)$limit); if ($type !== null) { $sql = sprintf('SELECT * FROM INDIVIDU i JOIN INDIVIDU_RECH ir on ir.id = i.id WHERE i.type = \'%s\' AND rownum <= %s ', $type, (int)$limit); $tmp = null; } $sqlCri = []; foreach ($criteres as $c) { Loading