Skip to content

Commit

Permalink
Podpora pro název komponenty v množném čísle
Browse files Browse the repository at this point in the history
  • Loading branch information
honza@appsdevteam.com committed Mar 22, 2019
1 parent c6169e9 commit a04eaea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Components/AjaxSelect/Services/AjaxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public function createEntity($entityName, AjaxSelect\Interfaces\IAjaxServiceCont
} else {
// check factory
if (!isset($this->entityFactories[$entityName])) {
throw new \Nette\InvalidArgumentException("Unknown entity name: $entityName");
$entityName = preg_replace('/(es|ies|s)$/', '', $entityName);

if (!isset($this->entityFactories[$entityName])) {
throw new \Nette\InvalidArgumentException("Unknown entity name: $entityName");
}
}

// create instance
Expand Down

0 comments on commit a04eaea

Please sign in to comment.