PDO :: FETCH_CLASS如何在不传递类名作为参数的情况下工作

i am trying to understand why is this method i have works without me passing class name to the fetch statement. the method looks like this:

  function getAll() {
    $DBH = $this->getDbh();
    $query = "SELECT * FROM ads";
    try {
      $STH = $DBH->query($query);
      $ads = $STH->fetchAll(PDO::FETCH_CLASS);
    } catch(PDOException $e) {
      Slim::getInstance()->log->error($e);
    }

    return $ads;
  }

i tried looking for an answer/example in the official documentation but still can't understand how the FETCH_CLASS knows or from where it deduced what is the class name...any guidance plz?