0
votes

I'm creating a plugin for Symfony. I use doctrine. This is scheme.yml of the plugin.

options:
  type: INNODB

aArtist:
  columns:
    artist_id:
      type: integer
      primary: true
      autoincrement: true
    title:
      type: string(255)
      notnull: true
    tag:
      type: varchar(255)
      notnull: true
    bio:
      type: string
    image:
      type: varchar(255)
    published_at:
      type: timestamp
    band_link_website:
      type: varchar(255)
    band_link_twitter:
      type: varchar(255)
    band_link_facebook:
      type: varchar(255)
    band_link_youtube:
      type: varchar(255)
    appearance_2011:
      type: varchar(255)
    appearance_2010:
      type: varchar(255)

...

But when I run...

/symfony doctrine:build --all

At the end, I get a message saying...

no fields specified for table "a_artist"

And my active record don't work as they should.

$artist = new aArtist()
$artist->title = "Metallica";
$artist->save();

will give an error 'Unknown record property / related component "title" on "aArtist"'.

Any idea what I'm doing wrong?

1
Make sure you're using spaces and not tabs. - Maerlyn
Have you considered using Symfony 2? Symfony 1.* is legacy now. - Adam Arold
Hardly legacy....still has another year or so of LTS. After that time, then yeah, i'll consider it legacy ;-) - Flukey
Why are you setting some as varchar and some as strings? Just use string. - Flukey

1 Answers

0
votes

Why you dont use method setTitle()?

$artist = new aArtist()
$artist->setTitle("Mettalica");
$artist->save();