Changeset 4963 for trunk/lib/Doctrine

Show
Ignore:
Timestamp:
09/13/08 11:36:58 (4 months ago)
Author:
romanb
Message:

removed some more legacy

Location:
trunk/lib/Doctrine
Files:
4 removed
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine/ORM/ActiveEntity.php

    r4939 r4963  
    2222    public function save() 
    2323    { 
    24         // TODO: Forward to EntityManager. There: registerNew() OR registerDirty() on UnitOfWork. 
    2524        $this->_em->save($this); 
    26     } 
    27      
    28     /** 
    29      * Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT 
    30      * query, except that if there is already a row in the table with the same 
    31      * key field values, the REPLACE query just updates its values instead of 
    32      * inserting a new row. 
    33      * 
    34      * The REPLACE type of query does not make part of the SQL standards. Since 
    35      * practically only MySQL and SQLIte implement it natively, this type of 
    36      * query isemulated through this method for other DBMS using standard types 
    37      * of queries inside a transaction to assure the atomicity of the operation. 
    38      * 
    39      * @param Doctrine_Connection $conn             optional connection parameter 
    40      * @throws Doctrine_Connection_Exception        if some of the key values was null 
    41      * @throws Doctrine_Connection_Exception        if there were no key fields 
    42      * @throws Doctrine_Connection_Exception        if something fails at database level 
    43      * @return integer                              number of rows affected 
    44      * @todo ActiveEntity method. 
    45      */ 
    46     public function replace() 
    47     { 
    48         return $this->_em->replace( 
    49                 $this->_class, 
    50                 $this->getPrepared(), 
    51                 $this->_id); 
    5225    } 
    5326     
     
    214187     * 
    215188     * @return boolean  TRUE on success, FALSE on failure. 
    216      * @todo ActiveRecord method. 
    217189     */ 
    218190    public function delete() 
    219191    { 
    220         // TODO: Forward to EntityManager. There: registerRemoved() on UnitOfWork 
    221192        return $this->_em->remove($this); 
    222193    } 
     
    269240     * @param array $ids        the identifiers of the related records 
    270241     * @return Doctrine_Entity  this object 
    271      * @todo ActiveEntity method. 
    272242     */ 
    273243    public function unlink($alias, $ids = array()) 
     
    323293     * @param array $ids        the identifiers of the related records 
    324294     * @return Doctrine_Entity  this object 
    325      * @todo ActiveEntity method. 
    326295     */ 
    327296    public function link($alias, array $ids) 
  • trunk/lib/Doctrine/ORM/EntityRepository.php

    r4947 r4963  
    2727 * Provides basic finder methods, common to all repositories. 
    2828 * 
    29  * @package     Doctrine 
    30  * @subpackage  EntityRepository 
    3129 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    32  * @link        www.phpdoctrine.org 
     30 * @link        www.doctrine-project.org 
    3331 * @since       2.0 
    3432 * @version     $Revision$ 
     
    4139    protected $_classMetadata; 
    4240     
    43     public function __construct($entityName, Doctrine_ClassMetadata $classMetadata) 
     41    public function __construct($entityName, Doctrine_ORM_Mapping_ClassMetadata $classMetadata) 
    4442    { 
    4543        $this->_entityName = $entityName; 
     
    7169    public function clear() 
    7270    { 
    73         $this->_em->unitOfWork->clearIdentitiesForEntity($this->_classMetadata->getRootClassName()); 
     71        $this->_em->getUnitOfWork()->clearIdentitiesForEntity($this->_classMetadata->getRootClassName()); 
    7472    } 
    7573     
     
    186184     * 
    187185     * @return void 
    188      * @throws Doctrine_Mapper_Exception  If the method called is an invalid find* method 
     186     * @throws BadMethodCallException  If the method called is an invalid find* method 
    189187     *                                    or no find* method at all and therefore an invalid 
    190188     *                                    method call. 
     
    199197            $method = 'findOneBy'; 
    200198        } else { 
    201             throw new Doctrine_Mapper_Exception("Undefined method '$method'."); 
     199            throw new BadMethodCallException("Undefined method '$method'."); 
    202200        } 
    203201