Changeset 4520
- Timestamp:
- 06/13/08 22:29:22 (13 months ago)
- Location:
- branches/0.11/lib/Doctrine
- Files:
-
- 25 modified
-
Adapter.php (modified) (1 diff)
-
Adapter/Exception.php (modified) (1 diff)
-
Adapter/Mock.php (modified) (18 diffs)
-
Adapter/Mysqli.php (modified) (1 diff)
-
Adapter/Oracle.php (modified) (1 diff)
-
Adapter/Statement/Interface.php (modified) (1 diff)
-
Adapter/Statement/Mock.php (modified) (4 diffs)
-
AuditLog.php (modified) (3 diffs)
-
AuditLog/Listener.php (modified) (6 diffs)
-
Cache.php (modified) (17 diffs)
-
Cache/Apc.php (modified) (1 diff)
-
Cache/Array.php (modified) (1 diff)
-
Cache/Db.php (modified) (4 diffs)
-
Cache/Driver.php (modified) (4 diffs)
-
Cache/Exception.php (modified) (1 diff)
-
Cache/Interface.php (modified) (1 diff)
-
Cache/Memcache.php (modified) (1 diff)
-
Cache/Xcache.php (modified) (1 diff)
-
Cli.php (modified) (10 diffs)
-
Cli/AnsiColorFormatter.php (modified) (2 diffs)
-
Cli/Exception.php (modified) (1 diff)
-
Cli/Formatter.php (modified) (1 diff)
-
Collection.php (modified) (44 diffs)
-
Collection/Exception.php (modified) (1 diff)
-
Collection/Iterator/Expandable.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Adapter.php
r4036 r4520 34 34 class Doctrine_Adapter 35 35 { 36 /** 37 * Adapter constant 38 */ 36 39 const ATTR_AUTOCOMMIT = 0; 37 40 const ATTR_CASE = 8; -
branches/0.11/lib/Doctrine/Adapter/Exception.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Adapter _Exception23 * Doctrine_Adapter exception class 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Adapter/Mock.php
r4164 r4520 21 21 22 22 /** 23 * Doctrine_Adapter_Mock 24 * 25 * This class is used for special testing purposes. 23 * Doctrine mock connection adapter. This class is used for special testing purposes. 26 24 * 27 25 * @package Doctrine … … 35 33 class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable 36 34 { 35 /** 36 * Name of the dbms to mock 37 * 38 * @var string 39 */ 37 40 private $_name; 38 41 42 /** 43 * Array of queries executed through this instance of the mock adapter 44 * 45 * @var array $queries 46 */ 39 47 private $_queries = array(); 40 48 49 /** 50 * Array of exceptions thrown 51 * 52 * @var array $exceptions 53 */ 41 54 private $_exception = array(); 42 55 56 /** 57 * Bool true/false variable for whether or not the last insert failed 58 * 59 * @var boolean $lastInsertIdFail 60 */ 43 61 private $_lastInsertIdFail = false; 44 62 63 /** 64 * Doctrine mock adapter constructor 65 * 66 * <code> 67 * $conn = new Doctrine_Adapter_Mock('mysql'); 68 * </code> 69 * 70 * @param string $name 71 * @return void 72 */ 45 73 public function __construct($name = null) 46 74 { … … 48 76 } 49 77 78 /** 79 * Get the name of the dbms used in this instance of the mock adapter 80 * 81 * @return string $name Name of the dbms 82 */ 50 83 public function getName() 51 84 { … … 53 86 } 54 87 88 /** 89 * Pop the last executed query from the array of executed queries and return it 90 * 91 * @return string $sql Last executed sql string 92 */ 55 93 public function pop() 56 94 { … … 58 96 } 59 97 98 /** 99 * Force an exception in to the array of exceptions 100 * 101 * @param string $name Name of exception 102 * @param string $message Message for the exception 103 * @param integer $code Code of the exception 104 * @return void 105 */ 60 106 public function forceException($name, $message = '', $code = 0) 61 107 { … … 63 109 } 64 110 111 /** 112 * Prepare a query statement 113 * 114 * @param string $query Query to prepare 115 * @return Doctrine_Adapter_Statement_Mock $mock Mock prepared statement 116 */ 65 117 public function prepare($query) 66 118 { … … 71 123 } 72 124 125 /** 126 * Add query to the stack of executed queries 127 * 128 * @param string $query 129 * @return void 130 */ 73 131 public function addQuery($query) 74 132 { … … 76 134 } 77 135 136 /** 137 * Fake the execution of query and add it to the stack of executed queries 138 * 139 * @param string $query 140 * @return Doctrine_Adapter_Statement_Mock $stmt 141 */ 78 142 public function query($query) 79 143 { … … 96 160 } 97 161 162 /** 163 * Get all the executed queries 164 * 165 * @return array $queries Array of all executed queries 166 */ 98 167 public function getAll() 99 168 { … … 101 170 } 102 171 172 /** 173 * Quote a value for the dbms 174 * 175 * @param string $input 176 * @return string $quoted 177 */ 103 178 public function quote($input) 104 179 { … … 106 181 } 107 182 183 /** 184 * Execute a raw sql statement 185 * 186 * @param string $statement 187 * @return void 188 */ 108 189 public function exec($statement) 109 190 { … … 123 204 } 124 205 206 /** 207 * Force last insert to be failed 208 * 209 * @param boolean $fail 210 * @return void 211 */ 125 212 public function forceLastInsertIdFail($fail = true) 126 213 { … … 132 219 } 133 220 221 /** 222 * Get the id of the last inserted record 223 * 224 * @return integer $id 225 */ 134 226 public function lastInsertId() 135 227 { … … 142 234 } 143 235 236 /** 237 * Get the number of queries executed 238 * 239 * @return integer $count 240 */ 144 241 public function count() 145 242 { … … 147 244 } 148 245 246 /** 247 * Begin a transaction 248 * 249 * @return void 250 */ 149 251 public function beginTransaction() 150 252 { … … 152 254 } 153 255 256 /** 257 * Commit a transaction 258 * 259 * @return void 260 */ 154 261 public function commit() 155 262 { … … 157 264 } 158 265 266 /** 267 * Rollback a transaction 268 * 269 * @return void 270 */ 159 271 public function rollBack() 160 272 { 161 273 $this->_queries[] = 'ROLLBACK'; 162 274 } 163 164 public function errorCode()165 { }166 167 public function errorInfo()168 { }169 275 170 276 public function getAttribute($attribute) … … 175 281 } 176 282 283 public function errorCode() 284 { } 285 286 public function errorInfo() 287 { } 288 177 289 public function setAttribute($attribute, $value) 178 290 { } -
branches/0.11/lib/Doctrine/Adapter/Mysqli.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Adapter_Mysqli 24 * This class is used for special testing purposes. 23 * Custom Doctrine connection adapter for mysqli 25 24 * 26 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Adapter/Oracle.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Adapter_Oracle 24 * [BORROWED FROM ZEND FRAMEWORK] 23 * Custom Doctrine connection adapter for oracle 25 24 * 26 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Adapter/Statement/Interface.php
r4164 r4520 21 21 22 22 /** 23 * Doctrine_Adapter_Statement23 * Interface for Doctrine adapter statements 24 24 * 25 25 * @author Konsta Vesterinen <kvesteri@cc.hut.fi> -
branches/0.11/lib/Doctrine/Adapter/Statement/Mock.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Adapter_Statement_Mock 24 * This class is used for special testing purposes. 23 * Mock connection adapter statement class. Used for special testing purposes 25 24 * 26 25 * @package Doctrine … … 35 34 { 36 35 /** 37 * $mock 36 * Variable which stores instance of Doctrine_Adapter_Mock 37 * 38 * @var Doctrine_Adapter_Mock 39 */ 40 private $_mock; 41 42 /** 43 * queryString 38 44 * 39 45 * @var string 40 46 */ 41 private $_mock;42 43 /**44 * queryString45 *46 * @var string47 */48 47 public $queryString; 49 48 49 /** 50 * Constructor for mock adapter statements. Accepts instance of Doctrine_Adapter_Mock 51 * 52 * @param Doctrine_Adapter_Mock $mock 53 */ 50 54 public function __construct($mock) 51 55 { … … 66 70 */ 67 71 public function bindColumn($column, $param, $type = null) 68 { 69 70 } 72 { } 71 73 72 74 /** … … 86 88 */ 87 89 public function bindValue($param, $value, $type = null) 88 { 89 90 } 90 { } 91 91 92 92 /** -
branches/0.11/lib/Doctrine/AuditLog.php
r4503 r4520 61 61 62 62 /** 63 * Build definition foraudit log table63 * Set the table definition for the audit log table 64 64 * 65 * @param Doctrine_Table $table 66 * @return boolean true on success otherwise false. 65 * @return void 67 66 */ 68 67 public function setTableDefinition() … … 88 87 * 89 88 * @param Doctrine_Record $record 90 * @param mixed$version89 * @param integer $version 91 90 * @return array An array with version information 92 91 */ … … 114 113 115 114 /** 116 * Get the highestversion number for a given Doctrine_Record115 * Get the max version number for a given Doctrine_Record 117 116 * 118 117 * @param Doctrine_Record $record -
branches/0.11/lib/Doctrine/AuditLog/Listener.php
r4503 r4520 36 36 * Instance of Doctrine_Auditlog 37 37 * 38 * @var string38 * @var Doctrine_AuditLog 39 39 */ 40 40 protected $_auditLog; 41 41 42 42 /** 43 * I stantiate AuditLog listener and set the Doctrine_AuditLog instance to the class43 * Instantiate AuditLog listener and set the Doctrine_AuditLog instance to the class 44 44 * 45 45 * @param Doctrine_AuditLog $auditLog … … 66 66 /** 67 67 * Post insert event hook which creates the new version record 68 * This will only insert a version record if the auditLog is enabled 68 69 * 69 70 * @param Doctrine_Event $event … … 84 85 /** 85 86 * Pre delete event hook deletes all related versions 87 * This will only delete version records if the auditLog is enabled 86 88 * 87 89 * @param Doctrine_Event $event … … 105 107 ->where(implode(' AND ',$conditions)) 106 108 ->execute($values); 107 108 if ( ! count($rows)){109 throw new Doctrine_Record_Exception('Can not delete Versions!',Doctrine::ERR_CANNOT_DELETE);110 }111 109 } 112 110 } … … 114 112 /** 115 113 * Pre update event hook for inserting new version record 114 * This will only insert a version record if the auditLog is enabled 116 115 * 117 116 * @param Doctrine_Event $event … … 135 134 136 135 /** 137 * Get the next version for the audit log136 * Get the next version number for the audit log 138 137 * 139 138 * @param Doctrine_Record $record -
branches/0.11/lib/Doctrine/Cache.php
r4252 r4520 91 91 92 92 /** 93 * getDriver 94 * returns the current cache driver 95 * 96 * @return Doctrine_Cache_Driver 93 * Get the current cache driver instance 94 * 95 * @return Doctrine_Cache_Driver $driver 97 96 */ 98 97 public function getDriver() … … 102 101 103 102 /** 104 * setOption103 * Set option name and value 105 104 * 106 105 * @param mixed $option the option name … … 123 122 124 123 /** 125 * getOption124 * Get value of option name 126 125 * 127 126 * @param mixed $option the option name … … 138 137 139 138 /** 140 * add 141 * adds a query to internal query stack 139 * Adds a query to internal query stack 142 140 * 143 141 * @param string|array $query sql query string … … 155 153 156 154 /** 157 * getQueries155 * Get array of all executed queries 158 156 * 159 157 * @param string $namespace optional query namespace … … 174 172 175 173 /** 176 * pop 177 * 178 * pops a query from the stack 179 * @return string 174 * Pops a query from the stack 175 * 176 * @return string $query 180 177 */ 181 178 public function pop() … … 185 182 186 183 /** 187 * reset 188 * 189 * removes all queries from the query stack 184 * Removes all queries from the query stack 185 * 190 186 * @return void 191 187 */ … … 196 192 197 193 /** 198 * count194 * Count the number of queries on the stack 199 195 * 200 196 * @return integer the number of queries in the stack … … 206 202 207 203 /** 208 * getIterator204 * Get queries iterator 209 205 * 210 206 * @return ArrayIterator an iterator that iterates through the query stack … … 216 212 217 213 /** 214 * Check whether or not the last cache opration was successful or not 215 * 218 216 * @return boolean whether or not the last cache operation was successful 219 217 */ … … 224 222 225 223 /** 226 * save227 * 228 * @return boolean224 * Delete all cache 225 * 226 * @return void 229 227 */ 230 228 public function clean() … … 260 258 261 259 /** 262 * readStats263 * 264 * @return array 260 * Read stats file from disk 261 * 262 * @return array $stats 265 263 */ 266 264 public function readStats() … … 277 275 278 276 /** 279 * appendStats 280 * 281 * adds all queries to stats file 277 * Append all queries to stats file 282 278 * @return void 283 279 */ … … 299 295 300 296 /** 301 * preQuery 302 * listens on the Doctrine_Event preQuery event 297 * Listens on the Doctrine_Event preQuery event 303 298 * 304 299 * adds the issued query to internal query stack … … 345 340 346 341 /** 347 * preFetch 348 * listens the preFetch event of Doctrine_Connection_Statement 342 * Listens the preFetch event of Doctrine_Connection_Statement 349 343 * 350 344 * advances the internal pointer of cached data and returns … … 361 355 362 356 /** 363 * preFetch 364 * listens the preFetchAll event of Doctrine_Connection_Statement 357 * Listens the preFetchAll event of Doctrine_Connection_Statement 365 358 * 366 359 * returns the current cache data array … … 374 367 375 368 /** 376 * preExecute 377 * listens the preExecute event of Doctrine_Connection_Statement 369 * Listens the preExecute event of Doctrine_Connection_Statement 378 370 * 379 371 * adds the issued query to internal query stack -
branches/0.11/lib/Doctrine/Cache/Apc.php
r4217 r4520 21 21 22 22 /** 23 * Doctrine_Cache_Apc23 * APC Cache Driver 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cache/Array.php
r4041 r4520 21 21 22 22 /** 23 * Doctrine_Cache_Interface23 * Array cache driver 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cache/Db.php
r4217 r4520 21 21 22 22 /** 23 * D octrine_Cache_Db23 * Database cache driver 24 24 * 25 25 * @package Doctrine … … 34 34 { 35 35 /** 36 * constructor 36 * Configure Database cache driver. Specify instance of Doctrine_Connection 37 * and tableName to store cache in 37 38 * 38 39 * @param array $_options an array of options … … 57 58 58 59 /** 59 * getConnection 60 * returns the connection object associated with this cache driver 61 * 62 * @return Doctrine_Connection connection object 60 * Get the connection object associated with this cache driver 61 * 62 * @return Doctrine_Connection $connection 63 63 */ 64 64 public function getConnection() … … 171 171 172 172 /** 173 * Creates the cache table. 173 * Create the cache table 174 * 175 * @return void 174 176 */ 175 177 public function createTable() -
branches/0.11/lib/Doctrine/Cache/Driver.php
r4041 r4520 21 21 22 22 /** 23 * Doctrine_Cache_Driver23 * Abstract cache driver class 24 24 * 25 25 * @package Doctrine … … 39 39 40 40 /** 41 * constructor41 * Configure cache driver with an array of options 42 42 * 43 43 * @param array $_options an array of options … … 49 49 50 50 /** 51 * setOption51 * Set option name and value 52 52 * 53 53 * @param mixed $option the option name … … 65 65 66 66 /** 67 * getOption67 * Get value of option 68 68 * 69 69 * @param mixed $option the option name -
branches/0.11/lib/Doctrine/Cache/Exception.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine _Cache_Exception23 * Doctrine cache exception class 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cache/Interface.php
r4041 r4520 21 21 22 22 /** 23 * Doctrine _Cache_Interface23 * Doctrine cache driver interface 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cache/Memcache.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Cache_Memcache23 * Memcache cache driver 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cache/Xcache.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Cache_Xcache23 * Xcache cache driver 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cli.php
r4301 r4520 21 21 22 22 /** 23 * Doctrine_Cli 23 * Command line interface class 24 * Interface for easily executing Doctrine_Task classes from a 25 * command line interface 24 26 * 25 27 * @package Doctrine … … 55 57 56 58 /** 57 * notify 58 * 59 * @param string $notification 59 * Notify the formatter of a message 60 * 61 * @param string $notification The notification message 62 * @param string $style Style to format the notification with(INFO, ERROR) 60 63 * @return void 61 64 */ … … 66 69 67 70 /** 68 * notifyException69 * 70 * @param string $exception71 * Notify the formatter of an exception 72 * 73 * @param Exception $exception 71 74 * @return void 72 75 */ … … 77 80 78 81 /** 79 * run80 * 81 * @param string $args82 * Public function to run the loaded task with the passed arguments 83 * 84 * @param array $args 82 85 * @return void 83 86 * @throws new Doctrine_Cli_Exception … … 93 96 94 97 /** 95 * _getTaskClassFromArgs 96 * 97 * Get the task class from an array of cli arguments 98 * 99 * @param string $args 100 * @return void 98 * Get the name of the task class based on the first argument 99 * which is always the task name. Do some inflection to determine the class name 100 * 101 * @param array $args Array of arguments from the cli 102 * @return string $taskClass Task class name 101 103 */ 102 104 protected function _getTaskClassFromArgs($args) … … 109 111 110 112 /** 111 * _run 112 * 113 * @param string $args 114 * @return void 113 * Run the actual task execution with the passed arguments 114 * 115 * @param array $args Array of arguments for this task being executed 116 * @return void 117 * @throws Doctrine_Cli_Exception $e 115 118 */ 116 119 protected function _run($args) … … 158 161 159 162 /** 160 * prepareArgs 161 * 162 * @param string $args 163 * @return array $prepared 163 * Prepare the raw arguments for execution. Combines with the required and optional argument 164 * list in order to determine a complete array of arguments for the task 165 * 166 * @param array $args Array of raw arguments 167 * @return array $prepared Array of prepared arguments 164 168 */ 165 169 protected function prepareArgs($args) … … 205 209 206 210 /** 207 * printTasks208 *209 211 * Prints an index of all the available tasks in the CLI instance 210 212 * … … 272 274 273 275 /** 274 * loadTasks 275 * 276 * @param string $directory 277 * @return array $loadedTasks 276 * Load tasks from the passed directory. If no directory is given it looks in the default 277 * Doctrine/Task folder for the core tasks. 278 * 279 * @param mixed $directory Can be a string path or array of paths 280 * @return array $loadedTasks Array of tasks loaded 278 281 */ 279 282 public function loadTasks($directory = null) … … 325 328 return $this->_tasks; 326 329 } 327 330 331 /** 332 * Get array of all the Doctrine_Task child classes that are loaded 333 * 334 * @return array $tasks 335 */ 328 336 public function getLoadedTasks() 329 337 { -
branches/0.11/lib/Doctrine/Cli/AnsiColorFormatter.php
r4252 r4520 30 30 /** 31 31 * Doctrine_AnsiColorFormatter provides methods to colorize text to be displayed on a console. 32 * This class was taken from the symfony-project source 32 33 * 33 34 * @package Doctrine 34 35 * @subpackage Cli 35 36 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 37 * @author Jonathan H. Wage <jonwage@gmail.com> 38 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 39 * @link www.phpdoctrine.org 40 * @since 1.0 41 * @version $Revision: 4252 $ 36 42 */ 37 43 class Doctrine_Cli_AnsiColorFormatter extends Doctrine_Cli_Formatter … … 133 139 $subsize = floor(($size - 3) / 2); 134 140 135 return substr($text, 0, $subsize) .$this->format('...', 'INFO').substr($text, -$subsize);141 return substr($text, 0, $subsize) . $this->format('...', 'INFO').substr($text, -$subsize); 136 142 } 137 143 -
branches/0.11/lib/Doctrine/Cli/Exception.php
r3884 r4520 21 21 22 22 /** 23 * Doctrine_Cli_Exception23 * Cli exception class 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Cli/Formatter.php
r4252 r4520 30 30 /** 31 31 * Doctrine_Cli_Formatter provides methods to format text to be displayed on a console. 32 * This class was taken from the symfony-project source 32 33 * 33 * @package Doctrine 34 * @subpackage Cli 35 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 34 * @package Doctrine 35 * @subpackage Cli 36 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 37 * @author Jonathan H. Wage <jonwage@gmail.com> 38 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 39 * @link www.phpdoctrine.org 40 * @since 1.0 41 * @version $Revision: 2761 $ 36 42 */ 37 43 class Doctrine_Cli_Formatter -
branches/0.11/lib/Doctrine/Collection.php
r4512 r4520 74 74 protected static $null; 75 75 76 77 76 /** 78 77 * constructor … … 102 101 103 102 /** 104 * initNullObject 105 * initializes the null object for this collection 103 * Initializes the null object for this collection 106 104 * 107 105 * @return void … … 113 111 114 112 /** 115 * getTable 116 * returns the table this collection belongs to 113 * Get the table this collection belongs to 117 114 * 118 115 * @return Doctrine_Table … … 124 121 125 122 /** 126 * setData123 * Set the data for the Doctrin_Collection instance 127 124 * 128 125 * @param array $data … … 135 132 136 133 /** 137 * this method is automatically called when this Doctrine_Collection is serialized134 * This method is automatically called when this Doctrine_Collection is serialized 138 135 * 139 136 * @return array … … 156 153 157 154 /** 158 * unseralize 159 * this method is automatically called everytime a Doctrine_Collection object is unserialized 155 * This method is automatically called everytime a Doctrine_Collection object is unserialized 160 156 * 161 157 * @return void … … 185 181 186 182 /** 187 * setKeyColumn 188 * sets the key column for this collection 183 * Sets the key column for this collection 189 184 * 190 185 * @param string $column 191 * @return Doctrine_Collection 186 * @return Doctrine_Collection $this 192 187 */ 193 188 public function setKeyColumn($column) … … 199 194 200 195 /** 201 * getKeyColumn 202 * returns the name of the key column 196 * Get the name of the key column 203 197 * 204 198 * @return string … … 210 204 211 205 /** 212 * getData 213 * returns all the records as an array 206 * Get all the records as an array 214 207 * 215 208 * @return array … … 221 214 222 215 /** 223 * getFirst 224 * returns the first record in the collection 216 * Get the first record in the collection 225 217 * 226 218 * @return mixed … … 232 224 233 225 /** 234 * getLast 235 * returns the last record in the collection 226 * Get the last record in the collection 236 227 * 237 228 * @return mixed … … 241 232 return end($this->data); 242 233 } 243 /** 244 * returns the last record in the collection 234 235 /** 236 * Get the last record in the collection 245 237 * 246 238 * @return mixed … … 250 242 return end($this->data); 251 243 } 252 /** 253 * returns the current key 244 245 /** 246 * Get the current key 254 247 * 255 248 * @return mixed … … 259 252 return key($this->data); 260 253 } 261 /** 262 * setReference263 * sets a reference pointer254 255 /** 256 * Sets a reference pointer 264 257 * 265 258 * @return void … … 271 264 272 265 if ($relation instanceof Doctrine_Relation_ForeignKey || 273 $relation instanceof Doctrine_Relation_LocalKey) {266 $relation instanceof Doctrine_Relation_LocalKey) { 274 267 275 268 $this->referenceField = $relation->getForeignFieldName(); … … 290 283 291 284 /** 292 * getReference293 * 294 * @return mixed285 * Get reference to Doctrine_Record instance 286 * 287 * @return Doctrine_Record $reference 295 288 */ 296 289 public function getReference() … … 300 293 301 294 /** 302 * remove 303 * removes a specified collection element 295 * Removes a specified collection element 304 296 * 305 297 * @param mixed $key … … 315 307 316 308 /** 317 * contains 318 * whether or not this collection contains a specified element 309 * Whether or not this collection contains a specified element 319 310 * 320 311 * @param mixed $key the key of the element … … 327 318 328 319 /** 329 * search320 * Search a Doctrine_Record instance 330 321 * 331 322 * @param string $Doctrine_Record … … 338 329 339 330 /** 340 * get 341 * returns a record for given key 331 * Gets a record for given key 342 332 * 343 333 * There are two special cases: … … 385 375 386 376 /** 377 * Get array of primary keys for all the records in the collection 378 * 387 379 * @return array an array containing all primary keys 388 380 */ … … 403 395 404 396 /** 405 * returns all keys 397 * Get all keys of the data in the collection 398 * 406 399 * @return array 407 400 */ … … 412 405 413 406 /** 414 * count 415 * this class implements interface countable 416 * returns the number of records in this collection 407 * Gets the number of records in this collection 408 * This class implements interface countable 417 409 * 418 410 * @return integer … … 424 416 425 417 /** 426 * set 418 * Set a Doctrine_Record instance to the collection 419 * 427 420 * @param integer $key 428 421 * @param Doctrine_Record $record … … 439 432 440 433 /** 441 * adds a record to collection 434 * Adds a record to collection 435 * 442 436 * @param Doctrine_Record $record record to be added 443 437 * @param string $key optional key for the record … … 488 482 489 483 /** 490 * merge491 *492 484 * Merges collection into $this and returns merged collection 493 485 * … … 512 504 513 505 /** 514 * loadRelated506 * Load all relationships or the named relationship passed 515 507 * 516 508 * @param mixed $name … … 558 550 559 551 /** 560 * populateRelated552 * Populate the relationship $name for all records in the passed collection 561 553 * 562 554 * @param string $name … … 617 609 618 610 /** 619 * getNormalIterator 620 * returns normal iterator - an iterator that will not expand this collection 621 * 622 * @return Doctrine_Iterator_Normal 611 * Get normal iterator - an iterator that will not expand this collection 612 * 613 * @return Doctrine_Iterator_Normal $iterator 623 614 */ 624 615 public function getNormalIterator() … … 628 619 629 620 /** 630 * takeSnapshot 631 * takes a snapshot from this collection 621 * Takes a snapshot from this collection 632 622 * 633 623 * snapshots are used for diff processing, for example … … 648 638 649 639 /** 650 * getSnapshot 651 * returns the data of the last snapshot 640 * Gets the data of the last snapshot 652 641 * 653 642 * @return array returns the data in last snapshot … … 659 648 660 649 /** 661 * processDiff 662 * processes the difference of the last snapshot and the current data 650 * Processes the difference of the last snapshot and the current data 663 651 * 664 652 * an example: … … 680 668 681 669 /** 682 * toArray683 670 * Mimics the result of a $query->execute(array(), Doctrine::FETCH_ARRAY); 684 671 * … … 699 686 700 687 /** 701 * fromArray702 *703 688 * Populate a Doctrine_Collection from an array of data 704 689 * … … 715 700 716 701 /** 717 * synchronizeWithArray718 702 * synchronizes a Doctrine_Collection with data from an array 719 703 * … … 740 724 } 741 725 } 742 743 // Method was wrong named. Fixing by creating an alias, since we cannot change API (remove methods) 744 public function synchronizeFromArray(array $array) { 726 public function synchronizeFromArray(array $array) 727 { 745 728 return $this->synchronizeWithArray($array); 746 729 } 747 730 748 731 /** 749 * exportTo750 *751 732 * Export a Doctrine_Collection to one of the supported Doctrine_Parser formats 752 733 * … … 765 746 766 747 /** 767 * importFrom768 *769 748 * Import data to a Doctrine_Collection from one of the supported Doctrine_Parser formats 770 749 * … … 783 762 784 763 /** 785 * getDeleteDiff786 * 787 * @return void764 * Perform a delete diff between the last snapshot and the current data 765 * 766 * @return array $diff 788 767 */ 789 768 public function getDeleteDiff() 790 769 { 791 return array_udiff($this->_snapshot, $this->data, array($this, "compareRecords"));792 } 793 794 /** 795 * getInsertDiff796 * 797 * @return void770 return array_udiff($this->_snapshot, $this->data, array($this, 'compareRecords')); 771 } 772 773 /** 774 * Perform a insert diff between the last snapshot and the current data 775 * 776 * @return array $diff 798 777 */ 799 778 public function getInsertDiff() … … 803 782 804 783 /** 805 * compareRecords806 784 * Compares two records. To be used on _snapshot diffs using array_udiff 785 * 786 * @param Doctrine_Record $a 787 * @param Doctrine_Record $b 788 * @return integer 807 789 */ 808 790 protected function compareRecords($a, $b) … … 816 798 817 799 /** 818 * save 819 * saves all records of this collection and processes the 800 * Saves all records of this collection and processes the 820 801 * difference of the last snapshot and the current data 821 802 * … … 845 826 846 827 /** 847 * delete 848 * deletes all records from this collection 828 * Deletes all records from this collection 849 829 * 850 830 * @return Doctrine_Collection … … 905 885 } 906 886 907 908 /**909 * getIterator887 /** 888 * Get collection data iterator 889 * 910 890 * @return object ArrayIterator 911 891 */ … … 917 897 918 898 /** 919 * returns a string representation of this object 899 * Returns a string representation of this object 900 * 901 * @return string $string 920 902 */ 921 903 public function __toString() … … 925 907 926 908 /** 927 * returns the relation object 909 * Returns the relation object 910 * 928 911 * @return object Doctrine_Relation 929 912 */ -
branches/0.11/lib/Doctrine/Collection/Exception.php
r3884 r4520 21 21 22 22 /** 23 * Doctrine_Collection_Exception23 * Collection exception class 24 24 * 25 25 * @package Doctrine -
branches/0.11/lib/Doctrine/Collection/Iterator/Expandable.php
r4252 r4520 21 21 22 22 /** 23 * Doctrine_Collection_Iterator_Normal23 * Expandable collection iterator class 24 24 * 25 25 * @package Doctrine