if ($cmd == self::MAIL) {
$target_item = DBA::selectFirst('mail', [], ['id' => $target_id]);
if (!DBA::isResult($target_item)) {
- self::setFailedQueue($cmd, $target_item);
return;
}
$uid = $target_item['uid'];
} elseif ($cmd == self::SUGGESTION) {
$target_item = DBA::selectFirst('fsuggest', [], ['id' => $target_id]);
if (!DBA::isResult($target_item)) {
- self::setFailedQueue($cmd, $target_item);
return;
}
$uid = $target_item['uid'];
} else {
$item = Model\Item::selectFirst(['parent'], ['id' => $target_id]);
if (!DBA::isResult($item) || empty($item['parent'])) {
- self::setFailedQueue($cmd, $target_item);
return;
}
$parent_id = intval($item['parent']);
if (empty($target_item)) {
Logger::log('Item ' . $target_id . "wasn't found. Quitting here.");
- self::setFailedQueue($cmd, $target_item);
return;
}