logo
Ask your Symfony questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$20
I need help with schema and propel-build-model in Symfony 1.0

Symfony version 1.0.20

This is the first time I've ever worked with version 1.0 of Symfony (I started using Symfony at version 1.1 and have never before had to work on an old installation).

I'm converting an old Java site to Symfony. I am just starting on this project, but the project has been ongoing. Parts of the Symfony site have been under development for 2 years. This company is slowly changing all of their code from the 90s and early 00s over to Symfony. However, for some reason they chose not to use the YAML files. They hand coded all their model classes.

I just created the first entry for a table in the top level config/schema.yml:

propel:
oracle_import:
id: { type:integer, required: true, primaryKey: true, autoIncrement: true }
type_id: { type:integer, required:false }
title: { type:varchar(255), required:false }
byline: { type:varchar(255), required:false }
header: { type:longvarchar, required:false }
subheader: { type:longvarchar, required:false }
body: { type:longvarchar, required:false }
footer: { type:longvarchar, required:false }
live_flag: { type:varchar(1), required:false }
date: { type:timestamp, required:false }
created_by_user: { type:varchar(30), required:false }
modify_by_user: { type:varchar(30), required:false }


I wanted to auto-generate the model class for this. I looked here to find the right command for version 1.0 of Symfony:

http://www.symfony-project.org/book/1_0/08-Inside-the-Model-Layer

Then I ran this command:

symfony propel-build-model

I got this error:

Fatal error: Unsupported operand types in /usr/share/php/symfony/util/Spyc.class.php on line 667

Does anyone know what this means? How to troubleshoot this?

This question has been answered.

marshall | 04/05/10 at 6:07pm Edit


(6) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    04/05/10
    9:54pm
    Wouter Peschier says:

    It could be a problem with not having space after the colon.

    So instead of writing:
    id: { type:integer, required: true, primaryKey: true, autoIncrement: true }
    type_id: { type:integer, required:false }
    etc.

    write it like this:
    id: { type: integer, required: true, primaryKey: true, autoIncrement: true }
    type_id: { type: integer, required: false }
    etc.

    Previous versions of this answer: 04/05/10 at 6:15pm

  • avatar
    Last edited:
    04/05/10
    6:14pm
    Arturo Linares says:

    You need a space after each colon.

    Replace:

    id: { type:integer ...

    with
    id: { type: integer

  • avatar
    Last edited:
    04/05/10
    6:23pm
    Marcos IbaƱez says:

    You have to put a blank space between every colon and it's value.

    Do that for each pair of label-value and it will work without problems.

    Here is the correct yaml file:


    propel:
    oracle_import:
    id: { type: integer, required: true, primaryKey: true, autoIncrement: true }
    type_id: { type: integer, required: false }
    title: { type: varchar(255), required: false }
    byline: { type: varchar(255), required: false }
    header: { type: longvarchar, required: false }
    subheader: { type: longvarchar, required: false }
    body: { type: longvarchar, required: false }
    footer: { type: longvarchar, required: false }
    live_flag: { type: varchar(1), required: false }
    date: { type: timestamp, required: false }
    created_by_user: { type: varchar(30), required: false }
    modify_by_user: { type: varchar(30), required: false }

    I attach an image of how the text should be formatted for it to work.

    attachment image expert uploaded image

    Previous versions of this answer: 04/05/10 at 6:21pm | 04/05/10 at 6:22pm | 04/05/10 at 6:23pm

  • avatar
    Last edited:
    04/05/10
    6:19pm
    Dan Tudor says:

    The yaml you posted works fine with symfony 1.2.3

    What version of symfony are you using ? (./symfony -V)

  • avatar
    Last edited:
    04/05/10
    6:55pm
    casivaagustin says:

    The problem its the spaces like the other answers say. You must put a blank space after the semicolon, just like Marcos explained.

    After you change your schema you must run.

    symfony propel-build-model

    And don't forget

    symfony cc

    Cheers

  • avatar
    Last edited:
    04/05/10
    6:21pm
    Dan Tudor says:

    Just noticed you posted your symfony version in the question...
    You should upgrade to version 1.3 as 1.0 is no longer maintained.

This question has expired.





Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.