summaryrefslogtreecommitdiff
path: root/includes/model/ValidationResult.php
blob: 0fc2416160ef46b61020eb79f187149e058fa819 (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
<?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;
  }
}
?>