diff options
Diffstat (limited to 'src/model/Model.php')
| -rw-r--r-- | src/model/Model.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/model/Model.php b/src/model/Model.php index 16061e7..68c4c08 100644 --- a/src/model/Model.php +++ b/src/model/Model.php | |||
| @@ -203,6 +203,17 @@ class Model | |||
| 203 | return true; | 203 | return true; |
| 204 | } | 204 | } |
| 205 | } | 205 | } |
| 206 | public function getWhatever(string $class, string $field, string $value): array | ||
| 207 | { | ||
| 208 | // penser au entityManager "repository" | ||
| 209 | $queryBuilder = $this->entityManager->createQueryBuilder(); | ||
| 210 | $queryBuilder | ||
| 211 | ->select('n') | ||
| 212 | ->from($class, 'n') | ||
| 213 | ->where("n.$field = :value") | ||
| 214 | ->setParameter('value', $value); | ||
| 215 | return $queryBuilder->getQuery()->getResult(); | ||
| 216 | } | ||
| 206 | 217 | ||
| 207 | // récupération d'un article pour modification | 218 | // récupération d'un article pour modification |
| 208 | public function makeArticleNode(string $id = '', bool $get_section = false): bool | 219 | public function makeArticleNode(string $id = '', bool $get_section = false): bool |
