Changeset 4520

Show
Ignore:
Timestamp:
06/13/08 22:29:22 (13 months ago)
Author:
jwage
Message:

Doc blocks.

Location:
branches/0.11/lib/Doctrine
Files:
25 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Adapter.php

    r4036 r4520  
    3434class Doctrine_Adapter 
    3535{ 
     36    /** 
     37     * Adapter constant 
     38     */ 
    3639    const ATTR_AUTOCOMMIT = 0; 
    3740    const ATTR_CASE = 8; 
  • branches/0.11/lib/Doctrine/Adapter/Exception.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Adapter_Exception 
     23 * Doctrine_Adapter exception class 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Adapter/Mock.php

    r4164 r4520  
    2121 
    2222/** 
    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. 
    2624 * 
    2725 * @package     Doctrine 
     
    3533class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable 
    3634{ 
     35    /** 
     36     * Name of the dbms to mock 
     37     * 
     38     * @var string 
     39     */ 
    3740    private $_name; 
    3841 
     42    /** 
     43     * Array of queries executed through this instance of the mock adapter 
     44     * 
     45     * @var array $queries 
     46     */ 
    3947    private $_queries = array(); 
    4048 
     49    /** 
     50     * Array of exceptions thrown 
     51     * 
     52     * @var array $exceptions 
     53     */ 
    4154    private $_exception = array(); 
    4255 
     56    /** 
     57     * Bool true/false variable for whether or not the last insert failed 
     58     * 
     59     * @var boolean $lastInsertIdFail 
     60     */ 
    4361    private $_lastInsertIdFail = false; 
    4462 
     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     */ 
    4573    public function __construct($name = null) 
    4674    { 
     
    4876    } 
    4977 
     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     */ 
    5083    public function getName() 
    5184    { 
     
    5386    } 
    5487 
     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     */ 
    5593    public function pop() 
    5694    { 
     
    5896    } 
    5997 
     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     */ 
    60106    public function forceException($name, $message = '', $code = 0) 
    61107    { 
     
    63109    } 
    64110 
     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     */ 
    65117    public function prepare($query) 
    66118    { 
     
    71123    } 
    72124 
     125    /** 
     126     * Add query to the stack of executed queries 
     127     * 
     128     * @param string $query  
     129     * @return void 
     130     */ 
    73131    public function addQuery($query) 
    74132    { 
     
    76134    } 
    77135 
     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     */ 
    78142    public function query($query) 
    79143    { 
     
    96160    } 
    97161 
     162    /** 
     163     * Get all the executed queries 
     164     * 
     165     * @return array $queries Array of all executed queries 
     166     */ 
    98167    public function getAll() 
    99168    { 
     
    101170    } 
    102171 
     172    /** 
     173     * Quote a value for the dbms 
     174     * 
     175     * @param string $input  
     176     * @return string $quoted 
     177     */ 
    103178    public function quote($input) 
    104179    { 
     
    106181    } 
    107182 
     183    /** 
     184     * Execute a raw sql statement 
     185     * 
     186     * @param string $statement  
     187     * @return void 
     188     */ 
    108189    public function exec($statement) 
    109190    { 
     
    123204    } 
    124205 
     206    /** 
     207     * Force last insert to be failed 
     208     * 
     209     * @param boolean $fail 
     210     * @return void 
     211     */ 
    125212    public function forceLastInsertIdFail($fail = true) 
    126213    { 
     
    132219    } 
    133220 
     221    /** 
     222     * Get the id of the last inserted record 
     223     * 
     224     * @return integer $id 
     225     */ 
    134226    public function lastInsertId() 
    135227    { 
     
    142234    } 
    143235 
     236    /** 
     237     * Get the number of queries executed 
     238     * 
     239     * @return integer $count 
     240     */ 
    144241    public function count() 
    145242    { 
     
    147244    } 
    148245 
     246    /** 
     247     * Begin a transaction 
     248     * 
     249     * @return void 
     250     */ 
    149251    public function beginTransaction() 
    150252    { 
     
    152254    } 
    153255 
     256    /** 
     257     * Commit a transaction 
     258     * 
     259     * @return void 
     260     */ 
    154261    public function commit() 
    155262    { 
     
    157264    } 
    158265 
     266    /** 
     267     * Rollback a transaction 
     268     * 
     269     * @return void 
     270     */ 
    159271    public function rollBack() 
    160272    { 
    161273        $this->_queries[] = 'ROLLBACK'; 
    162274    } 
    163  
    164     public function errorCode() 
    165     { } 
    166  
    167     public function errorInfo() 
    168     { } 
    169275 
    170276    public function getAttribute($attribute) 
     
    175281    } 
    176282 
     283    public function errorCode() 
     284    { } 
     285 
     286    public function errorInfo() 
     287    { } 
     288 
    177289    public function setAttribute($attribute, $value) 
    178290    { } 
  • branches/0.11/lib/Doctrine/Adapter/Mysqli.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Adapter_Mysqli 
    24  * This class is used for special testing purposes. 
     23 * Custom Doctrine connection adapter for mysqli 
    2524 * 
    2625 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Adapter/Oracle.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Adapter_Oracle 
    24  * [BORROWED FROM ZEND FRAMEWORK] 
     23 * Custom Doctrine connection adapter for oracle 
    2524 * 
    2625 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Adapter/Statement/Interface.php

    r4164 r4520  
    2121 
    2222/** 
    23  * Doctrine_Adapter_Statement 
     23 * Interface for Doctrine adapter statements 
    2424 * 
    2525 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi> 
  • branches/0.11/lib/Doctrine/Adapter/Statement/Mock.php

    r4252 r4520  
    2121 
    2222/** 
    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 
    2524 * 
    2625 * @package     Doctrine 
     
    3534{ 
    3635    /** 
    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 
    3844     * 
    3945     * @var string 
    4046     */ 
    41     private $_mock; 
    42  
    43     /** 
    44      * queryString 
    45      * 
    46      * @var string 
    47      */ 
    4847    public $queryString; 
    4948 
     49    /** 
     50     * Constructor for mock adapter statements. Accepts instance of Doctrine_Adapter_Mock 
     51     * 
     52     * @param Doctrine_Adapter_Mock $mock 
     53     */ 
    5054    public function __construct($mock) 
    5155    { 
     
    6670     */ 
    6771    public function bindColumn($column, $param, $type = null) 
    68     { 
    69  
    70     } 
     72    { } 
    7173 
    7274    /** 
     
    8688     */ 
    8789    public function bindValue($param, $value, $type = null) 
    88     { 
    89  
    90     } 
     90    { } 
    9191 
    9292    /** 
  • branches/0.11/lib/Doctrine/AuditLog.php

    r4503 r4520  
    6161 
    6262    /** 
    63      * Build definition for audit log table 
     63     * Set the table definition for the audit log table 
    6464     * 
    65      * @param   Doctrine_Table  $table 
    66      * @return  boolean         true on success otherwise false. 
     65     * @return  void 
    6766     */ 
    6867    public function setTableDefinition() 
     
    8887     * 
    8988     * @param   Doctrine_Record $record 
    90      * @param   mixed           $version 
     89     * @param   integer         $version 
    9190     * @return  array           An array with version information 
    9291     */ 
     
    114113 
    115114    /** 
    116      * Get the highest version number for a given Doctrine_Record 
     115     * Get the max version number for a given Doctrine_Record 
    117116     * 
    118117     * @param Doctrine_Record $record 
  • branches/0.11/lib/Doctrine/AuditLog/Listener.php

    r4503 r4520  
    3636     * Instance of Doctrine_Auditlog 
    3737     * 
    38      * @var string 
     38     * @var Doctrine_AuditLog 
    3939     */ 
    4040    protected $_auditLog; 
    4141 
    4242    /** 
    43      * Istantiate AuditLog listener and set the Doctrine_AuditLog instance to the class 
     43     * Instantiate AuditLog listener and set the Doctrine_AuditLog instance to the class 
    4444     * 
    4545     * @param   Doctrine_AuditLog $auditLog  
     
    6666    /** 
    6767     * Post insert event hook which creates the new version record 
     68     * This will only insert a version record if the auditLog is enabled 
    6869     * 
    6970     * @param   Doctrine_Event $event  
     
    8485    /** 
    8586     * Pre delete event hook deletes all related versions 
     87     * This will only delete version records if the auditLog is enabled 
    8688     * 
    8789     * @param   Doctrine_Event $event 
     
    105107                                          ->where(implode(' AND ',$conditions)) 
    106108                                          ->execute($values); 
    107  
    108                 if ( ! count($rows)){ 
    109                    throw new Doctrine_Record_Exception('Can not delete Versions!',Doctrine::ERR_CANNOT_DELETE); 
    110                 } 
    111109        } 
    112110    } 
     
    114112    /** 
    115113     * Pre update event hook for inserting new version record 
     114     * This will only insert a version record if the auditLog is enabled 
    116115     * 
    117116     * @param  Doctrine_Event $event 
     
    135134 
    136135    /** 
    137      * Get the next version for the audit log 
     136     * Get the next version number for the audit log 
    138137     * 
    139138     * @param Doctrine_Record $record  
  • branches/0.11/lib/Doctrine/Cache.php

    r4252 r4520  
    9191 
    9292    /** 
    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 
    9796     */ 
    9897    public function getDriver() 
     
    102101 
    103102    /** 
    104      * setOption 
     103     * Set option name and value 
    105104     * 
    106105     * @param mixed $option     the option name 
     
    123122 
    124123    /** 
    125      * getOption 
     124     * Get value of option name 
    126125     *  
    127126     * @param mixed $option     the option name 
     
    138137 
    139138    /** 
    140      * add 
    141      * adds a query to internal query stack 
     139     * Adds a query to internal query stack 
    142140     * 
    143141     * @param string|array $query           sql query string 
     
    155153 
    156154    /** 
    157      * getQueries 
     155     * Get array of all executed queries 
    158156     * 
    159157     * @param string $namespace     optional query namespace 
     
    174172 
    175173    /** 
    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 
    180177     */ 
    181178    public function pop() 
     
    185182 
    186183    /** 
    187      * reset 
    188      * 
    189      * removes all queries from the query stack 
     184     * Removes all queries from the query stack 
     185     * 
    190186     * @return void 
    191187     */ 
     
    196192 
    197193    /** 
    198      * count 
     194     * Count the number of queries on the stack 
    199195     * 
    200196     * @return integer          the number of queries in the stack 
     
    206202 
    207203    /** 
    208      * getIterator 
     204     * Get queries iterator 
    209205     * 
    210206     * @return ArrayIterator    an iterator that iterates through the query stack 
     
    216212 
    217213    /** 
     214     * Check whether or not the last cache opration was successful or not 
     215     * 
    218216     * @return boolean          whether or not the last cache operation was successful 
    219217     */ 
     
    224222 
    225223    /** 
    226      * save 
    227      * 
    228      * @return boolean 
     224     * Delete all cache 
     225     * 
     226     * @return void 
    229227     */ 
    230228    public function clean() 
     
    260258 
    261259    /** 
    262      * readStats 
    263      * 
    264      * @return array 
     260     * Read stats file from disk 
     261     * 
     262     * @return array $stats 
    265263     */ 
    266264    public function readStats()  
     
    277275 
    278276    /** 
    279      * appendStats 
    280      * 
    281      * adds all queries to stats file 
     277     * Append all queries to stats file 
    282278     * @return void 
    283279     */ 
     
    299295 
    300296    /** 
    301      * preQuery 
    302      * listens on the Doctrine_Event preQuery event 
     297     * Listens on the Doctrine_Event preQuery event 
    303298     * 
    304299     * adds the issued query to internal query stack 
     
    345340 
    346341    /** 
    347      * preFetch 
    348      * listens the preFetch event of Doctrine_Connection_Statement 
     342     * Listens the preFetch event of Doctrine_Connection_Statement 
    349343     * 
    350344     * advances the internal pointer of cached data and returns  
     
    361355 
    362356    /** 
    363      * preFetch 
    364      * listens the preFetchAll event of Doctrine_Connection_Statement 
     357     * Listens the preFetchAll event of Doctrine_Connection_Statement 
    365358     * 
    366359     * returns the current cache data array 
     
    374367 
    375368    /** 
    376      * preExecute 
    377      * listens the preExecute event of Doctrine_Connection_Statement 
     369     * Listens the preExecute event of Doctrine_Connection_Statement 
    378370     * 
    379371     * adds the issued query to internal query stack 
  • branches/0.11/lib/Doctrine/Cache/Apc.php

    r4217 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Apc 
     23 * APC Cache Driver 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cache/Array.php

    r4041 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Interface 
     23 * Array cache driver 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cache/Db.php

    r4217 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Db 
     23 * Database cache driver 
    2424 * 
    2525 * @package     Doctrine 
     
    3434{ 
    3535    /** 
    36      * constructor 
     36     * Configure Database cache driver. Specify instance of Doctrine_Connection 
     37     * and tableName to store cache in 
    3738     * 
    3839     * @param array $_options      an array of options 
     
    5758 
    5859    /** 
    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 
    6363     */ 
    6464    public function getConnection()  
     
    171171 
    172172    /** 
    173      * Creates the cache table. 
     173     * Create the cache table 
     174     * 
     175     * @return void 
    174176     */ 
    175177    public function createTable() 
  • branches/0.11/lib/Doctrine/Cache/Driver.php

    r4041 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Driver 
     23 * Abstract cache driver class 
    2424 * 
    2525 * @package     Doctrine 
     
    3939 
    4040    /** 
    41      * constructor 
     41     * Configure cache driver with an array of options 
    4242     * 
    4343     * @param array $_options      an array of options 
     
    4949 
    5050    /** 
    51      * setOption 
     51     * Set option name and value 
    5252     * 
    5353     * @param mixed $option     the option name 
     
    6565 
    6666    /** 
    67      * getOption 
     67     * Get value of option 
    6868     *  
    6969     * @param mixed $option     the option name 
  • branches/0.11/lib/Doctrine/Cache/Exception.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Exception 
     23 * Doctrine cache exception class 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cache/Interface.php

    r4041 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Interface 
     23 * Doctrine cache driver interface 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cache/Memcache.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Memcache 
     23 * Memcache cache driver 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cache/Xcache.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cache_Xcache 
     23 * Xcache cache driver 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cli.php

    r4301 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cli 
     23 * Command line interface class 
     24 * Interface for easily executing Doctrine_Task classes from a  
     25 * command line interface 
    2426 * 
    2527 * @package     Doctrine 
     
    5557 
    5658    /** 
    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) 
    6063     * @return void 
    6164     */ 
     
    6669 
    6770    /** 
    68      * notifyException 
    69      * 
    70      * @param string $exception  
     71     * Notify the formatter of an exception 
     72     * 
     73     * @param  Exception $exception 
    7174     * @return void 
    7275     */ 
     
    7780 
    7881    /** 
    79      * run 
    80      * 
    81      * @param string $args  
     82     * Public function to run the loaded task with the passed arguments 
     83     * 
     84     * @param  array $args 
    8285     * @return void 
    8386     * @throws new Doctrine_Cli_Exception 
     
    9396 
    9497    /** 
    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 
    101103     */ 
    102104    protected function _getTaskClassFromArgs($args) 
     
    109111 
    110112    /** 
    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 
    115118     */ 
    116119    protected function _run($args) 
     
    158161 
    159162    /** 
    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 
    164168     */ 
    165169    protected function prepareArgs($args) 
     
    205209 
    206210    /** 
    207      * printTasks 
    208      * 
    209211     * Prints an index of all the available tasks in the CLI instance 
    210212     *  
     
    272274 
    273275    /** 
    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 
    278281     */ 
    279282    public function loadTasks($directory = null) 
     
    325328        return $this->_tasks; 
    326329    } 
    327      
     330 
     331    /** 
     332     * Get array of all the Doctrine_Task child classes that are loaded 
     333     * 
     334     * @return array $tasks 
     335     */ 
    328336    public function getLoadedTasks() 
    329337    { 
  • branches/0.11/lib/Doctrine/Cli/AnsiColorFormatter.php

    r4252 r4520  
    3030/** 
    3131 * Doctrine_AnsiColorFormatter provides methods to colorize text to be displayed on a console. 
     32 * This class was taken from the symfony-project source 
    3233 * 
    3334 * @package    Doctrine 
    3435 * @subpackage Cli 
    3536 * @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 $ 
    3642 */ 
    3743class Doctrine_Cli_AnsiColorFormatter extends Doctrine_Cli_Formatter 
     
    133139        $subsize = floor(($size - 3) / 2); 
    134140 
    135         return substr($text, 0, $subsize).$this->format('...', 'INFO').substr($text, -$subsize); 
     141        return substr($text, 0, $subsize) . $this->format('...', 'INFO').substr($text, -$subsize); 
    136142    } 
    137143 
  • branches/0.11/lib/Doctrine/Cli/Exception.php

    r3884 r4520  
    2121 
    2222/** 
    23  * Doctrine_Cli_Exception 
     23 * Cli exception class 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Cli/Formatter.php

    r4252 r4520  
    3030/** 
    3131 * Doctrine_Cli_Formatter provides methods to format text to be displayed on a console. 
     32 * This class was taken from the symfony-project source 
    3233 * 
    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 $ 
    3642 */ 
    3743class Doctrine_Cli_Formatter 
  • branches/0.11/lib/Doctrine/Collection.php

    r4512 r4520  
    7474    protected static $null; 
    7575 
    76  
    7776    /** 
    7877     * constructor 
     
    102101 
    103102    /** 
    104      * initNullObject 
    105      * initializes the null object for this collection 
     103     * Initializes the null object for this collection 
    106104     * 
    107105     * @return void 
     
    113111 
    114112    /** 
    115      * getTable 
    116      * returns the table this collection belongs to 
     113     * Get the table this collection belongs to 
    117114     * 
    118115     * @return Doctrine_Table 
     
    124121 
    125122    /** 
    126      * setData 
     123     * Set the data for the Doctrin_Collection instance 
    127124     * 
    128125     * @param array $data 
     
    135132 
    136133    /** 
    137      * this method is automatically called when this Doctrine_Collection is serialized 
     134     * This method is automatically called when this Doctrine_Collection is serialized 
    138135     * 
    139136     * @return array 
     
    156153 
    157154    /** 
    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 
    160156     * 
    161157     * @return void 
     
    185181 
    186182    /** 
    187      * setKeyColumn 
    188      * sets the key column for this collection 
     183     * Sets the key column for this collection 
    189184     * 
    190185     * @param string $column 
    191      * @return Doctrine_Collection 
     186     * @return Doctrine_Collection $this 
    192187     */ 
    193188    public function setKeyColumn($column) 
     
    199194 
    200195    /** 
    201      * getKeyColumn 
    202      * returns the name of the key column 
     196     * Get the name of the key column 
    203197     * 
    204198     * @return string 
     
    210204 
    211205    /** 
    212      * getData 
    213      * returns all the records as an array 
     206     * Get all the records as an array 
    214207     * 
    215208     * @return array 
     
    221214 
    222215    /** 
    223      * getFirst 
    224      * returns the first record in the collection 
     216     * Get the first record in the collection 
    225217     * 
    226218     * @return mixed 
     
    232224 
    233225    /** 
    234      * getLast 
    235      * returns the last record in the collection 
     226     * Get the last record in the collection 
    236227     * 
    237228     * @return mixed 
     
    241232        return end($this->data); 
    242233    } 
    243     /** 
    244      * returns the last record in the collection 
     234 
     235    /** 
     236     * Get the last record in the collection 
    245237     * 
    246238     * @return mixed 
     
    250242        return end($this->data); 
    251243    } 
    252     /** 
    253      * returns the current key 
     244 
     245    /** 
     246     * Get the current key 
    254247     * 
    255248     * @return mixed 
     
    259252        return key($this->data); 
    260253    } 
    261     /** 
    262      * setReference 
    263      * sets a reference pointer 
     254 
     255    /** 
     256     * Sets a reference pointer 
    264257     * 
    265258     * @return void 
     
    271264 
    272265        if ($relation instanceof Doctrine_Relation_ForeignKey ||  
    273                 $relation instanceof Doctrine_Relation_LocalKey) { 
     266            $relation instanceof Doctrine_Relation_LocalKey) { 
    274267 
    275268            $this->referenceField = $relation->getForeignFieldName(); 
     
    290283 
    291284    /** 
    292      * getReference 
    293      * 
    294      * @return mixed 
     285     * Get reference to Doctrine_Record instance 
     286     * 
     287     * @return Doctrine_Record $reference 
    295288     */ 
    296289    public function getReference() 
     
    300293 
    301294    /** 
    302      * remove 
    303      * removes a specified collection element 
     295     * Removes a specified collection element 
    304296     * 
    305297     * @param mixed $key 
     
    315307 
    316308    /** 
    317      * contains 
    318      * whether or not this collection contains a specified element 
     309     * Whether or not this collection contains a specified element 
    319310     * 
    320311     * @param mixed $key                    the key of the element 
     
    327318 
    328319    /** 
    329      * search 
     320     * Search a Doctrine_Record instance 
    330321     * 
    331322     * @param string $Doctrine_Record  
     
    338329 
    339330    /** 
    340      * get 
    341      * returns a record for given key 
     331     * Gets a record for given key 
    342332     * 
    343333     * There are two special cases: 
     
    385375 
    386376    /** 
     377     * Get array of primary keys for all the records in the collection 
     378     * 
    387379     * @return array                an array containing all primary keys 
    388380     */ 
     
    403395 
    404396    /** 
    405      * returns all keys 
     397     * Get all keys of the data in the collection 
     398     * 
    406399     * @return array 
    407400     */ 
     
    412405 
    413406    /** 
    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 
    417409     * 
    418410     * @return integer 
     
    424416 
    425417    /** 
    426      * set 
     418     * Set a Doctrine_Record instance to the collection 
     419     * 
    427420     * @param integer $key 
    428421     * @param Doctrine_Record $record 
     
    439432 
    440433    /** 
    441      * adds a record to collection 
     434     * Adds a record to collection 
     435     * 
    442436     * @param Doctrine_Record $record              record to be added 
    443437     * @param string $key                          optional key for the record 
     
    488482     
    489483    /** 
    490      * merge 
    491      *  
    492484     * Merges collection into $this and returns merged collection 
    493485     *  
     
    512504 
    513505    /** 
    514      * loadRelated 
     506     * Load all relationships or the named relationship passed 
    515507     * 
    516508     * @param mixed $name 
     
    558550 
    559551    /** 
    560      * populateRelated 
     552     * Populate the relationship $name for all records in the passed collection 
    561553     * 
    562554     * @param string $name 
     
    617609 
    618610    /** 
    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 
    623614     */ 
    624615    public function getNormalIterator() 
     
    628619 
    629620    /** 
    630      * takeSnapshot 
    631      * takes a snapshot from this collection 
     621     * Takes a snapshot from this collection 
    632622     * 
    633623     * snapshots are used for diff processing, for example 
     
    648638 
    649639    /** 
    650      * getSnapshot 
    651      * returns the data of the last snapshot 
     640     * Gets the data of the last snapshot 
    652641     * 
    653642     * @return array    returns the data in last snapshot 
     
    659648 
    660649    /** 
    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 
    663651     * 
    664652     * an example: 
     
    680668 
    681669    /** 
    682      * toArray 
    683670     * Mimics the result of a $query->execute(array(), Doctrine::FETCH_ARRAY); 
    684671     * 
     
    699686 
    700687    /** 
    701      * fromArray 
    702      * 
    703688     * Populate a Doctrine_Collection from an array of data 
    704689     * 
     
    715700 
    716701    /** 
    717      * synchronizeWithArray 
    718702     * synchronizes a Doctrine_Collection with data from an array 
    719703     * 
     
    740724        } 
    741725    } 
    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    { 
    745728        return $this->synchronizeWithArray($array); 
    746729    } 
    747730 
    748731    /** 
    749      * exportTo 
    750      * 
    751732     * Export a Doctrine_Collection to one of the supported Doctrine_Parser formats 
    752733     * 
     
    765746 
    766747    /** 
    767      * importFrom 
    768      * 
    769748     * Import data to a Doctrine_Collection from one of the supported Doctrine_Parser formats 
    770749     * 
     
    783762 
    784763    /** 
    785      * getDeleteDiff 
    786      * 
    787      * @return void 
     764     * Perform a delete diff between the last snapshot and the current data 
     765     * 
     766     * @return array $diff 
    788767     */ 
    789768    public function getDeleteDiff() 
    790769    { 
    791         return array_udiff($this->_snapshot, $this->data, array($this, "compareRecords")); 
    792     } 
    793  
    794     /** 
    795      * getInsertDiff 
    796      * 
    797      * @return void 
     770        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 
    798777     */ 
    799778    public function getInsertDiff() 
     
    803782 
    804783    /** 
    805      * compareRecords 
    806784     * 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 
    807789     */ 
    808790    protected function compareRecords($a, $b) 
     
    816798 
    817799    /** 
    818      * save 
    819      * saves all records of this collection and processes the  
     800     * Saves all records of this collection and processes the  
    820801     * difference of the last snapshot and the current data 
    821802     * 
     
    845826 
    846827    /** 
    847      * delete 
    848      * deletes all records from this collection 
     828     * Deletes all records from this collection 
    849829     * 
    850830     * @return Doctrine_Collection 
     
    905885    } 
    906886 
    907  
    908     /** 
    909      * getIterator 
     887    /** 
     888     * Get collection data iterator 
     889     * 
    910890     * @return object ArrayIterator 
    911891     */ 
     
    917897 
    918898    /** 
    919      * returns a string representation of this object 
     899     * Returns a string representation of this object 
     900     * 
     901     * @return string $string 
    920902     */ 
    921903    public function __toString() 
     
    925907     
    926908    /** 
    927      * returns the relation object 
     909     * Returns the relation object 
     910     * 
    928911     * @return object Doctrine_Relation 
    929912     */ 
  • branches/0.11/lib/Doctrine/Collection/Exception.php

    r3884 r4520  
    2121 
    2222/** 
    23  * Doctrine_Collection_Exception 
     23 * Collection exception class 
    2424 * 
    2525 * @package     Doctrine 
  • branches/0.11/lib/Doctrine/Collection/Iterator/Expandable.php

    r4252 r4520  
    2121 
    2222/** 
    23  * Doctrine_Collection_Iterator_Normal 
     23 * Expandable collection iterator class 
    2424 * 
    2525 * @package     Doctrine