after find action and sql query

A place for users and developers of the Xataface to discuss and receive support.

after find action and sql query

Postby PolderBoy » Sun Jul 29, 2012 2:16 pm

Hello All,

Is there an action After_find?

And is it possible to get the query from a find?
index.php?-action=list&-table=tblGegevens&-cursor=0&-skip=0&-limit=30&-mode=find&-edit=1&Dierenarts=%3D1&HuisdierGewicht=12

would give:
SELECT * FROM tblGegevens WHERE Dierenarts = 1 AND HuisdierGewicht = 12

I do not know the criteria the user will use for a find, could be between dates and Dierenarts (vet) table = VetID
All I know is that the lay-out has to be perfect and the user has to be automatically presented with the pdf for viewing or downloading.

Thanks in advance,
Brian

PS I just posted this a couple of minutes before but couldn't see my post, so maybe I double posted. If so I am sorry.
PolderBoy
 
Posts: 72
Joined: Fri Apr 03, 2009 12:53 am

Re: after find action and sql query

Postby shannah » Mon Jul 30, 2012 10:35 am

Since "finds" just pipe a Xataface request using URL conventions, you might want to just preprocess all requests coming in using the beforeHandleRequest() method of the application delegate class. You can always get the current query as an associative array using the Dataface_Application::getQuery() method.

e.g
Code: Select all
function beforeHandleRequest(){
    $app = Dataface_Application::getInstance();
    $query =& $app->getQuery();   // we obtain reference so we can change it

    ...
}


-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: after find action and sql query

Postby PolderBoy » Mon Jul 30, 2012 2:41 pm

Hello Steve,

Perfect that is what I was looking for.
Now I can make the pdf for downloading after a user did a search.

Regards,
Brian
PolderBoy
 
Posts: 72
Joined: Fri Apr 03, 2009 12:53 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 7 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved