<?php
namespace Claromentis\Core\ORM;

$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] ?: array()) + array("_8bff1e28b" . "5bc1c39071" . "b41587b8f4" . "338" => base64_decode("aWxsdW1pbmF0ZQ=" . "="), "_ff7f634a39906867e77" . "50a10e10f952e" => base64_decode("c3BsX2F1dG9s" . "b2FkX3JlZ2lz" . "dGVy"), "_5e30c471" . "7ced36cff" . "9e93e19a5" . "c576cc" => base64_decode("aXNfc3Rya" . "W5n"));
use Analogue\ORM\Drivers\IlluminateQueryBuilder;
use Analogue\ORM\System\Query;
use Claromentis\Core\DAL;
use Claromentis\Core\ORM\Analogue\DalDriver;
use Claromentis\Core\ORM\Analogue\DalConnection;
use Analogue\ORM\Analogue;
use Analogue\ORM\Drivers\Manager as DriverManager;
use Analogue\ORM\System\Manager;
use Illuminate\Events\Dispatcher;
use GeneratedHydrator;










class Clarologue extends Analogue
{
    
    
    
    
    protected $db;
    
    
    
    
    protected $connection;
    
    
    
    
    public function __construct(DAL\Db $db)
    {
        $this->db = $db;
        $this->connection = new DalConnection($this->db);
        parent::__construct(array());
    }
    
    
    
    
    
    
    public function boot()
    {
        if (static::$booted) {
            return $this;
        }
        $_b497ce6f2af10f67516aed0ecf34d8cf = new Dispatcher();
        $_85cc626152118128dd8dc6efcff3d96a = new DalDriver($this->connection);
        $_19ed9d674154b9a04015c646b55fa293 = new DriverManager();
        $_19ed9d674154b9a04015c646b55fa293->addDriver($_85cc626152118128dd8dc6efcff3d96a);
        static::$manager = new Manager($_19ed9d674154b9a04015c646b55fa293, $_b497ce6f2af10f67516aed0ecf34d8cf);
        static::$instance = $this;
        static::$booted = true;
        return $this;
    }
    
    
    
    
    
    
    
    public function connection($name = null)
    {
        return $this->connection;
    }
    
    
    
    
    
    
    
    
    
    
    
    public function query($_ba1f6e266e3ebd29f620349be8ec92a5 = null)
    {
        if (!$_ba1f6e266e3ebd29f620349be8ec92a5) {
            return $this->getDriverManager()->getAdapter($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_8bff1e28b5bc1c39071b41587b8f" . "4338"])->getQuery();
        }
        return parent::query($_ba1f6e266e3ebd29f620349be8ec92a5);
    }
    public function mapper($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6 = null)
    {
        return new Mapper(parent::mapper($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6));
    }
    public function register($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6 = null)
    {
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        $_42f4848ec09a5acc65609c16e4ac0f3c = new GeneratedHydrator\Configuration($_ba1f6e266e3ebd29f620349be8ec92a5);
        $_28b1bee8ee9c995f52151d20a1377445 = $this->getProxyPath();
        if ($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_5e30c471" . "7ced36cff" . "9e93e19a5" . "c576cc"]($_28b1bee8ee9c995f52151d20a1377445)) {
            $_42f4848ec09a5acc65609c16e4ac0f3c->setGeneratedClassesTargetDir($this->getProxyPath());
        }
        $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_ff7f634a39906867e7750a1" . "0e10f952e"]($_42f4848ec09a5acc65609c16e4ac0f3c->getGeneratedClassAutoloader());
        parent::register($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6);
    }
}