Database
DAO#
The first step is to write a query in a DAO class. For instance:
src/api/src/Domain/Dao/UserDao.php
Here we have:
- A random filter, the
$searchstring. - A predictable filter, the
$roleenum. - A sort direction and a sort column.
All the arguments are optional (= null).
note
📣  If a parameter's value is null, TDBM
automatically removes the corresponding conditions in the first argument of the find method.
ResultIterator#
Thanks to the ResultIterator class, you may retrieve a precise scope of the resulting data:
note
📣  Most of the time, you won't have to explicitly call the take method
thanks to GraphQLite. More on that in the next chapter.
Enum#
The folder src/api/src/Domain/Enum contains our enums.
Each enum's key (i.e., FIRST_NAME) is a GraphQL value, while each enum's value (i.e., first_name)
is a valid SQL expression.
Most enums are for:
- Sort by values.
- Business data.