Variable table prefix

35 views
Skip to first unread message

Martin Kopeček

unread,
May 10, 2013, 11:21:03 AM5/10/13
to not...@googlegroups.com
Hello, is there a possibility to prefix a table as in

$structure = new NotORM_Structure_Convention($primary = 'id',$foreign = '%s_id',$table = '%s',$prefix = 'prefix_');

but let it to be variable? I tried using getReferencedTable and getReferencingTable, but it works weird and in some cases it does not add the prefix. My reason is that I made a two lang website simply by duplicating tables and prefixing them with language code, however some tables are common for both (e.g. users) and they do not have prefix.

I want the NotORM interface then work as though there is no prefix.

Thanks a lot, MK

Jakub Vrana

unread,
Jun 26, 2013, 1:14:57 PM6/26/13
to not...@googlegroups.com
Hello,

You need to override all four getReferenc*() methods that use $prefix.
Please be more specific if it wouldn't help - share your
NotORM_Structure_Convention extension and describe what doesn't work.

Jakub
> --
> You received this message because you are subscribed to the Google
> Groups "NotORM" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to notorm+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages