Changeset 281 for trunk

Show
Ignore:
Timestamp:
02/03/07 08:05:41 (5 years ago)
Author:
john
Message:

update validate_builtin()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/active_record.php

    r278 r281  
    584584            # special Trax methods ... 
    585585            # ... first check for method names that match any of our explicitly 
    586             # declared associations for this model ( e.g. $this->has_many = array("movies" => null) ) ... 
     586            # declared associations for this model ( e.g. public $has_many = "movies" ) ... 
    587587            if(is_array($parameters[0])) { 
    588588                $parameters = $parameters[0];     
     
    28152815        foreach($this->builtin_validation_functions as $method_name) { 
    28162816            $validation_name = $this->$method_name; 
     2817            if(is_string($validation_name)) { 
     2818                $validation_name = explode(",", $validation_name);     
     2819            } 
    28172820            if(method_exists($this, $method_name) && is_array($validation_name)) { 
    28182821                foreach($validation_name as $attribute_name => $options) { 
    28192822                    if(!is_array($options)) { 
    2820                         $options = array();    
    2821                     } 
     2823                        $attribute_name = $options; 
     2824                        $options = array(); 
     2825                    }                
     2826                    $attribute_name = trim($attribute_name);      
    28222827                    $parameters = array(); 
    28232828                    $on = array_key_exists('on', $options) ?