<?php
namespace Claromentis\Core\ORM\Analogue\Relationships;

$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] ?: array()) + array("_bad6dfc2109d66c91fc231a44711" . "c072" => base64_decode("L" . "g" . "=" . "="), "_1bee3d4d1d0df49e0fcf8b9" . "ed2ecb8fa" => base64_decode("ZXhwbG9" . "kZQ=="), "_bb152d3d0f3a7af77c" . "042dab184b9545" => base64_decode("PQ=" . "="), "_31767d7ad58e706dbf47b7a" . "51a0fe6c4" => base64_decode("Y291bnQ" . "="));






class HasMany extends \Analogue\ORM\Relationships\HasMany
{
    
    
    
    
    
    
    
    
    
    
    protected $defaultForeignKey = 0;
    
    
    
    
    
    
    
    
    public function getDefaultForeignKey()
    {
        return $this->defaultForeignKey;
    }
    
    
    
    
    protected function detachExcept($_f0cf7309fd73dba4a301ed317aed6915)
    {
        $_7f5aa4e96d4b415a86ed72ebff677cbe = $this->query->getQuery()->from($this->relatedMap->getTable());
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_31767d7ad58e706dbf47" . "b7a51a0fe6c4"]($_f0cf7309fd73dba4a301ed317aed6915) > 0) {
            $_9a9a71c432a50f9d93fb5e0d212082bf = $this->getKeys($_f0cf7309fd73dba4a301ed317aed6915);
            $_7f5aa4e96d4b415a86ed72ebff677cbe->whereNotIn($this->relatedMap->getKeyName(), $_9a9a71c432a50f9d93fb5e0d212082bf);
        }
        $_838181ceeaa8ad80a361dde1c0564e7a = $this->parentMap->getKeyName();
        $_7f5aa4e96d4b415a86ed72ebff677cbe->where($this->getPlainForeignKey(), $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_bb152d3d0f3a7af77c042dab" . "184b9545"], $this->parent->getEntityAttribute($_838181ceeaa8ad80a361dde1c0564e7a))->update([$this->getPlainForeignKey() => $this->getDefaultForeignKey()]);
    }
    
    
    
    
    public function detachMany(array $_5c7051afa97b6ef7c41598c471a828f7)
    {
        $_9a9a71c432a50f9d93fb5e0d212082bf = [];
        foreach ($_5c7051afa97b6ef7c41598c471a828f7 as $_72a7209efcd9c803cef80753f412d5cd) {
            $_a43757883ea3226ded01b58faba162f7 = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_1bee3d4" . "d1d0df49" . "e0fcf8b9" . "ed2ecb8f" . "a"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_bad6dfc2109d66c91" . "fc231a44711c072"], $_72a7209efcd9c803cef80753f412d5cd);
            $_9a9a71c432a50f9d93fb5e0d212082bf[] = $_a43757883ea3226ded01b58faba162f7[1];
        }
        $_7f5aa4e96d4b415a86ed72ebff677cbe = $this->query->getQuery()->from($this->relatedMap->getTable());
        $_7f5aa4e96d4b415a86ed72ebff677cbe->whereIn($this->relatedMap->getKeyName(), $_9a9a71c432a50f9d93fb5e0d212082bf)->update([$this->getPlainForeignKey() => $this->getDefaultForeignKey()]);
    }
}