<?php

namespace FacturaScripts\Plugins\Partes\Model;

use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
use FacturaScripts\Dinamic\Model\User as ParentClass;
use FacturaScripts\Core\Model\Base\ModelTrait;
use FacturaScripts\Core\Session;
use FacturaScripts\Core\Tools;
use FacturaScripts\Dinamic\Model\Proyecto;

class OIUser extends ParentClass
{
	public function getOperarios(){
		$users = new $this();
		$operarios = $users->all([], []);
		return $operarios;
	}

	public function getOperariosTarea($idtarea=null){
		$return = [];
		$operarioTarea = new \FacturaScripts\Plugins\Partes\Model\OIOperarioTarea();
		$where = [new DataBaseWhere('idtarea', $idtarea)];
		$operariosTarea = $operarioTarea->all($where);

		foreach($operariosTarea as $operario){
			$return[] = $operario->nick;
		}
		return $return;
	}
}
