PHP Class sfPropelData, sfPropelORMPlugin

Author: Fabien Potencier ([email protected])
Inheritance: extends sfData
显示文件 Open project: propelorm/sfPropelORMPlugin Class Usage Examples

Protected Properties

Property Type Description
$cacheKeepDuration The cache duration
$con
$deletedClasses
$dispatcher
$formatter

Public Methods

Method Description
__construct ( $cacheKeepDuration = 7200 )
dumpData ( string $directoryOrFile, mixed $tables = 'all', string $connectionName = 'propel' ) Dumps data to fixture from one or more tables.
fixOrderingOfForeignKeyData ( array $classes ) Fixes the ordering of foreign key data, by outputting data a foreign key depends on before the table with the foreign key.
getData ( mixed $tables = 'all', string $connectionName = 'propel' ) : array Returns data from one or more tables.
initialize ( sfEventDispatcher $dispatcher, sfFormatter $formatter ) Initializes the sfPropelData instance.
loadData ( mixed $directoryOrFile = null, string $connectionName = 'propel' ) Loads data from a file or directory into a Propel data source
loadDataFromArray ( array $data ) Implements the abstract loadDataFromArray method and loads the data using the generated data model.
log ( $message, $size = null, $style = 'INFO' )

Protected Methods

Method Description
doDeleteCurrentData ( array $files ) Clears existing data from the data source by reading the fixture files and deleting the existing data for only those classes that are mentioned in the fixtures.
doLoadDataFromFile ( string $file ) Loads data for the database from a YAML file
fixOrderingOfForeignKeyDataInSameTable ( $resultsSets, $tableName, $column, $in = null )
loadMany2Many ( BaseObject $obj, string $middleTableName, array $values ) Loads many to many objects.
loadMapBuilders ( $connectionName ) Loads all map builders for a given connection name

Method Details

__construct() public method

public __construct ( $cacheKeepDuration = 7200 )

doDeleteCurrentData() protected method

Clears existing data from the data source by reading the fixture files and deleting the existing data for only those classes that are mentioned in the fixtures.
protected doDeleteCurrentData ( array $files )
$files array The list of YAML files.

doLoadDataFromFile() protected method

Loads data for the database from a YAML file
protected doLoadDataFromFile ( string $file )
$file string The path to the YAML file.

dumpData() public method

Dumps data to fixture from one or more tables.
public dumpData ( string $directoryOrFile, mixed $tables = 'all', string $connectionName = 'propel' )
$directoryOrFile string The directory or file to dump to
$tables mixed The name or names of tables to dump (or all to dump all tables)
$connectionName string The connection name (default to propel)

fixOrderingOfForeignKeyData() public method

Fixes the ordering of foreign key data, by outputting data a foreign key depends on before the table with the foreign key.
public fixOrderingOfForeignKeyData ( array $classes )
$classes array The array with the class names.

fixOrderingOfForeignKeyDataInSameTable() protected method

protected fixOrderingOfForeignKeyDataInSameTable ( $resultsSets, $tableName, $column, $in = null )

getData() public method

Returns data from one or more tables.
public getData ( mixed $tables = 'all', string $connectionName = 'propel' ) : array
$tables mixed name or names of tables to dump (or all to dump all tables)
$connectionName string connection name
return array An array of database data

initialize() public method

Initializes the sfPropelData instance.
public initialize ( sfEventDispatcher $dispatcher, sfFormatter $formatter )
$dispatcher sfEventDispatcher A sfEventDispatcher instance
$formatter sfFormatter A sfFormatter instance

loadData() public method

Loads data from a file or directory into a Propel data source
See also: sfPropelData::loadData()
public loadData ( mixed $directoryOrFile = null, string $connectionName = 'propel' )
$directoryOrFile mixed A file or directory path or an array of files or directories
$connectionName string The Propel connection name, default 'propel'

loadDataFromArray() public method

Implements the abstract loadDataFromArray method and loads the data using the generated data model.
public loadDataFromArray ( array $data )
$data array The data to be loaded into the data source

loadMany2Many() protected method

Loads many to many objects.
protected loadMany2Many ( BaseObject $obj, string $middleTableName, array $values )
$obj BaseObject A Propel object
$middleTableName string The middle table name
$values array An array of values

loadMapBuilders() protected method

Use sfFileCache to cache propel databaseMap
protected loadMapBuilders ( $connectionName )

log() public method

public log ( $message, $size = null, $style = 'INFO' )

Property Details

$cacheKeepDuration protected_oe property

The cache duration
protected $cacheKeepDuration

$con protected_oe property

protected $con

$deletedClasses protected_oe property

protected $deletedClasses

$dispatcher protected_oe property

protected $dispatcher

$formatter protected_oe property

protected $formatter