public function getEntityIds($machine, $state = null)
{
$ids = array();
foreach ($_SESSION[$this->namespace] as $key => $storage) {
if (strstr($key, $machine)) {
if ($state) {
if ($storage->state === $state) {
$ids[] = $storage->id;
}
} else {
$ids[] = $storage->id;
}
}
}
return $ids;
}