Changeset 2979
- Timestamp:
- 10/07/08 10:56:57 (3 months ago)
- Location:
- branches/dominik-validation-argument-sources/src/validator
- Files:
-
- 4 modified
-
AgaviValidationArgument.class.php (modified) (5 diffs)
-
AgaviValidationArgumentResult.class.php (modified) (7 diffs)
-
AgaviValidationResult.class.php (modified) (1 diff)
-
AgaviValidationValidatorResult.class.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/dominik-validation-argument-sources/src/validator/AgaviValidationArgument.class.php
r2881 r2979 15 15 16 16 /** 17 * AgaviValidationError stores the incidents of an validation run. 17 * AgaviValidationArgument is a tupel of argument name and source that specifies 18 * the argument to validate. 18 19 * 19 20 * @package agavi … … 30 31 class AgaviValidationArgument 31 32 { 33 /** 34 * @var string the name of the argument 35 */ 32 36 protected $name; 37 38 /** 39 * @var string the name of the source 40 */ 33 41 protected $source; 34 42 43 /** 44 * create a new AgaviValidationArgument 45 * 46 * @param string the name of the argument 47 * @param string the name of the source, if null, AgaviRequestDataHolder::SOURCE_PARAMETERS is used 48 * 49 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 50 * @copyright Authors 51 * @copyright The Agavi Project 52 * 53 * @since 1.0.0 54 */ 35 55 public function __construct($name, $source = null) 36 56 { … … 42 62 } 43 63 64 /** 65 * retrieve the name of the argument 66 * 67 * @return string 68 * 69 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 70 * @copyright Authors 71 * @copyright The Agavi Project 72 * 73 * @since 1.0.0 74 */ 44 75 public function getName() 45 76 { … … 47 78 } 48 79 80 /** 81 * retrieve the name of the source 82 * 83 * @return string 84 * 85 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 86 * @copyright Authors 87 * @copyright The Agavi Project 88 * 89 * @since 1.0.0 90 */ 49 91 public function getSource() 50 92 { … … 52 94 } 53 95 96 /** 97 * get a unique hash value for this AgaviValidationArgument 98 * 99 * @return string 100 * 101 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 102 * @copyright Authors 103 * @copyright The Agavi Project 104 * 105 * @since 1.0.0 106 */ 54 107 public function getHash() 55 108 { -
branches/dominik-validation-argument-sources/src/validator/AgaviValidationArgumentResult.class.php
r2881 r2979 15 15 16 16 /** 17 * AgaviValidation Error stores the incidents of an validation run.17 * AgaviValidationArgumentResult stores the result of a validation run for the given argument. 18 18 * 19 19 * @package agavi … … 30 30 class AgaviValidationArgumentResult 31 31 { 32 /** 33 * @var AgaviValidationResult the validation result 34 */ 32 35 protected $validationResult; 36 /** 37 * @var AgaviValidationArgument the argument 38 */ 33 39 protected $argument; 34 40 41 /** 42 * create a new AgaviValidationArgumentResult 43 * 44 * @param AgaviValidationResult the result 45 * @param AgaviValidationArgument the argument the result is valid for 46 * 47 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 48 * @copyright Authors 49 * @copyright The Agavi Project 50 * 51 * @since 1.0.0 52 */ 35 53 public function __construct(AgaviValidationResult $result, AgaviValidationArgument $argument) 36 54 { … … 39 57 } 40 58 59 /** 60 * retrieve the argument 61 * 62 * @return AgaviValidationArgument 63 * 64 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 65 * @copyright Authors 66 * @copyright The Agavi Project 67 * 68 * @since 1.0.0 69 */ 41 70 public function getArgument() 42 71 { … … 44 73 } 45 74 75 /** 76 * retrieve the results severity 77 * 78 * @return integer 79 * 80 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 81 * @copyright Authors 82 * @copyright The Agavi Project 83 * 84 * @since 1.0.0 85 */ 46 86 public function getSeverity() 47 87 { … … 49 89 } 50 90 91 /** 92 * retrieve the incidents for this instances argument 93 * 94 * @return array an array of AgaviValidationIncidents 95 * 96 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 97 * @copyright Authors 98 * @copyright The Agavi Project 99 * 100 * @since 1.0.0 101 */ 51 102 public function getIncidents() 52 103 { … … 56 107 foreach($incident->getErrors() as $error) { 57 108 if($error->hasArgument($this->argument)) { 58 $affectedIncidents = $incident;109 $affectedIncidents[] = $incident; 59 110 } 60 111 } … … 63 114 } 64 115 116 /** 117 * retrieve the error messages for this instances argument 118 * 119 * @return array an array of error messages (strings) 120 * 121 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 122 * @copyright Authors 123 * @copyright The Agavi Project 124 * 125 * @since 1.0.0 126 */ 65 127 public function getErrorMessages() 66 128 { -
branches/dominik-validation-argument-sources/src/validator/AgaviValidationResult.class.php
r2970 r2979 15 15 16 16 /** 17 * AgaviValidation Error stores the incidents of anvalidation run.17 * AgaviValidationResult stores the result of a validation run. 18 18 * 19 19 * @package agavi -
branches/dominik-validation-argument-sources/src/validator/AgaviValidationValidatorResult.class.php
r2881 r2979 15 15 16 16 /** 17 * AgaviValidation Error stores the incidents of an validation run.17 * AgaviValidationValidatorResult provides access to the validation result for a given validator 18 18 * 19 19 * @package agavi … … 30 30 class AgaviValidationValidatorResult 31 31 { 32 /** 33 * @var AgaviValidationResult the result 34 */ 32 35 protected $validationResult; 36 37 /** 38 * @var string the affected validators name 39 */ 33 40 protected $validatorName; 34 41 42 /** 43 * create a new AgaviValidationValidatorResult 44 * 45 * @param AgaviValidationResult the validation result 46 * @param string the affected validators name 47 * 48 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 49 * @copyright Authors 50 * @copyright The Agavi Project 51 * 52 * @since 1.0.0 53 */ 35 54 public function __construct(AgaviValidationResult $result, $name) 36 55 { … … 39 58 } 40 59 60 /** 61 * retrieve the affected validators name 62 * 63 * @return string the validators name 64 * 65 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 66 * @copyright Authors 67 * @copyright The Agavi Project 68 * 69 * @since 1.0.0 70 */ 41 71 public function getValidatorName() 42 72 { … … 44 74 } 45 75 76 /** 77 * retrieve all AgaviValidationIncidents for this instances' validator 78 * 79 * @return array a collection of affected {@see AgaviValidationIncident} 80 * 81 * @author Dominik del Bondio <dominik.del.bondio@bitextender.com> 82 * @copyright Authors 83 * @copyright The Agavi Project 84 * 85 * @since 1.0.0 86 */ 46 87 public function getIncidents() 47 88 { … … 50 91 foreach($incidents as $incident) { 51 92 if($incident->getValidator()->getName() == $this->validatorName) { 52 $affectedIncidents = $incident;93 $affectedIncidents[] = $incident; 53 94 } 54 95 }

