Skip to content

jonocode – a developer's blog

I moved! –> http://pressreload.com

Here is something to watch out for. If you define global behaviors in your schema, and then define table-level behaviors, the global behavior will be removed (unless you declare it again on the table level).

Here is a quick example:

actAs: [Timestampable]

Program:
  actAs:
    Sluggable:
      fields: [name]
  columns:
    name: string(255)
    user_id: integer(4)
  relations:
    sfGuardUser:
      foreignType: many
      type: one
      local: user_id
      foreign: id

For a short while I couldn’t figure out why the created_at and updated_at fields weren’t showing up in the Program table. Then I realized that it was removed at the table level, and I had to add it in again.

The official documentation does not mention this:

http://www.symfony-project.org/doctrine/1_2/en/04-Schema-Files#chapter_04_global_schema_information

Hopefully this will save you 15 minutes of scratching your head.

Here is more information on Symfony 1.2 and doctrine:

http://www.symfony-project.org/doctrine/1_2/en/04-Schema-Files

Advertisements

%d bloggers like this: