Class: Doctrine_Connection_UnitOfWork

Source Location: /Doctrine/Connection/UnitOfWork.php

Class Doctrine_Connection_UnitOfWork

Class Overview

Doctrine_Connection_UnitOfWork

Located in /Doctrine/Connection/UnitOfWork.php [line 33]

Doctrine_Connection_Module
   |
   --Doctrine_Connection_UnitOfWork
Author(s): Information Tags:
Version:  $Revision: 2197 $
Link:  www.phpdoctrine.com
Since:  1.0
License:  LGPL

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Doctrine_Connection_Module

Doctrine_Connection_Module::$conn
Doctrine_Connection_Module::$moduleName

Inherited From Doctrine_Connection_Module

Doctrine_Connection_Module::__construct()
Doctrine_Connection_Module::getConnection()
getConnection returns the connection object this module uses
Doctrine_Connection_Module::getModuleName()
getModuleName returns the name of this module

[ Top ]
Method Summary
array   buildFlushTree()   buildFlushTree builds a flush tree that is used in transactions
boolean   delete()   deletes given record and all the related composites this operation is isolated by a transaction
void   deleteComposites()   deletes all related composites this method is always called internally when a record is deleted
boolean   insert()   inserts a record into database
void   save()   saves the given record
void   saveAll()   saveAll persists all the pending records from all tables
void   saveAssociations()   saveAssociations
void   saveGraph()   saves the given record
void   saveRelated()   saveRelated saves all related records to $record
boolean   update()   update updates the given record

[ Top ]
Properties
Methods
buildFlushTree  [line 46]

  array buildFlushTree( $tables  )

buildFlushTree builds a flush tree that is used in transactions

The returned array has all the initialized components in 'correct' order. Basically this means that the records of those components can be saved safely in the order specified by the returned array.

Parameters:
array   $tables:  an array of Doctrine_Table objects or component names

API Tags:
Return:  an array of component names in flushing order
Access:  public


[ Top ]
delete  [line 251]

  boolean delete( Doctrine_Record $record  )

deletes given record and all the related composites this operation is isolated by a transaction

this event can be listened by the onPreDelete and onDelete listeners

Parameters:
Doctrine_Record   $record: 

API Tags:
Return:  true on success, false on failure
Access:  public


[ Top ]
deleteComposites  [line 366]

  void deleteComposites( Doctrine_Record $record  )

deletes all related composites this method is always called internally when a record is deleted

Parameters:
Doctrine_Record   $record: 

API Tags:
Access:  public

Information Tags:
Throws:  PDOException if something went wrong at database level

[ Top ]
insert  [line 485]

  boolean insert( Doctrine_Record $record  )

inserts a record into database

Parameters:
Doctrine_Record   $record:  record to be inserted

API Tags:
Access:  public


[ Top ]
save  [line 215]

  void save( Doctrine_Record $record  )

saves the given record

Parameters:
Doctrine_Record   $record: 

API Tags:
Access:  public


[ Top ]
saveAll  [line 390]

  void saveAll( )

saveAll persists all the pending records from all tables


API Tags:
Access:  public

Information Tags:
Throws:  PDOException if something went wrong at database level

[ Top ]
saveAssociations  [line 332]

  void saveAssociations( Doctrine_Record $record  )

saveAssociations

this method takes a diff of one-to-many / many-to-many original and current collections and applies the changes

for example if original many-to-many related collection has records with primary keys 1,2 and 3 and the new collection has records with primary keys 3, 4 and 5, this method would first destroy the associations to 1 and 2 and then save new associations to 4 and 5

Parameters:
Doctrine_Record   $record: 

API Tags:
Access:  public

Information Tags:
Throws:  PDOException if something went wrong at database level

[ Top ]
saveGraph  [line 140]

  void saveGraph( Doctrine_Record $record  )

saves the given record

Parameters:
Doctrine_Record   $record: 

API Tags:
Access:  public


[ Top ]
saveRelated  [line 292]

  void saveRelated( Doctrine_Record $record  )

saveRelated saves all related records to $record

Parameters:
Doctrine_Record   $record: 

API Tags:
Access:  public

Information Tags:
Throws:  PDOException if something went wrong at database level

[ Top ]
update  [line 420]

  boolean update( Doctrine_Record $record  )

update updates the given record

Parameters:
Doctrine_Record   $record:  record to be updated

API Tags:
Return:  whether or not the update was successful
Access:  public


[ Top ]