Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Sep 12, 2018
1 parent f9e845c commit 31e603a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ use WBW\Bundle\JQuery\DataTablesBundle\API\DataTablesOptions;
use WBW\Bundle\JQuery\DataTablesBundle\Provider\DataTablesCSVExporterInterface;
use WBW\Bundle\JQuery\DataTablesBundle\Provider\DataTablesEditorInterface;
use WBW\Bundle\JQuery\DataTablesBundle\Provider\DataTablesProviderInterface;
use WBW\Library\Core\Exception\Argument\IntegerArgumentException;
/**
* Employee DataTables provider.
Expand All @@ -355,7 +356,10 @@ class EmployeeDataTablesProvider implements DataTablesProviderInterface, DataTab
switch ($dtColumn->getData()) {
case "age":
$entity->setAge($value);
if (1 !== preg_match("/[0-9]{1,}/", $value)) {
throw new IntegerArgumentException($value);
}
$entity->setAge(intval($value));
break;
case "name":
Expand All @@ -371,7 +375,7 @@ class EmployeeDataTablesProvider implements DataTablesProviderInterface, DataTab
break;
case "salary":
$entity->setSalary($value);
$entity->setSalary(intval($value));
break;
case "startDate":
Expand Down

0 comments on commit 31e603a

Please sign in to comment.