Changeset 3382
- Timestamp:
- 02/01/07 08:34:56 (2 years ago)
- Files:
-
- branches/1.0/lib/addon/propel/sfPropelData.class.php (modified) (5 diffs)
- branches/1.0/lib/addon/sfData.class.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/addon/propel/sfPropelData.class.php
r3153 r3382 10 10 11 11 /** 12 * This class is the Propel implementation of sfData. It interacts with the data source 13 * and loads data. 12 14 * 13 15 * @package symfony … … 22 24 23 25 // 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 */ 24 34 public function loadData($directory_or_file = null, $connectionName = 'propel') 25 35 { … … 45 55 } 46 56 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 */ 47 66 public function loadDataFromArray($data) 48 67 { … … 133 152 } 134 153 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 */ 135 163 protected function doDeleteCurrentData($fixture_files) 136 164 { … … 170 198 } 171 199 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 */ 172 207 protected function loadMapBuilder($class) 173 208 { branches/1.0/lib/addon/sfData.class.php
r3071 r3382 10 10 11 11 /** 12 * This class defines the interface for interacting with data, as well 13 * as default implementations. 12 14 * 13 15 * @package symfony … … 23 25 $object_references = array(); 24 26 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 */ 25 33 public function setDeleteCurrentData($boolean) 26 34 { … … 28 36 } 29 37 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 */ 30 44 public function getDeleteCurrentData() 31 45 { … … 33 47 } 34 48 49 /** 50 * Loads data for the database from a YAML file 51 * 52 * @param string The path to the YAML file. 53 */ 35 54 protected function doLoadDataFromFile($fixture_file) 36 55 { … … 41 60 } 42 61 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 */ 43 67 abstract public function loadDataFromArray($data); 44 68 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 */ 45 75 protected function doLoadData($fixture_files) 46 76 { … … 55 85 } 56 86 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 */ 57 96 protected function getFiles($directory_or_file = null) 58 97 {