<?php
namespace Claromentis\Core\ORM;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_5e30c4717ced36cff9e93e19a5" . "c576cc" => base64_decode("aXNf" . "c3Ry" . "aW5n"), "_8bff1e28b5bc1c39071b4" . "1587b8f4338" => base64_decode("aWxsdW1p" . "bmF0ZQ=="), "_ff7f634a39906867e7750a10" . "e10f952e" => base64_decode("c3BsX2F1dG9sb2FkX3JlZ2l" . "zdGVy"));
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["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_8bff1e28b5bc1c3907" . "1b41587b8f4338"])->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["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_5e30c471" . "7ced36cff" . "9e93e19a5" . "c576cc"]($_28b1bee8ee9c995f52151d20a1377445)) {
            $_42f4848ec09a5acc65609c16e4ac0f3c->setGeneratedClassesTargetDir($this->getProxyPath());
        }
        $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_ff7f634a399068" . "67e7750a10e10f9" . "52e"]($_42f4848ec09a5acc65609c16e4ac0f3c->getGeneratedClassAutoloader());
        parent::register($_ba1f6e266e3ebd29f620349be8ec92a5, $_7bf14ccb9bebab3964c83c16c77505c6);
    }
}