Class Scenario_Data_Adapter

Description

Data adapter (abstract)

Abstract class containing all methods needed.

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

Located in /Scenario/Data/Adapter.php (line 33)


	
			
Direct descendents
Class Description
Scenario_Data_Adapter_Pdo PDO (PHP Data Objects) DBAL adapter.
Scenario_Data_Adapter_Zend Data adapter for Zend Framework db objects.
Class Constant Summary
 TABLE_EXPERIMENTS = 'experiments'
 TABLE_TREATMENTS = 'treatments'
 TABLE_USERS_TREATMENTS = 'users_treatments'
Variable Summary
Method Summary
Scenario_Experiment AddExperiment (string $name, [array $data = array()])
void ClearExperiment (string|Scenario_Experiment $experiment, [bool $delete = false])
void ClearTreatment (string|Scenario_Experiment $experiment, string|Scenario_Treatment $treatment, [bool $delete = false])
Scenario_Experiment GetExperiment (string $experimentname, [bool $create = true])
array GetExperimentData (string $name)
array GetExperiments ()
Scenario_Treatment GetTreatment (Scenario_Experiment $experiment, Scenario_Identity $id, [bool $create = true])
Scenario_Treatment|null GetTreatmentByName (Scenario_Experiment $experiment, string $name)
void setCore (Scenario_Core $core)
Variables
Scenario_Core $_core (line 44)
  • var: instance of the core that contains this adapter.
  • access: protected
Methods
AddExperiment (line 124)

Add an experiment

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

  • return: The created experiment object.
  • abstract:
  • 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.

Redefined in descendants as:
ClearExperiment (line 104)

Clears all data for an experiment.

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

  • abstract:
  • 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.

Redefined in descendants as:
ClearTreatment (line 94)

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).

  • abstract:
  • 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.

Redefined in descendants as:
FinishTreatment (line 214)

Finish a treatment

Modify a test/id (treatment) combo as being a completed goal. If the treatment does not exist, the call should be ignored, rather than creating a new treatment.

  • abstract:
  • access: public
void FinishTreatment (Scenario_Treatment $treatment, Scenario_Identity $id)

Redefined in descendants as:
getCore (line 60)

Gets the core instance in use by this adapter.

  • return: Core instance to use.
  • access: public
Scenario_Core|null getCore ()
GetExperiment (line 135)

Get an experiment.

Get a experiment object from the data source, optionally creating the record if it doesn't exist.

  • return: The requested experiment object, or null if unavailable & not created.
  • access: public
Scenario_Experiment GetExperiment (string $experimentname, [bool $create = true])
  • string $experimentname: Name of the experiment. May be case sensitive.
  • bool $create: Whether or not to create the experiment if it doesn't exist. (Optional)
GetExperimentByName (line 72)

Get an experiment by its name.

Fetch a test from the data source by its unique name

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

Redefined in descendants as:
GetExperimentData (line 82)

Get extended data for an experiment.

Deserialize and return the data stored in association with an experiment.

  • return: Array of data stored in the requested test record.
  • abstract:
  • access: public
array GetExperimentData (string $name)
  • string $name: Unique name of the desired experiment record.

Redefined in descendants as:
GetExperiments (line 113)

Get all existing experiments.

Retrieves an array of stored Scenario_Experiment objects.

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

Redefined in descendants as:
GetResults (line 166)

Fetch all results for a given experiment as a Scenario_ResultSet

  • return: results
  • abstract:
  • access: public
Scenario_ResultSet GetResults (string|Scenario_Experiment $experiment)

Redefined in descendants as:
GetTreatment (line 195)

Gets a treatment for a given experiment/ident set and optionally creates and saves a treatment if it doesn't already exist.

  • return: Treatment retrieved.
  • access: public
Scenario_Treatment GetTreatment (Scenario_Experiment $experiment, Scenario_Identity $id, [bool $create = true])
  • Scenario_Experiment $experiment: Test to get a treatment for.
  • Scenario_Identity $id: Identity to get a treatment for.
  • bool $create: Whether or not to create the treatment if it doesn't exist.
GetTreatmentByName (line 150)

Retrieves a specific treatment object.

  • return: Treatment retrieved or null on failure.
  • abstract:
  • 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.

Redefined in descendants as:
GetTreatmentForIdentity (line 175)

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

  • abstract:
  • access: public
Scenario_Treatment GetTreatmentForIdentity (Scenario_Experiment $test, Scenario_Identity $id)

Redefined in descendants as:
GetTreatmentsForExperiment (line 158)

Fetches all possible treatments for a given experiment.

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

Redefined in descendants as:
setCore (line 51)

Sets the core to use for this adapter.

  • access: public
void setCore (Scenario_Core $core)
  • Scenario_Core $core: Core instance to use for any calls in this adapter.
SetTreatment (line 184)

Set a test/id combo to a specific treatment

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

Redefined in descendants as:
Class Constants
TABLE_EXPERIMENTS = 'experiments' (line 35)
TABLE_TREATMENTS = 'treatments' (line 36)
TABLE_USERS_TREATMENTS = 'users_treatments' (line 37)

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