Class ActiveRecord_Association_BelongsToKeyValidation

Description

A validation for the foreign key field on a belongs_to relationship

Located in /activerecord/lib/ActiveRecord/Association/BelongsTo.php (line 9)

ActiveRecord_Validation
   |
   --ActiveRecord_Association_BelongsToKeyValidation
Variable Summary
 mixed $class_name
 mixed $foreign_key
 mixed $msg
Method Summary
 ActiveRecord_Association_BelongsToKeyValidation __construct (string $foreign_key, string $class_name, [string $msg = false], [int $type = ActiveRecord_Validation::ON_SAVE], [string $condition = false])
Variables
mixed $class_name (line 12)
  • access: protected
mixed $foreign_key (line 11)
  • access: protected
mixed $msg (line 10)
  • access: protected

Inherited Variables

Inherited from ActiveRecord_Validation

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

Constructor

  • access: public
ActiveRecord_Association_BelongsToKeyValidation __construct (string $foreign_key, string $class_name, [string $msg = false], [int $type = ActiveRecord_Validation::ON_SAVE], [string $condition = false])
  • string $foreign_key: The name of the foreign key field
  • string $class_name: The name of the associated class
  • string $msg: Error message to use
  • 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 37)

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:41 -0700 by phpDocumentor 1.4.3