| 1 |
lars |
1 |
<?php
|
|
|
2 |
/*
|
|
|
3 |
* $Id: ValidatorMap.php 1262 2009-10-26 20:54:39Z francois $
|
|
|
4 |
*
|
|
|
5 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
6 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
7 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
8 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
9 |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
10 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
11 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
12 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
13 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
14 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
15 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
16 |
*
|
|
|
17 |
* This software consists of voluntary contributions made by many individuals
|
|
|
18 |
* and is licensed under the LGPL. For more information please see
|
|
|
19 |
* <http://propel.phpdb.org>.
|
|
|
20 |
*/
|
|
|
21 |
|
|
|
22 |
/**
|
|
|
23 |
* ValidatorMap is used to model a column validator.
|
|
|
24 |
*
|
|
|
25 |
* GENERAL NOTE
|
|
|
26 |
* ------------
|
|
|
27 |
* The propel.map classes are abstract building-block classes for modeling
|
|
|
28 |
* the database at runtime. These classes are similar (a lite version) to the
|
|
|
29 |
* propel.engine.database.model classes, which are build-time modeling classes.
|
|
|
30 |
* These classes in themselves do not do any database metadata lookups.
|
|
|
31 |
*
|
|
|
32 |
* @author Michael Aichler <aichler@mediacluster.de>
|
|
|
33 |
* @version $Revision: 1262 $
|
|
|
34 |
* @package propel.map
|
|
|
35 |
*/
|
|
|
36 |
class ValidatorMap
|
|
|
37 |
{
|
|
|
38 |
/** rule name of this validator */
|
|
|
39 |
private $name;
|
|
|
40 |
/** the dot-path to class to use for validator */
|
|
|
41 |
private $classname;
|
|
|
42 |
/** value to check against */
|
|
|
43 |
private $value;
|
|
|
44 |
/** execption message thrown on invalid input */
|
|
|
45 |
private $message;
|
|
|
46 |
/** related column */
|
|
|
47 |
private $column;
|
|
|
48 |
|
|
|
49 |
public function __construct($containingColumn)
|
|
|
50 |
{
|
|
|
51 |
$this->column = $containingColumn;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public function getColumn()
|
|
|
55 |
{
|
|
|
56 |
return $this->column;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public function getColumnName()
|
|
|
60 |
{
|
|
|
61 |
return $this->column->getColumnName();
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
public function setName($name)
|
|
|
65 |
{
|
|
|
66 |
$this->name = $name;
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
public function setClass($classname)
|
|
|
70 |
{
|
|
|
71 |
$this->classname = $classname;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
public function setValue($value)
|
|
|
75 |
{
|
|
|
76 |
$this->value = $value;
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
public function setMessage($message)
|
|
|
80 |
{
|
|
|
81 |
$this->message = $message;
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
public function getName()
|
|
|
85 |
{
|
|
|
86 |
return $this->name;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
public function getClass()
|
|
|
90 |
{
|
|
|
91 |
return $this->classname;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
public function getValue()
|
|
|
95 |
{
|
|
|
96 |
return $this->value;
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
public function getMessage()
|
|
|
100 |
{
|
|
|
101 |
return $this->message;
|
|
|
102 |
}
|
|
|
103 |
}
|