<?php

namespace App\Modelos;

use Core\Database;

class EmpleadoAlmacen extends Database
{
    protected $table    = 'app_empleados_almacen';
    protected $id       = 'empalm_id';

    public function existeAlmacen($id_empleado, $id_almacen)
    {
        return $this->consultar("SELECT * FROM app_empleados_almacen WHERE empalm_almid=$id_almacen AND empalm_empid=$id_empleado")->row();
    }

    public function obtenerAlmacenes($id_empleado)
    {
        return $this->consultar("SELECT * FROM app_empleados_almacen 
        JOIN app_almacenes a ON a.alm_id = empalm_almid        
        WHERE empalm_empid=$id_empleado")->all();
    }
}
