Bug #26542

Autoincrement unique identifiers not working anymore

Added by Martin Br├╝ggemann over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2011-05-01
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

I used the @Id and @GeneratedValue properties as seen in the blog example package to have short urls with integer identifiers like /ticket/234 instead of FLOW3 standard resource identifiers. Unfortunately it dosn't work with relations.

Uncaught Exception in FLOW3 Column name `flow3_persistence_identifier` referenced for relation from F3\Guruhelp\Domain\Model\Message towards F3\Guruhelp\Domain\Model\Ticket does not exist. thrown in file Packages/Framework/FLOW3/Resources/PHP/Doctrine/ORM/Tools/SchemaTool.php in line 485

This is an example model

<?php
declare(ENCODING = 'utf-8');
namespace F3\Guruhelp\Domain\Model;

/**
 * @scope prototype
 * @entity
 */
class Ticket {

    /**
     * @identity
     * This ID is only for the ORM.
     *
     * @var integer
     * @Id
     * @GeneratedValue
     */
     protected $id;

[...]

    /**
     * @var \F3\Guruhelp\Domain\Model\Project
     * @ManyToOne(inversedBy="tickets")
     */
     protected $project;

[...]
}

Also available in: Atom PDF