class Doctrine_Data_Export extends Doctrine_Data (View source)

Doctrine_Data_Export

Properties

protected string $_formats formats from Doctrine_Data
protected string $_format format from Doctrine_Data
protected string $_directory directory from Doctrine_Data
protected string $_models models from Doctrine_Data
protected string $_exportIndividualFiles _exportIndividualFiles from Doctrine_Data

Methods

void
setFormat(string $format)

setFormat

void
getFormat()

getFormat

void
getFormats()

getFormats

void
setDirectory($directory)

setDirectory

void
getDirectory()

getDirectory

void
setModels(string $models)

setModels

void
getModels()

getModels

bool
exportIndividualFiles($bool = null)

_exportIndividualFiles

void
exportData(string $directory, string $format = 'yml', string $models = array(), string $_exportIndividualFiles = false)

exportData

void
importData($directory, $format = 'yml', $models = array(), $append = false)

importData

void
isRelation(Doctrine_Record $record, $fieldName)

isRelation

void
purge(string $models = null)

purge

void
__construct(string $directory)

constructor

void
doExport()

doExport

void
dumpData(array $data)

dumpData

array
prepareData(string $data)

prepareData

Details

void setFormat(string $format)

setFormat

Set the current format we are working with

Parameters

string $format

Return Value

void

void getFormat()

getFormat

Get the current format we are working with

Return Value

void

void getFormats()

getFormats

Get array of available formats

Return Value

void

void setDirectory($directory)

setDirectory

Set the array/string of directories or yml file paths

Parameters

$directory

Return Value

void

void getDirectory()

getDirectory

Get directory for dumping/loading data from and to

Return Value

void

void setModels(string $models)

setModels

Set the array of specified models to work with

Parameters

string $models

Return Value

void

void getModels()

getModels

Get the array of specified models to work with

Return Value

void

bool exportIndividualFiles($bool = null)

_exportIndividualFiles

Set/Get whether or not to export individual files

Parameters

$bool

Return Value

bool $_exportIndividualFiles

void exportData(string $directory, string $format = 'yml', string $models = array(), string $_exportIndividualFiles = false)

exportData

Interface for exporting data to fixtures files from Doctrine models

Parameters

string $directory
string $format
string $models
string $_exportIndividualFiles

Return Value

void

void importData($directory, $format = 'yml', $models = array(), $append = false)

importData

Interface for importing data from fixture files to Doctrine models

Parameters

$directory
$format
$models
$append

Return Value

void

void isRelation(Doctrine_Record $record, $fieldName)

isRelation

Check if a fieldName on a Doctrine_Record is a relation, if it is we return that relationData

Parameters

Doctrine_Record $record
$fieldName

Return Value

void

void purge(string $models = null)

purge

Purge all data for loaded models or for the passed array of Doctrine_Records

Parameters

string $models

Return Value

void

void __construct(string $directory)

constructor

Parameters

string $directory

Return Value

void

void doExport()

doExport

FIXME: This function has ugly hacks in it for temporarily disabling INDEXBY query parts of tables to export.

Update from jwage: I am not sure if their is any other better solution for this. It may be the correct solution to disable the indexBy settings for tables when exporting data fixtures. Maybe a better idea would be to extract this functionality to a pair of functions to enable/disable the index by settings so simply turn them on and off when they need to query for the translations standalone and don't need it to be indexed by the lang.

Return Value

void

void dumpData(array $data)

dumpData

Dump the prepared data to the fixtures files

Parameters

array $data

Return Value

void

array prepareData(string $data)

prepareData

Prepare the raw data to be exported with the parser

Parameters

string $data

Return Value

array