Skip to content

Instantly share code, notes, and snippets.

@fayqLs
Created September 30, 2024 23:27
Show Gist options
  • Save fayqLs/8445d6832d1aae37129e325f91e35468 to your computer and use it in GitHub Desktop.
Save fayqLs/8445d6832d1aae37129e325f91e35468 to your computer and use it in GitHub Desktop.
APLICAR FILTRO OPERADOR IN DOS IDs NO DATAGRID
<?php
public function onReload($param = NULL)
{
$systemUser = SystemUsers::find(TSession::getValue('userid'));
if ($systemUser)
{
$arrayEmpresaID = array();
$EmpresasUuario = $systemUser->getEmpresasUuario();
if ($EmpresasUuario)
{
foreach ($EmpresasUuario as $empresa)
{
$arrayEmpresaID[] = $empresa->empresa_id;
}
}
if (count($arrayEmpresaID))
{
$criteria->add(new TFilter('empresa_id', 'in', $arrayEmpresaID));
}
}
$objects = $repository->load($criteria, FALSE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment