Changeset 3834

Show
Ignore:
Timestamp:
02/19/08 00:16:54 (17 months ago)
Author:
jwage
Message:

Fixed conservative model loading to actually be conservative. filterInvalidModels was causing classes to be loaded in both cases.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine.php

    r3804 r3834  
    579579        } 
    580580 
    581         return self::filterInvalidModels($loadedModels); 
     581        // We do not want to filter invalid models when using conservative model loading 
     582        // The filtering requires that the class be loaded and inflected in order to determine if it is  
     583        // a valid class. 
     584        if ($manager->getAttribute(Doctrine::ATTR_MODEL_LOADING) == Doctrine::MODEL_LOADING_CONSERVATIVE) { 
     585            return $loadedModels; 
     586        } else { 
     587            return self::filterInvalidModels($loadedModels); 
     588        } 
    582589    } 
    583590 
     
    606613     * filterInvalidModels 
    607614     * 
    608      * Filter through an array of classes and return all the classes that are valid models 
     615     * Filter through an array of classes and return all the classes that are valid models. 
     616     * This will inflect the class, causing it to be loaded in to memory. 
    609617     * 
    610618     * @param classes  Array of classes to filter through, otherwise uses get_declared_classes() 
     
    628636     * 
    629637     * Checks if what is passed is a valid Doctrine_Record 
     638     * Will load class in to memory in order to inflect it and find out information about the class 
    630639     * 
    631640     * @param   mixed   $class Can be a string named after the class, an instance of the class, or an instance of the class reflected