protected function setDefaultConnectionAttributes() {

        $config = Application::getInstance()->getConfig();

        $options = [
            \PDO::ATTR_ERRMODE				=> \PDO::ERRMODE_EXCEPTION,
            \PDO::ATTR_DEFAULT_FETCH_MODE	=> \PDO::FETCH_ASSOC,
            \PDO::ATTR_STRINGIFY_FETCHES	=> false
        ];

        // if not explicitly specified, attributes are returned lower case

        if(!isset($config->keep_key_case) || !$config->keep_key_case) {
            $options[\PDO::ATTR_CASE] = \PDO::CASE_LOWER;
        }

        foreach($options as $key => $value) {
            $this->connection->setAttribute($key, $value);
        }

    }
protected function setDefaultConnectionAttributes() {

        $config = Application::getInstance()->getConfig();

        $options = [
            \PDO::ATTR_ERRMODE				=> \PDO::ERRMODE_EXCEPTION,
            \PDO::ATTR_DEFAULT_FETCH_MODE	=> \PDO::FETCH_ASSOC,
            \PDO::ATTR_STRINGIFY_FETCHES	=> false
        ];

        // if not explicitly specified, attributes are returned lower case

        if(!isset($config->keep_key_case) || !$config->keep_key_case) {
            $options[\PDO::ATTR_CASE] = \PDO::CASE_LOWER;
        }

        foreach($options as $key => $value) {
            $this->connection->setAttribute($key, $value);
        }

    }
protected function setDefaultConnectionAttributes ( ) { $ config = Application :: getInstance ( ) -> getConfig ( ) ; $ options = [ \ PDO :: ATTR_ERRMODE => \ PDO :: ERRMODE_EXCEPTION , \ PDO :: ATTR_DEFAULT_FETCH_MODE => \ PDO :: FETCH_ASSOC , \ PDO :: ATTR_STRINGIFY_FETCHES => false ] ; // if not explicitly specified, attributes are returned lower case if ( ! isset ( $ config -> keep_key_case ) || ! $ config -> keep_key_case ) { $ options [ \ PDO :: ATTR_CASE ] = \ PDO :: CASE_LOWER ; } foreach ( $ options as $ key => $ value ) { $ this -> connection -> setAttribute ( $ key , $ value ) ; } }
set initial attributes for database connection
set initial attributes for database connection