Notifications
 

How To Import Data Fixtures?

Category Intactix | Asked By Sonal Gupta | Asked On Jun 1, 2014 | 1 Answers
 
Answer using your Joblagao account
 
Close

Leave your answer

 
or answer with facebook account
 
Anant Srivastava answered| Jun 2, 2014

Importing data fixtures is just as easy as dumping. You can use the loadData() function:

Doctrine_Core::loadData('/path/to/data.yml');

You can either specify an individual yml file like we have done above, or you can specify an entire directory:

 

Doctrine_Core::loadData('/path/to/directory');

If you want to append the imported data to the already existing data then you need to use the second argument of the loadData() function. If you don’t specify the second argument as true then the data will be purged before importing.

 

Here is how you can append instead of purging:

 

Doctrine_Core::loadData('/path/to/data.yml', true);