Blast\Orm\Query::convertTypesToPHPValues PHP Method

convertTypesToPHPValues() private method

private convertTypesToPHPValues ( Blast\Orm\Entity\ProviderInterface $provider, $result ) : mixed
$provider Blast\Orm\Entity\ProviderInterface
$result
return mixed
    private function convertTypesToPHPValues(ProviderInterface $provider, $result)
    {
        if (!is_array($result)) {
            return $result;
        }
        $fields = $provider->getDefinition()->getFields();
        foreach ($result as $index => $items) {
            foreach ($items as $key => $value) {
                $defaultType = Type::getType(is_numeric($value) ? Type::INTEGER : Type::STRING);
                $type = array_key_exists($key, $fields) ? $fields[$key]->getType() : $defaultType;
                $result[$index][$key] = $type->convertToPHPValue($value, $this->getConnection()->getDatabasePlatform());
            }
        }
        return $result;
    }