original_string: public function searchAction()
      {
          $numberPage = 1;
          if ($this->request->isPost()) {
              $query = Criteria::fromInput($this->di, 'Modules\User\Models\Profiles', $this->request->getPost());
              $this->persistent->searchParams = $query->getParams();
          } else {
              $numberPage = $this->request->getQuery("page", "int");
          }
  
          $parameters = [];
          if ($this->persistent->searchParams) {
              $parameters = $this->persistent->searchParams;
          }
  
          $profiles = Profiles::find($parameters);
          if (count($profiles) == 0) {
  
              $this->flash->notice("The search did not find any profiles");
  
              return $this->dispatcher->forward([
                  "action" => "index"
              ]);
          }
  
          $paginator = new Paginator([
              "data" => $profiles,
              "limit" => 10,
              "page" => $numberPage
          ]);
  
          $this->view->page = $paginator->getPaginate();
      }
code: public function searchAction()
      {
          $numberPage = 1;
          if ($this->request->isPost()) {
              $query = Criteria::fromInput($this->di, 'Modules\User\Models\Profiles', $this->request->getPost());
              $this->persistent->searchParams = $query->getParams();
          } else {
              $numberPage = $this->request->getQuery("page", "int");
          }
  
          $parameters = [];
          if ($this->persistent->searchParams) {
              $parameters = $this->persistent->searchParams;
          }
  
          $profiles = Profiles::find($parameters);
          if (count($profiles) == 0) {
  
              $this->flash->notice("The search did not find any profiles");
  
              return $this->dispatcher->forward([
                  "action" => "index"
              ]);
          }
  
          $paginator = new Paginator([
              "data" => $profiles,
              "limit" => 10,
              "page" => $numberPage
          ]);
  
          $this->view->page = $paginator->getPaginate();
      }
code_tokens: public function searchAction ( ) { $ numberPage = 1 ; if ( $ this -> request -> isPost ( ) ) { $ query = Criteria :: fromInput ( $ this -> di , 'Modules\User\Models\Profiles' , $ this -> request -> getPost ( ) ) ; $ this -> persistent -> searchParams = $ query -> getParams ( ) ; } else { $ numberPage = $ this -> request -> getQuery ( "page" , "int" ) ; } $ parameters = [ ] ; if ( $ this -> persistent -> searchParams ) { $ parameters = $ this -> persistent -> searchParams ; } $ profiles = Profiles :: find ( $ parameters ) ; if ( count ( $ profiles ) == 0 ) { $ this -> flash -> notice ( "The search did not find any profiles" ) ; return $ this -> dispatcher -> forward ( [ "action" => "index" ] ) ; } $ paginator = new Paginator ( [ "data" => $ profiles , "limit" => 10 , "page" => $ numberPage ] ) ; $ this -> view -> page = $ paginator -> getPaginate ( ) ; }
docstring: Searches for profiles
docstring_tokens: Searches for profiles