Add some basic validation.

This commit is contained in:
Tim Schumacher 2014-09-25 23:18:45 +02:00
parent 80182644bc
commit 0a0fd1e8b0
4 changed files with 43 additions and 11 deletions

View file

@ -56,7 +56,11 @@ abstract class BaseEntity {
public function __set($name,$value) {
if (property_exists($this,$name)) {
$this->$name = $value;
if ($value == '') {
$this->$name = null;
} else {
$this->$name = $value;
}
return $this;
} else {
throw new \Exception("Property {$name} does not Exists");