diff options
Diffstat (limited to 'includes/model')
-rw-r--r-- | includes/model/AngelType_model.php | 1 | ||||
-rw-r--r-- | includes/model/User_model.php | 1 | ||||
-rw-r--r-- | includes/model/ValidationResult.php | 42 |
3 files changed, 44 insertions, 0 deletions
diff --git a/includes/model/AngelType_model.php b/includes/model/AngelType_model.php index 86d64504..34da4db7 100644 --- a/includes/model/AngelType_model.php +++ b/includes/model/AngelType_model.php @@ -1,4 +1,5 @@ <?php +use Engelsystem\ValidationResult; /** * Returns an array containing the basic attributes of angeltypes. diff --git a/includes/model/User_model.php b/includes/model/User_model.php index c1376abd..13695821 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -1,4 +1,5 @@ <?php +use Engelsystem\ValidationResult; /** * User model diff --git a/includes/model/ValidationResult.php b/includes/model/ValidationResult.php new file mode 100644 index 00000000..0fc24161 --- /dev/null +++ b/includes/model/ValidationResult.php @@ -0,0 +1,42 @@ +<?php + +namespace Engelsystem; + +/** + * BO that represents the result of an entity attribute validation. + * It contains the validated value and a bool for validation success. + */ +class ValidationResult { + + private $valid; + + private $value; + + /** + * Constructor. + * + * @param boolean $valid + * Is the value valid? + * @param * $value + * The validated value + */ + public function __construct($valid, $value) { + $this->valid = $valid; + $this->value = $value; + } + + /** + * Is the value valid? + */ + public function isValid() { + return $this->valid; + } + + /** + * The parsed/validated value. + */ + public function getValue() { + return $this->value; + } +} +?>
\ No newline at end of file |