Search code examples
mysqltypo3extbasetypo3-7.6.xtypo3-6.2.x

How to debug a query in extbase?


$query = $this->createQuery();

    return $query->matching($query->like('linker', "$linkerKey=$linkerValue"))
        ->setOrderings(array('crdate' => $ordering))
        ->execute();

How can i debug such a generated query in extbase? When creating the same query again (but without the execute() ) and trying to display it with var_dump or the internal t3lib_div::debug i just receive a blank page.


Solution

  • $query = $this->createQuery();
    $result = $query->matching($query->like('linker', "$linkerKey=$linkerValue"))
       ->setOrderings(array('crdate' => $ordering))
       ->execute();
    
    $GLOBALS['TYPO3_DB']->debugOutput = true;
    
    return $result;