Re: DB_DataObject_FormBuilder: crossLinkExtraFields problem
| From: | Dot Deb | Date: | Sat, 12 Mar 2005 18:30:54 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder: crossLinkExtraFields problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18000@lists.php.net to get a copy of this message | ||
Solved adding a primary key in the x-ref table.
Sorry for those who spent their time on this subject.
Alberto
On Sat, 12 Mar 2005 16:50:19 +0100, Dot Deb <dotdeb@gmail.com> wrote:
> I'm having problem with the option crossLinkExtraFields.
>
> I have two tables:
> project (id, ... )
> institution (id, ... )
> cross linked by
> project_institution (project_id, institution_id, budget)
> where "budget" is a crossLinkExtraFields.
>
> I set up subclasses defining
>
> Project.php
> [...]
> var $fb_crossLinks = array (
> array (
> 'table' => 'project_institution ',
> 'fromField' => 'project_id',
> 'toField' => 'institution_id'
> )
> );
>
> Institution.php
> [...]
> var $fb_crossLinks = array (
> array (
> 'table' => 'project_institution ',
> 'fromField' => 'institution_id'
> 'toField' => 'project_id',
> )
> );
>
> Project_institution.php
> [...]
> var $fb_crossLinkExtraFields = array('budget');
>
> The form is built correctly but, when I submit the form for "Project",
> I obtain an update of the project table and not of the
> project_institution table.
>
> One message that seems related to, is:
>
> FormBuilder: Primary key not detected - storing data not possible.
>
> Note that without the crossLinkExtraFields defined, it works properly.
>
> Is the problem related to my DB design or there is something missing
> in my FB config?
>
> Alberto
>