PhpBench\Extensions\Dbal\Storage\Driver\Dbal\Repository::getRunEnvInformationRows PHP Метод

getRunEnvInformationRows() публичный Метод

public getRunEnvInformationRows ( $runId )
    public function getRunEnvInformationRows($runId)
    {
        $sql = 'SELECT * FROM environment WHERE run_id = ?';
        $conn = $this->manager->getConnection();
        $stmt = $conn->prepare($sql);
        $stmt->execute([$runId]);
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
    }

Usage Example

Пример #1
0
 private function getSuite(\ArrayObject $context, array $row)
 {
     $key = $row['run.uuid'];
     if (isset($context[self::SUITES][$key])) {
         return $context[self::SUITES][$key];
     }
     $suite = new Suite($row['run.context'], new \DateTime($row['run.date']), null, [], [], $row['run.uuid']);
     $context[self::SUITES][$key] = $suite;
     $envRows = $this->repository->getRunEnvInformationRows($row['run.id']);
     $providerData = [];
     foreach ($envRows as $row) {
         if (!isset($providerData[$row['provider']])) {
             $providerData[$row['provider']] = [];
         }
         $providerData[$row['provider']][$row['ekey']] = $row['value'];
     }
     $informations = [];
     foreach ($providerData as $name => $data) {
         $informations[] = new Information($name, $data);
     }
     $suite->setEnvInformations($informations);
     return $suite;
 }