Table::getBy($conditions) method
Useful when searching by unique parameter (guaranteed or unwarranted). This would prevent spreading methods like:
/**
* @throws CompanyNotFound
*/
private function getCompanyBySlug(string $companySlug): CompanyRow
{
$companies = $this->table->findBy([CompaniesTable::SLUG => $companySlug]);
if (\count($companies) === 0) {
throw new CompanyNotFound();
}
\assert(\count($companies) === 1);
return \reset($companies);
}
Edited by Jan Kuchař