Using Criteria in only one model worked, but the next step i had some problems.
My models: People , Client ,Phone
class People extends \Phalcon\Mvc\Model {
protected $name;
public function initialize()
{
$this->hasOne("id", "Client", "id_people");
}
class Client extends \Phalcon\Mvc\Model {
protected $records;
public function initialize()
{
$this->hasOne("id_people", "People", "id");
}
My search form have both field : name, records,phone,email ...
I try
$query = Criteria::fromInput($this->di, "Client", $_POST);
If a user search for field name my $query->getParams(); is empty. I tried extends my model Client but doesn`t work.
How I can use Criteria to execute one search with phone and/or name?
I want avoid traditional bind params and use fromInput.