public function requestJob()
    {
        $findCond = [
            'conditions' => [
                'completed' => 0
            ],
            'order' => [
                'created ASC',
                'id ASC',
            ],
            'limit' => 3,
        ];

        $jobs = $this->find('all', $findCond)->all()->toArray();
        for ($i=0; $i<count($jobs); $i++) {
            if ($jobs[$i]['stats']['tries'] >= $this->maxTries) {
                unset($jobs[$i]);
            }
        }
        return $jobs;
    }
public function requestJob()
    {
        $findCond = [
            'conditions' => [
                'completed' => 0
            ],
            'order' => [
                'created ASC',
                'id ASC',
            ],
            'limit' => 3,
        ];

        $jobs = $this->find('all', $findCond)->all()->toArray();
        for ($i=0; $i<count($jobs); $i++) {
            if ($jobs[$i]['stats']['tries'] >= $this->maxTries) {
                unset($jobs[$i]);
            }
        }
        return $jobs;
    }
public function requestJob ( ) { $ findCond = [ 'conditions' => [ 'completed' => 0 ] , 'order' => [ 'created ASC' , 'id ASC' , ] , 'limit' => 3 , ] ; $ jobs = $ this -> find ( 'all' , $ findCond ) -> all ( ) -> toArray ( ) ; for ( $ i = 0 ; $ i < count ( $ jobs ) ; $ i ++ ) { if ( $ jobs [ $ i ] [ 'stats' ] [ 'tries' ] >= $ this -> maxTries ) { unset ( $ jobs [ $ i ] ) ; } } return $ jobs ; }
Find a job to do.

@return array
Find a job to do .