is there a way to alias this in php class Editor::inst( $db, $TblName )
for example Editor::inst( $db, $TblName as 'tbl') or Editor::inst( $db, $TblName )->name('tbl') or ???
This question has accepted answers - jump to:
I don't quite understand I'm afraid - are you looking to alias the table name? If so try:
Editor::inst( $db, $TblName .' as tbl')
However it isn't something we use extensively, so it is possible there might be a few rough edges.
Yes it was what I was looking for... I use .data files that describe datas, .def that describe associated table and editor...
With many table in a dataset, fields do have prefix using table name.
So when I want to test a way using a view, the stable name used for tests change, and I need to change fields definition in .def files.
So using alias I can reuse fields definitions with no change at all...
I did test $Table as 'tbl', missing table name must be a string
Sometimes I'm better... and this is not really difficult to be
It is not possible to use alias for primary table in PHP. DELETE-statement doesn't handle it. You can only have alias for the joined tables.
A fix were planned for editor 1.9.3 but it still doesn't work:
Did you test the delete from alias now (2.0.1) ?
I have tried 1.9.3, 1.9.6 and 2.0.1.
I'll try ASAP
Hi Bob and Anders,
I've just committed a fix for this issue to the Editor PHP libraries.
If you'd like to try it immediately, you can patch your existing Editor.php with that change. If you do, let me know how you get on.
Do you have an estimated date for release publication ?
Hoping we'll do a 2.0.2 next week, before the end of the month for sure.
Very nice. So i'll wait for this
Have a good week end
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.