original_string: public function getAvailableJobs($queue, $max = 10) {
          $qb = $this->conn->createQueryBuilder();
          $qb->select('*');
          $qb->from($this->table_name);
          $qb->where('status = :status AND queue = :queue AND available_at <= :now');
          $qb->orderBy('status');
          $qb->setParameters([
              'status' => self::JOB_STATUS_CREATED,
              'queue' => $queue,
          ]);
          $qb->setParameter('now', new \DateTime(), Type::DATETIME);
          $qb->setMaxResults($max);
          $stmt = $qb->execute();
          return $stmt->fetchAll(\PDO::FETCH_ASSOC);
      }
code: public function getAvailableJobs($queue, $max = 10) {
          $qb = $this->conn->createQueryBuilder();
          $qb->select('*');
          $qb->from($this->table_name);
          $qb->where('status = :status AND queue = :queue AND available_at <= :now');
          $qb->orderBy('status');
          $qb->setParameters([
              'status' => self::JOB_STATUS_CREATED,
              'queue' => $queue,
          ]);
          $qb->setParameter('now', new \DateTime(), Type::DATETIME);
          $qb->setMaxResults($max);
          $stmt = $qb->execute();
          return $stmt->fetchAll(\PDO::FETCH_ASSOC);
      }
code_tokens: public function getAvailableJobs ( $ queue , $ max = 10 ) { $ qb = $ this -> conn -> createQueryBuilder ( ) ; $ qb -> select ( '*' ) ; $ qb -> from ( $ this -> table_name ) ; $ qb -> where ( 'status = :status AND queue = :queue AND available_at <= :now' ) ; $ qb -> orderBy ( 'status' ) ; $ qb -> setParameters ( [ 'status' => self :: JOB_STATUS_CREATED , 'queue' => $ queue , ] ) ; $ qb -> setParameter ( 'now' , new \ DateTime ( ) , Type :: DATETIME ) ; $ qb -> setMaxResults ( $ max ) ; $ stmt = $ qb -> execute ( ) ; return $ stmt -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; }
docstring: get available jobs
docstring_tokens: get available jobs