Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctrine issue with identifying one-to-one relationship #27

Open
dannykopping opened this issue Aug 5, 2011 · 0 comments
Open

Doctrine issue with identifying one-to-one relationship #27

dannykopping opened this issue Aug 5, 2011 · 0 comments

Comments

@dannykopping
Copy link
Member

In the following YAML, I have an identifying one-to-one relationship:

Video:
  actAs: [Timestampable]
  tableName: Video
  columns:
    id:
      type: integer(4)
      primary: true
      notnull: true
      autoincrement: true
    videoName:
      type: string(500)
      notnull: true
    userId:
      type: integer(4)
      primary: true
      unsigned: true
      notnull: true
    createdAt:
      type: timestamp
    updatedAt:
      type: timestamp
  relations:
    User:
      class: User
      local: userId
      foreign: id
      foreignAlias: video
      onDelete: cascade
      onUpdate: cascade
  indexes:
    fk_Video_User1:
      fields: [userId]

When trying to save a VideoVO record, I get the following error:
Illegal offset type in isset or empty

This error occurs on line 1202 on Doctrine/Record.php where it checks if the Record has an accessor - this function is expecting a scalar value, but an identifying relationship has two primary keys and the function fails.

We should maybe look for a fix in the Doctrine repo, otherwise we should override it in Aerial_Record.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant