Show
Ignore:
Timestamp:
11/01/07 19:45:36 (14 months ago)
Author:
jwage
Message:

Clean up, initial entry of root txt files, fixed a few broken unit tests. New documentation.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine.php

    r3038 r3048  
    487487 
    488488    /** 
    489      * loadAll 
    490      * loads all runtime classes 
    491      * 
    492      * @return void 
    493      */ 
    494     public static function loadAll() 
    495     { 
    496         return self::loadAllRuntimeClasses(); 
    497     } 
    498  
    499     /** 
    500      * importSchema 
    501      * method for importing existing schema to Doctrine_Record classes 
    502      * 
    503      * @param string $directory Directory to write your models to 
    504      * @param array $databases Array of databases to generate models for 
    505      * @return boolean 
    506      */ 
    507     public static function importSchema($directory, array $databases = array()) 
    508     { 
    509         return self::generateModelsFromDb($directory, $databases); 
    510     } 
    511  
    512     /** 
    513      * exportSchema 
    514      * method for exporting Doctrine_Record classes to a schema 
    515      * 
    516      * @param string $directory Directory containing your models 
    517      * @return void 
    518      */ 
    519     public static function exportSchema($directory = null) 
    520     { 
    521         return self::createTablesFromModels($directory); 
    522     } 
    523  
    524     /** 
    525      * exportSql 
    526      * method for exporting Doctrine_Record classes to a schema 
    527      * 
    528      * @param string $directory 
    529      */ 
    530     public static function exportSql($directory = null) 
    531     { 
    532         return self::generateSqlFromModels($directory); 
    533     } 
    534  
    535     /** 
    536      * loadAllRuntimeClasses 
    537      * 
    538      * loads all runtime classes 
    539      * 
    540      * @return void 
    541      */ 
    542     public static function loadAllRuntimeClasses() 
    543     { 
    544         $classes = Doctrine_Compiler::getRuntimeClasses(); 
    545  
    546         foreach ($classes as $class) { 
    547             self::autoload($class); 
    548         } 
    549     } 
    550  
    551     /** 
    552489     * loadModels 
    553490     * 
     
    593530        if ($classes === null) { 
    594531            $classes = get_declared_classes(); 
     532            $classes = array_merge($classes, array_keys(self::$_loadedModels)); 
    595533        } 
    596534         
     
    694632    { 
    695633        $import = new Doctrine_Import_Schema(); 
    696         $import->setOption('generateBaseClasses', true); 
     634        $import->setOptions($options); 
    697635         
    698636        return $import->importSchema($yamlPath, 'yml', $directory); 
     
    862800 
    863801    /** 
    864      * loadDummyData 
    865      * 
    866      * Populdate your models with dummy data 
    867      * 
    868      * @param string $append Whether or not to append the data 
    869      * @param string $num Number of records to populate 
    870      * @return void 
    871      */ 
    872     public static function loadDummyData($append, $num = 5) 
    873     { 
    874         $data = new Doctrine_Data(); 
    875  
    876         if ( ! $append) { 
    877           $data->purge(); 
    878         } 
    879          
    880         return $data->importDummyData($num); 
    881     } 
    882  
    883     /** 
    884802     * migrate 
    885803     *  
     
    953871 
    954872    /** 
    955      * connection 
    956      * 
    957      * @param string $adapter  
    958      * @param string $name  
    959      * @return void 
    960      */ 
    961     public static function connection($adapter, $name = null) 
    962     { 
    963         return Doctrine_Manager::connection($adapter, $name); 
    964     } 
    965  
    966     /** 
    967873     * fileFinder 
    968874     * 
     
    983889     * 
    984890     * @param string $target 
    985      * 
     891     * @param array  $includedDrivers 
    986892     * @throws Doctrine_Exception 
    987893     * @return void