Class Scenario_Data_Adapter_Pdo

Description

PDO (PHP Data Objects) DBAL adapter.

Adapter for PDO db abstraction layer.

  • copyright: Copyright (c) 2010 TK Studios. (http://www.tkstudios.com)
  • license: New BSD License

Located in /Scenario/Data/Adapter/Pdo.php (line 36)

Scenario_Data_Adapter
   |
   --Scenario_Data_Adapter_Pdo
Variable Summary
array $_tables
Method Summary
Scenario_Data_Adapter_Pdo __construct ( $dsn, [ $user = ''], [ $pass = ''])
Scenario_Experiment AddExperiment (string $name, [array $data = array()])
bool AddTreatment (Scenario_Experiment $exp, string $treatmentname)
void ClearExperiment (string|Scenario_Experiment $experiment, [bool $delete = false])
void ClearTreatment (string|Scenario_Experiment $experiment, string|Scenario_Treatment $treatment, [bool $delete = false])
PDO getDbAdapter ()
void GetExperimentData (string $name)
int GetExperimentID (string $name)
array GetExperiments ()
Scenario_ResultSet GetResults (mixed $experiment)
Scenario_Treatment|null GetTreatmentByName (Scenario_Experiment $experiment, string $name)
int GetTreatmentID (Scenario_Experiment $exp, string $treatmentname)
string __get (string $name)
Variables
PDO $_dbAdapter (line 43)

PDO object.

  • access: protected
array $_tables (line 50)

Table definitions, drawn from core option 'db.tables'

  • access: protected

Inherited Variables

Inherited from Scenario_Data_Adapter

Scenario_Data_Adapter::$_core
Methods
Constructor __construct (line 85)
  • access: public
Scenario_Data_Adapter_Pdo __construct ( $dsn, [ $user = ''], [ $pass = ''])
  • $dsn
  • $user
  • $pass
AddExperiment (line 563)

Create a new Experiment record in the data source, with a unique name and optional serialized data

  • return: The created experiment object.
  • access: public
Scenario_Experiment AddExperiment (string $name, [array $data = array()])
  • string $name: Unique name to assign the experiment.
  • array $data: Optional data to be serialized in the record.

Redefinition of:
Scenario_Data_Adapter::AddExperiment()
Add an experiment
AddTreatment (line 437)

Add a treatment

  • return: Whether the operation was successful
  • access: protected
bool AddTreatment (Scenario_Experiment $exp, string $treatmentname)
ClearExperiment (line 201)

Clears all data for an experiment.

Clears all collected data for an experiment, optionally deleting the actual experiment record.

  • access: public
void ClearExperiment (string|Scenario_Experiment $experiment, [bool $delete = false])
  • string|Scenario_Experiment $experiment: The experiment to clear.
  • bool $delete: Whether or not to delete the record after clearing its data.

Redefinition of:
Scenario_Data_Adapter::ClearExperiment()
Clears all data for an experiment.
ClearTreatment (line 160)

Clears all records for a given treatment/experiment combo.

Deletes all records of the desired experiment/treatment. Useful if you want to keep the data for a few treatments (control, for example).

  • access: public
void ClearTreatment (string|Scenario_Experiment $experiment, string|Scenario_Treatment $treatment, [bool $delete = false])
  • string|Scenario_Experiment $experiment: Experiment that the treatment belongs to.
  • string|Scenario_Treatment $treatment: Treatment you wish to clear.
  • bool $delete: Whether or not to delete the actual treatment record after clearing its data.

Redefinition of:
Scenario_Data_Adapter::ClearTreatment()
Clears all records for a given treatment/experiment combo.
FinishTreatment (line 522)

Modify a treatment/id combo as being a completed goal

  • return: Success
  • access: public
bool FinishTreatment (Scenario_Treatment $treatment, Scenario_Identity $id)

Redefinition of:
Scenario_Data_Adapter::FinishTreatment()
Finish a treatment
getDbAdapter (line 115)

Get the current PDO object.

Gets the PDO adapter to use. The PDO object must have been created by the adapter's contructor.

  • return: Adapter to use for all data storage operations.
  • access: public
PDO getDbAdapter ()
GetExperimentByName (line 134)

Retrieve an experiment by name.

Fetch an experiment from the data source by its unique name. May be case sensitive.

  • return: The experiment object associated with the provided unique name. Returns null if not found.
  • access: public
Scenario_Experiment GetExperimentByName (string $name)
  • string $name: Unique name of the desired experiment record.

Redefinition of:
Scenario_Data_Adapter::GetExperimentByName()
Get an experiment by its name.
GetExperimentData (line 552)
  • todo:
  • access: public
void GetExperimentData (string $name)
  • string $name

Redefinition of:
Scenario_Data_Adapter::GetExperimentData()
Get extended data for an experiment.
GetExperimentID (line 260)

Gets the ID of an experiment, if it exists in the database.

  • access: public
int GetExperimentID (string $name)
  • string $name
GetExperiments (line 236)

Get all existing experiments.

Retrieves an array of stored Scenario_Experiment objects.

  • return: An array of Scenario_Experiment objects.
  • access: public
array GetExperiments ()

Redefinition of:
Scenario_Data_Adapter::GetExperiments()
Get all existing experiments.
GetResults (line 474)

Getch all results for a given experiment as a Scenario_ResultSet

  • return: Result collection.
  • access: public
Scenario_ResultSet GetResults (mixed $experiment)
  • mixed $experiment: Experiment to fetch results for, accepts string or Scenario_Experiment object.

Redefinition of:
Scenario_Data_Adapter::GetResults()
Fetch all results for a given experiment as a Scenario_ResultSet
GetTreatmentByName (line 307)

Get a specific treatment by name.

Retrieves a specific treatment object, including its primary key (row id).

  • return: Treatment retrieved or null on failure.
  • access: public
Scenario_Treatment|null GetTreatmentByName (Scenario_Experiment $experiment, string $name)
  • Scenario_Experiment $experiment: Experiment to restrict the search to.
  • string $name: Name of the treatment to retrieve.

Redefinition of:
Scenario_Data_Adapter::GetTreatmentByName()
Retrieves a specific treatment object.
GetTreatmentForIdentity (line 277)

Get an existing treatment.

Retrieve the current treatment in use by a Experiment/id combo. Returns null if not yet in use.

  • access: public
Scenario_Treatment|null GetTreatmentForIdentity (Scenario_Experiment $experiment, Scenario_Identity $id)

Redefinition of:
Scenario_Data_Adapter::GetTreatmentForIdentity()
Retrieve the current treatment in use by a test/id combo. Returns null if not yet in use.
GetTreatmentID (line 459)

GetTreatmentID

  • return: primary key (int) of the treatment in question
  • access: protected
int GetTreatmentID (Scenario_Experiment $exp, string $treatmentname)
GetTreatmentsForExperiment (line 333)

Get available treatments for an experiment.

Fetches all possible treatments for a given experiment. They must have already been registered in the database.

  • return: Returns an array of Scenario_Treatment objects.
  • access: public
array GetTreatmentsForExperiment (Scenario_Experiment $experiment)

Redefinition of:
Scenario_Data_Adapter::GetTreatmentsForExperiment()
Fetches all possible treatments for a given experiment.
SetTreatment (line 370)

Set a Experiment/id combo to a specific treatment

  • access: public
void SetTreatment (Scenario_Experiment $experiment, Scenario_Treatment $value, Scenario_Identity $id)

Redefinition of:
Scenario_Data_Adapter::SetTreatment()
Set a test/id combo to a specific treatment
__get (line 58)

Getter override, used for table lookups.

  • access: public
string __get (string $name)
  • string $name

Inherited Methods

Inherited From Scenario_Data_Adapter

Scenario_Data_Adapter::AddExperiment()
Scenario_Data_Adapter::ClearExperiment()
Scenario_Data_Adapter::ClearTreatment()
Scenario_Data_Adapter::FinishTreatment()
Scenario_Data_Adapter::getCore()
Scenario_Data_Adapter::GetExperiment()
Scenario_Data_Adapter::GetExperimentByName()
Scenario_Data_Adapter::GetExperimentData()
Scenario_Data_Adapter::GetExperiments()
Scenario_Data_Adapter::GetResults()
Scenario_Data_Adapter::GetTreatment()
Scenario_Data_Adapter::GetTreatmentByName()
Scenario_Data_Adapter::GetTreatmentForIdentity()
Scenario_Data_Adapter::GetTreatmentsForExperiment()
Scenario_Data_Adapter::setCore()
Scenario_Data_Adapter::SetTreatment()
Class Constants

Documentation generated on Sat, 23 Oct 2010 18:10:48 -0400 by phpDocumentor 1.4.3