laravel ajax查询到cakephp ajax查询

I want to switch from laravel and use cakephp for my project, but i have a problem to do a same function :

in laravel :

    public function posts() {

        // retrieve params
        $search = Input::get('search');
        $param = Input::get('param');

        if (Request::wantsJson()) {
            if (strlen($search) >= '2') {
                // define wich param to get
                if ($param == 'ratname') {
                    // query with name
                    $posts = Post::where('name', 'LIKE', ''.$search.'%')
                        ->get();
                } elseif ($param == 'ratid') {
                    // query with id
                    $posts = Post::where('idLord', 'LIKE', ''.$search.'%')
                        ->get();
                } else {
                    // query normal
                    $posts = Post::get();
                }
                return $posts;
            }
        }
}

in cakephp :

public function posts_ajax() {

    // IS AJAX : VIEW SEPARATE WAY
    if ($this->request->is('ajax')) {

        $this->layout = null;
        $this->autoRender = false;

        // ANTI-SURCHARGE DE BDD
        if (strlen($this->request->query['search']) >= '2') {

            // CHARGEMENT MODEL : RATOUSEARCH
            $this->loadModel('Ratousearch');

            // param separate way
            if($this->request->query['param'] == 'ratname') {
                // QUERY => Requête de find ( 'all') : ratousearch ('name') | SANS CACHE
                $posts = $this->Ratousearch->find('all', array(
                    'conditions' => array(
                        'Ratousearch.name LIKE' => ''.$this->request->query['search'].'%'),
                    'order' => array('Ratousearch.name' => 'asc')
                ));
            } else if($this->request->query['param'] == 'ratid') {
                // QUERY => Requête de find ( 'all') : ratousearch ('idLord') | SANS CACHE
                $posts = $this->Ratousearch->find('all', array(
                    'conditions' => array(
                        'Ratousearch.idLord LIKE' => ''.$this->request->query['search'].'%'),
                    'order' => array('Ratousearch.idLord' => 'asc')
                ));
            }

            //print_r($posts);
            $posts = (Set::extract('/Ratousearch/.', $posts)); // hide model
            $this->set(compact('posts'));

        } else {
            // do nothing...
        }

    } else {

        // ANTI-SURCHARGE DE BDD
        if (strlen($this->request->query['search']) >= '2') {

            // CHARGEMENT MODEL : RATOUSEARCH
            $this->loadModel('Ratousearch');

            // param separate way
            if($this->request->query['param'] == 'ratname') {
                // QUERY => Requête de find ( 'all') : ratousearch ('name') | SANS CACHE
                $posts = $this->Ratousearch->find('all', array(
                    'conditions' => array(
                        'Ratousearch.name LIKE' => ''.$this->request->query['search'].'%'),
                    'order' => array('Ratousearch.name' => 'asc')
                ));
            } else if($this->request->query['param'] == 'ratid') {
                // QUERY => Requête de find ( 'all') : ratousearch ('idLord') | SANS CACHE
                $posts = $this->Ratousearch->find('all', array(
                    'conditions' => array(
                        'Ratousearch.idLord LIKE' => ''.$this->request->query['search'].'%'),
                    'order' => array('Ratousearch.idLord' => 'asc')
                ));
            }

            // setters
            echo "<pre>";
            print_r(Set::extract('/Ratousearch/.', $posts)); // hide model
            echo "</pre>";

        } else {
            // do nothing...
        }

    }

}

I call the function from a distant angularjs app, with laravel it's working good, but with cakephp, nothing is returned, query is empty....

What i have missed when i writed the code for cakephp?