<?php
namespace Claromentis\Core\ORM;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] ?: array()) + array("_5e30c4717ced36cf" . "f9e93e19a5c576cc" => base64_decode("aXNfc3R" . "yaW5n"), "_8bff1e28b5bc1c3" . "9071b41587b8f433" . "8" => base64_decode("aWxs" . "dW1p" . "bmF0" . "ZQ=="), "_ff7f634a" . "39906867e" . "7750a10e1" . "0f952e" => base64_decode("c3BsX2F" . "1dG9sb2" . "FkX3JlZ" . "2lzdGVy"));
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["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_8bff1e28b5bc1c39071b415" . "87b8f4338"])->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["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_5e30c4717ced36cff9e93e1" . "9a5c576cc"]($_28b1bee8ee9c995f52151d20a1377445)) {
            $_42f4848ec09a5acc65609c16e4ac0f3c->setGeneratedClassesTargetDir($this->getProxyPath());
        }
        $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_ff7f634a39906867e7750a10e10f9" . "52e"]($_42f4848ec09a5acc65609c16e4ac0f3c->getGeneratedClassAutoloader());
        parent::register($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6);
    }
}