summaryrefslogtreecommitdiff
path: root/includes/model/ValidationResult.php
blob: b08e9d31eef5a0f0f72e5ed74c76bc0a9134aca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?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;
    }
}