Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #136 from atrocore/i-metadata
Browse files Browse the repository at this point in the history
Fixed Asset Metadata
  • Loading branch information
rratsun authored Feb 14, 2024
2 parents 44c8c11 + 46aa0f8 commit 27929f8
Showing 1 changed file with 40 additions and 36 deletions.
76 changes: 40 additions & 36 deletions app/Controllers/AssetMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,48 @@

namespace Dam\Controllers;

use Espo\Core\Controllers\Base;
use Atro\Core\Templates\Controllers\Base;
use Espo\Core\Exceptions\Forbidden;

class AssetMetadata extends Base
{
const MAX_SIZE_LIMIT = 200;

public function actionListLinked($params, $data, $request)
{
$id = $params['id'];
$link = $params['link'];

$where = $request->get('where');
$offset = $request->get('offset');
$maxSize = $request->get('maxSize');
$asc = $request->get('asc', 'true') === 'true';
$sortBy = $request->get('sortBy');
$q = $request->get('q');
$textFilter = $request->get('textFilter');

if (empty($maxSize)) {
$maxSize = self::MAX_SIZE_LIMIT;
}

$params = [
'where' => $where,
'offset' => $offset,
'maxSize' => $maxSize,
'asc' => $asc,
'sortBy' => $sortBy,
'q' => $q,
'textFilter' => $textFilter
];

$result = $this->getServiceFactory()->create('AssetMetadata')->findLinkedEntities($id, $link, $params);

return [
'total' => $result['total'],
'list' => isset($result['collection']) ? $result['collection']->getValueMapList() : $result['list']
];
public function actionCreate($params, $data, $request)
{
throw new Forbidden();
}

public function actionUpdate($params, $data, $request)
{
throw new Forbidden();
}

public function actionDelete($params, $data, $request)
{
throw new Forbidden();
}

public function actionMassUpdate($params, $data, $request)
{
throw new Forbidden();
}

public function actionMassDelete($params, $data, $request)
{
throw new Forbidden();
}

public function actionCreateLink($params, $data, $request)
{
throw new Forbidden();
}

public function actionRemoveLink($params, $data, $request)
{
throw new Forbidden();
}

public function actionMerge($params, $data, $request)
{
throw new Forbidden();
}
}

0 comments on commit 27929f8

Please sign in to comment.