Add image type + NotConserved
This commit is contained in:
43
src/Repository/DocumentRepository.php
Normal file
43
src/Repository/DocumentRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Document;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Document>
|
||||
*/
|
||||
class DocumentRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Document::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Document[] Returns an array of Document objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('d')
|
||||
// ->andWhere('d.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('d.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Document
|
||||
// {
|
||||
// return $this->createQueryBuilder('d')
|
||||
// ->andWhere('d.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
59
src/Repository/NotConservedRepository.php
Normal file
59
src/Repository/NotConservedRepository.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\NotConserved;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<NotConserved>
|
||||
*/
|
||||
class NotConservedRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, NotConserved::class);
|
||||
}
|
||||
|
||||
public function coordinates(int $id): array|bool
|
||||
{
|
||||
$conn = $this->getEntityManager()->getConnection();
|
||||
|
||||
$sql = '
|
||||
SELECT
|
||||
ST_X(ST_AsText(coordinate)) as lng,
|
||||
ST_Y(ST_AsText(coordinate)) as lat
|
||||
FROM
|
||||
non_conserv
|
||||
WHERE id = :id
|
||||
';
|
||||
|
||||
return $conn->executeQuery($sql, ['id' => $id])
|
||||
->fetchAssociative();
|
||||
}
|
||||
// /**
|
||||
// * @return NotConserved[] Returns an array of NotConserved objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('n')
|
||||
// ->andWhere('n.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('n.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?NotConserved
|
||||
// {
|
||||
// return $this->createQueryBuilder('n')
|
||||
// ->andWhere('n.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user