<?php
namespace Claromentis\Core\ORM;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] ?: array()) + array("_8bff1e28b5bc1c39071" . "b41587b8f4338" => base64_decode("aWxsd" . "W1pbm" . "F0ZQ=" . "="), "_ff7f634a" . "39906867e" . "7750a10e1" . "0f952e" => base64_decode("c3BsX2F1dG9sb2FkX3JlZ2" . "lzdGVy"), "_5e30c4717c" . "ed36cff9e93" . "e19a5c576cc" => base64_decode("aXNfc3RyaW5" . "n"));
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["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_8bff1e28b5bc1c39" . "071b41587b8f4338"])->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["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_5e30c4717ced3" . "6cff9e93e19a5c" . "576cc"]($_28b1bee8ee9c995f52151d20a1377445)) {
            $_42f4848ec09a5acc65609c16e4ac0f3c->setGeneratedClassesTargetDir($this->getProxyPath());
        }
        $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_ff7f634a39906867e7750a10e" . "10f952e"]($_42f4848ec09a5acc65609c16e4ac0f3c->getGeneratedClassAutoloader());
        parent::register($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6);
    }
}