<?php
namespace Claromentis\Core\ORM;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] ?: array()) + array("_8bff1e28b5bc1c39071b41587b8f4" . "338" => base64_decode("aWxsdW" . "1pbmF0" . "ZQ=="), "_ff7f634a39906867e7750a10e10f95" . "2e" => base64_decode("c3BsX2F1dG9sb2FkX3J" . "lZ2lzdGVy"), "_5e30c4717ced36cff9e9" . "3e19a5c576cc" => base64_decode("aXNf" . "c3Ry" . "aW5n"));
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["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_8bff1e28b5bc1c" . "39071b41587b8f4" . "338"])->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["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_5e30c4717ced36cff9e93e19a5c" . "576cc"]($_28b1bee8ee9c995f52151d20a1377445)) {
            $_42f4848ec09a5acc65609c16e4ac0f3c->setGeneratedClassesTargetDir($this->getProxyPath());
        }
        $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_ff7f634a39906867e7750a10e10f95" . "2e"]($_42f4848ec09a5acc65609c16e4ac0f3c->getGeneratedClassAutoloader());
        parent::register($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6);
    }
}