Skip to content
Snippets Groups Projects

Make nullability explicit (not only) in ArrayType and CompositeType

Merged Jiří Pudil requested to merge 27-explicit-nullability into master
All threads resolved!
+ 10
2
@@ -95,10 +95,18 @@ To retrieve a list of records that match given criteria, you can use the `findBy
$rows = $table->findBy($conditions, $orderBy, $paginator);
```
There is also a helper method to retrieve a *single* record that matches given criteria. It throws an exception when the query doesn't yield exactly one result:
There are also two pairs of helper methods to retrieve a *single* record that matches given criteria: `getOneBy()` and `findOneBy()` look for a unique record and throw an exception when the query yields more than one result. In addition, `getOneBy()` fails if no record is found, whereas `findOneBy()` returns null in such case.
```php
$row = $table->getBy($conditions);
$row = $table->getOneBy($conditions);
$rowOrNull = $table->findOneBy($conditions);
```
And `getFirstBy()` and `findFirstBy()` return the first record that matches given criteria, regardless of whether there are more of them in the table.
```php
$row = $table->getFirstBy($conditions, $orderBy);
$rowOrNull = $table->findFirstBy($conditions, $orderBy);
```
#### Conditions
Loading