<commit_before><?php

namespace G4\DataMapper\Db;

//TODO: Drasko: change this to work with DI and remove static calls
class Db
{
    public static function getAdapter()
    {
        return \Zend_Db_Table::getDefaultAdapter();
    }

    public static function isTableRowInstance($obj)
    {
        return $obj instanceof \Zend_Db_Table_Row;
    }

    public static function isExprInstance($obj)
    {
        return $obj instanceof \Zend_Db_Expr;
    }
}<commit_msg>first step to moving database to DI<commit_after><?php

namespace G4\DataMapper\Db;

use G4\DI\Container as DI;

//TODO: Drasko: change this to work with DI and remove static calls
class Db
{
    public static function getAdapter()
    {
//         return \Zend_Db_Table::getDefaultAdapter();
        return DI::get('db');
    }

    public static function isTableRowInstance($obj)
    {
        return $obj instanceof \Zend_Db_Table_Row;
    }

    public static function isExprInstance($obj)
    {
        return $obj instanceof \Zend_Db_Expr;
    }
}
{'fraction_non_alphanumeric': 0.08993157380254155, 'fraction_numerical': 0.002932551319648094, 'mean_word_length': 2.9233716475095783, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4066031', 'n_tokens_mistral': 315, 'n_tokens_neox': 311, 'n_words': 90}