ref/DirFixtures (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of ref/DirFixtures

bshirley (IP:
01/19/09 22:18:57 (9 years ago)



  • ref/DirFixtures

    v0 v1  
     1= fixtures = 
     3Fixtures are data that's loaded into the model (and ultimately the database) to initialize the state of the project.  Some fixtures are to initialize the project itself.  Others are used to set up test cases. 
     5== Locations == 
     12== Contents == 
     14Depending on whether you are using Propel or Doctrine, you may need to organize your fixtures differently.  They are Yaml versions of data.  They need to contain data appropriate for their model definitions.  The top level is the entity name, each level below that is a named instance.  Named instances can be references elsewhere via their name.  A subset of php can be used to pre-process these files, allowing you to populate large data sets. 
     16Propel (currently) requires the reference data to be defined before it's referenced.  So, file names beginning numerically is commonly seen. 
     18== Examples == 
     20data from a fixture file from from [ Jobeet(Doctrine)]: 
     24  job_sensio_labs: 
     25    JobeetCategory: programming 
     26    type:         full-time 
     27    company:      Sensio Labs 
     28    logo:         /uploads/jobs/sensio_labs.png 
     29    url: 
     30    position:     Web Developer 
     31    location:     Paris, France 
     32    description:  | 
     33      You've already developed websites with symfony and you want to work 
     34      with Open-Source technologies. You have a minimum of 3 years 
     35      experience in web development with PHP or Java and you wish to 
     36      participate to development of Web 2.0 sites using the best 
     37      frameworks available. 
     38    how_to_apply: | 
     39      Send your resume to fabien.potencier [at] 
     40    is_public:    true 
     41    is_activated: true 
     42    token:        job_sensio_labs 
     43    email: 
     44    expires_at:   '2008-12-25' 
     47== References ==