class Doctrine_Data (View source)

Doctrine_Data

Base Doctrine_Data class for dumping and loading data to and from fixtures files. Support formats are based on what formats are available in Doctrine_Parser such as yaml, xml, json, etc.

Properties

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

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

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