Class ActiveRecord_BoundsValidation

Description

A validation to check that an attribute's string length is within a certain range.

Located in /activerecord/lib/ActiveRecord/Validation.php (line 179)

ActiveRecord_Validation
   |
   --ActiveRecord_BoundsValidation
Variable Summary
 mixed $allowNull
 mixed $attrNames
 mixed $longMsg
 mixed $lowerBound
 mixed $shortMsg
 mixed $upperBound
Method Summary
 ActiveRecord_BoundsValidation __construct (array $attrNames, int $lowerBound, int $upperBound, [string $shortMsg = false], [string $longMsg = false], [bool $allowNull = false], [int $type = ActiveRecord_Validation::ON_SAVE], [string $condition = false])
Variables
mixed $allowNull (line 203)

Flag indicating whether nulls are allowed

  • access: protected
mixed $attrNames (line 183)

List of attribute names to validate

  • access: protected
mixed $longMsg (line 187)

Error message to use for attributes that are too long

  • access: protected
mixed $lowerBound (line 195)

Minimum size

  • access: protected
mixed $shortMsg (line 191)

Error message to use for attributes that are too short

  • access: protected
mixed $upperBound (line 199)

Maximum size

  • access: protected

Inherited Variables

Inherited from ActiveRecord_Validation

ActiveRecord_Validation::$condition
ActiveRecord_Validation::$type
Methods
Constructor __construct (line 217)

Constructor

  • access: public
ActiveRecord_BoundsValidation __construct (array $attrNames, int $lowerBound, int $upperBound, [string $shortMsg = false], [string $longMsg = false], [bool $allowNull = false], [int $type = ActiveRecord_Validation::ON_SAVE], [string $condition = false])
  • array $attrNames: An array of attribute names to validate
  • int $lowerBound: The miminum size
  • int $upperBound: The maximum size
  • string $shortMsg: Error message to use for short attributes
  • string $longMsg: Error message to use for long attributes
  • bool $allowNull: If true and the value is null, validation is skipped
  • int $type: The validation type (ON_SAVE, ON_CREATE, or ON_UPDATE)
  • string $condition: Optional method to call for determining whether to run the validation or not

Redefinition of:
ActiveRecord_Validation::__construct()
Constructor
validate (line 235)

Validate the object provided. If the object is invalid, it is the responsibility of this method to add any errors appropriate to the object's error collection.

  • access: public
void validate (ActiveRecord_Base $obj)

Redefinition of:
ActiveRecord_Validation::validate()
Validate the object provided. If the object is invalid, it is the responsibility of this method to add any errors appropriate to the object's error collection.

Inherited Methods

Inherited From ActiveRecord_Validation

 ActiveRecord_Validation::__construct()
 ActiveRecord_Validation::should_validate()
 ActiveRecord_Validation::validate()
Class Constants

Documentation generated on Wed, 25 Apr 2012 09:46:45 -0700 by phpDocumentor 1.4.3