Hi, i have in my UserController.php a Paginator which works fine, but now i want to filter the users from another table "contact":
This is the code from my Users-Paginator:
public function indexAction(){
$numberPage = 1;
if ($this->request->isPost()) {
$query = Criteria::fromInput($this->di, 'Vokuro\Models\Users', $this->request->getPost());
$this->persistent->searchParams = $query->getParams();
} else {
$numberPage = $this->request->getQuery("page", "int");
}
$parameters = array();
if ($this->persistent->searchParams) {
$parameters = $this->persistent->searchParams;
}
$users = Users::find($parameters);
if (count($users) == 0) {
$this->flash->notice("The search did not find any users");
return $this->dispatcher->forward(array(
"action" => "index"
));
}
$paginator = new Paginator(array(
"data" => $users,
"limit" => 10,
"page" => $numberPage
));
$this->view->page = $paginator->getPaginate();
}
In the contact table, ihave:
id
usersId
contacterId
insertDate
I want to list all the the users where the contact.usersId = users.id, but i don't know how to create it.
Thx in advance
Stefan :-)