Development

Changeset 3382

You must first sign up to be able to contribute.

Changeset 3382

Show
Ignore:
Timestamp:
02/01/07 08:34:56 (2 years ago)
Author:
fabien
Message:

api documentation in addon/propel folder (closes #1387 - patch from spascoe)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/addon/propel/sfPropelData.class.php

    r3153 r3382  
    1010 
    1111/** 
     12 * This class is the Propel implementation of sfData.  It interacts with the data source 
     13 * and loads data. 
    1214 * 
    1315 * @package    symfony 
     
    2224 
    2325  // symfony load-data (file|dir) 
     26  /** 
     27   * Loads data from a file or directory into a Propel data source 
     28   * 
     29   * @param mixed A file or directory path 
     30   * @param string The Propel connection name, default 'propel' 
     31   * 
     32   * @throws Exception If the database throws an error, rollback transaction and rethrows exception 
     33   */ 
    2434  public function loadData($directory_or_file = null, $connectionName = 'propel') 
    2535  { 
     
    4555  } 
    4656 
     57  /** 
     58   * Implements the abstract loadDataFromArray method and loads the data using the generated data model. 
     59   * 
     60   * @param array The data to be loaded into the data source 
     61   * 
     62   * @throws Exception If data is unnamed. 
     63   * @throws sfException If an object defined in the model does not exist in the data 
     64   * @throws sfException If a column that does not exist is referenced 
     65   */ 
    4766  public function loadDataFromArray($data) 
    4867  { 
     
    133152  } 
    134153 
     154  /** 
     155   * Clears existing data from the data source by reading the fixture files 
     156   * and deleting the existing data for only those classes that are mentioned 
     157   * in the fixtures. 
     158   * 
     159   * @param array The list of YAML files. 
     160   * 
     161   * @throws sfException If a class mentioned in a fixture can not be found 
     162   */ 
    135163  protected function doDeleteCurrentData($fixture_files) 
    136164  { 
     
    170198  } 
    171199 
     200  /** 
     201   * Loads the mappings for the classes 
     202   * 
     203   * @param string The name of a data object 
     204   * 
     205   * @throws sfException If the class cannot be found 
     206   */ 
    172207  protected function loadMapBuilder($class) 
    173208  { 
  • branches/1.0/lib/addon/sfData.class.php

    r3071 r3382  
    1010 
    1111/** 
     12 * This class defines the interface for interacting with data, as well 
     13 * as default implementations. 
    1214 * 
    1315 * @package    symfony 
     
    2325    $object_references = array(); 
    2426 
     27  /** 
     28   * Sets a flag to indicate if the current data in the database 
     29   * should be deleted before new data is loaded. 
     30   * 
     31   * @param boolean The flag value 
     32   */ 
    2533  public function setDeleteCurrentData($boolean) 
    2634  { 
     
    2836  } 
    2937 
     38  /** 
     39   * Gets the current value of the flag that indicates whether 
     40   * current data is to be deleted or not. 
     41   * 
     42   * @returns boolean 
     43   */ 
    3044  public function getDeleteCurrentData() 
    3145  { 
     
    3347  } 
    3448 
     49  /** 
     50   * Loads data for the database from a YAML file 
     51   * 
     52   * @param string The path to the YAML file. 
     53   */ 
    3554  protected function doLoadDataFromFile($fixture_file) 
    3655  { 
     
    4160  } 
    4261 
     62  /** 
     63   * Manages the insertion of data into the data source 
     64   * 
     65   * @param array The data to be inserted into the data source 
     66   */ 
    4367  abstract public function loadDataFromArray($data); 
    4468 
     69  /** 
     70   * Manages reading all of the fixture data files and 
     71   * loading them into the data source 
     72   * 
     73   * @param array The path names of the YAML data files 
     74   */ 
    4575  protected function doLoadData($fixture_files) 
    4676  { 
     
    5585  } 
    5686 
     87  /** 
     88   * Gets a list of one or more *.yml files and returns the list in an array 
     89   * 
     90   * @param string A directory or file name; if null, then defaults to 'sf_data_dir'/fixtures 
     91   * 
     92   * @returns array A list of *.yml files. 
     93   * 
     94   * @throws sfInitializationException If the directory or file does not exist. 
     95   */ 
    5796  protected function getFiles($directory_or_file = null) 
    5897  {