I never try to use a varchar pk wtih cake btw if you can add/edit
EntryTypes in your database, I don't see the reason it won't work with
an exotic pk
may be an idea: did you try to "force" your model definitions like
this:
'EntryType' => array (
'className' => 'EntryType ',
'foreignKey' => 'entry_type_id'
)
?
On 16 jan, 16:25, Rob Wilkerson <[email protected]> wrote:
> On Fri, Jan 16, 2009 at 9:38 AM, ezekfred <[email protected]> wrote:
> > could you post your Entry & EntryType model?
>
> Sure, though there's not much to it:
>
> <?php
>
> class EntryType extends AppModel {
> public $name = 'EntryType';
> public $hasMany = array ( 'Entry' );
>
> }
>
> ?>
>
> <?php
>
> class Entry extends AppModel {
> public $name = 'Entry';
> public $belongsTo = array (
> 'EntryType',
> 'PDF' => array (
> 'className' => 'Binary',
> 'foreignKey' => 'pdf_file_id'
> ),
> 'MSWord' => array (
> 'className' => 'Binary',
> 'foreignKey' => 'msword_file_id'
> )
> );
>
> public function groupByType() {
> return Set::combine (
> $this->find (
> 'all',
> array (
> 'order' => 'EntryType.title,
> Entry.title'
> )
> ),
> '{n}.Entry.id',
> '{n}',
> '{n}.EntryType.title'
> );
> }
>
> }
>
> ?>
>
> Hope that helps.
>
> Thanks again.
>
> --
> Rob Wilkersonhttp://robwilkerson.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---