views:

35

answers:

1

I have an DQL query in LocationTable.class.php

For this query i need an id which is passed to the action via the URL ?id=2

In the action i can access this with $request->getParamater('id'), but how can i also make this available to the model where my query resides? i need it for a where clause.

+2  A: 

When you call the function from the action, pass it the variable:

In action:

Doctrine::getTable('Location')->yourFunction($request->getParameter('id'));

In LocationTable:

public function yourFunction($id)
{
  ...
Thank you thank you thank you!
iggnition