Skip to content

Instantly share code, notes, and snippets.

@sthamann
Created May 29, 2013 05:08

Revisions

  1. sthamann created this gist May 29, 2013.
    18 changes: 18 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    $logger = new \Doctrine\DBAL\Logging\DebugStack();
    $logger->enabled;
    Shopware()->Models()->getConfiguration()->setSQLLogger($logger);

    // Shopware Doctrine Queries
    //get access on the customer repository
    $query = $this->getRepository()->getListQuery($filter, $customerGroup, $sort, $limit, $offset);

    //returns the total count of the query
    $totalResult = $this->getManager()->getQueryCount($query);

    //returns the customer data
    $customers = $query->getArrayResult();

    // Dump SQL
    echo '<pre>';
    \Doctrine\Common\Util\Debug::dump($logger, 5);
    exit();