From 31e603aa96f3227e0c43d30cb28776ac0ce1e042 Mon Sep 17 00:00:00 2001 From: webeweb Date: Wed, 12 Sep 2018 11:37:14 +0200 Subject: [PATCH] Update README --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 85852c08..e85e3414 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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": @@ -371,7 +375,7 @@ class EmployeeDataTablesProvider implements DataTablesProviderInterface, DataTab break; case "salary": - $entity->setSalary($value); + $entity->setSalary(intval($value)); break; case "startDate":