Skip to content
Snippets Groups Projects
Verified Commit 079ccad1 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #8346 add convert attachment support

parent dc2186fd
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,34 @@ class AdrModel
return $adr[0];
}
public static function getTypedAttachAdrByResId(array $aArgs)
{
ValidatorModel::notEmpty($aArgs, ['resId', 'type']);
ValidatorModel::intVal($aArgs, ['resId']);
ValidatorModel::stringType($aArgs, ['type']);
ValidatorModel::arrayType($aArgs, ['select']);
ValidatorModel::boolType($aArgs, ['isVersion']);
if ($aArgs['isVersion']) {
$table = "adr_attachments_version";
} else {
$table = "adr_attachments";
}
$adr = DatabaseModel::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => [$table],
'where' => ['res_id = ?', 'type = ?'],
'data' => [$aArgs['resId'], $aArgs['type']]
]);
if (empty($adr[0])) {
return [];
}
return $adr[0];
}
public static function createDocumentAdr(array $aArgs)
{
ValidatorModel::notEmpty($aArgs, ['resId', 'docserverId', 'path', 'filename', 'type']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment