phpDocumentor Web Commons
[ class tree: Web Commons ] [ index: Web Commons ] [ all elements ]

Class: AbstractDAO

Source Location: /persistence.php

Class AbstractDAO

Class Overview

Serves as a basis for a PDO DAO.

Located in /persistence.php [line 37]



		
				Author(s):
		
API Tags:
Abstract:  

Information Tags:
Since:  0.1

Methods

[ Top ]
Method Summary
PDOStatement   execute()   Prepares and executes a SQL $statement within the connection
Entity   hydrate()   Interprets row data.
int   insertAndReturnId()   Executes an insert statement and returns the last insert id.
array   select()   Executes a statement and maps the resulting rows with AbstractDAO::hydrate().
void   setDataSource()  

[ Top ]
Methods
execute  [line 56]

  PDOStatement execute( string $statement, [mixed[] $args = array()]  )

Prepares and executes a SQL $statement within the connection

Parameters:
string   $statement: 
mixed[]   $args: 

API Tags:
Access:  protected

Information Tags:
Since:  0.1

[ Top ]
hydrate  [line 102]

  Entity hydrate( array $row  )

Interprets row data.

This default implementation returns the row itself. Override this method to add custom behaviour.

Parameters:
array   $row:  an associative array containing row values.

API Tags:
Access:  protected

Information Tags:
Since:  0.1

[ Top ]
insertAndReturnId  [line 73]

  int insertAndReturnId( string $statement, arrray $args, [ $serial = Null]  )

Executes an insert statement and returns the last insert id.

Parameters:
string   $statement: 
arrray   $args: 
   $serial: 

API Tags:
Return:  the last insert id for the data source
Access:  protected

Information Tags:
Todo:  Make it more transparent for PostgreSQL: it might guess serial name
Since:  0.1

[ Top ]
select  [line 87]

  array select( string $statement, [array $args = array()]  )

Executes a statement and maps the resulting rows with AbstractDAO::hydrate().

Parameters:
string   $statement: 
array   $args: 

API Tags:
Access:  protected

Information Tags:
Since:  0.1

[ Top ]
setDataSource  [line 44]

  void setDataSource( DataSource $ds  )

Parameters:
DataSource   $ds: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Fri, 16 Jul 2010 00:48:39 +0200 by phpDocumentor 1.4.3