Files
espocrm/application/Espo/Controllers/Metadata.php
Yuri Kuznetsov 9246c4bd12 refactor
2013-11-19 18:02:35 +02:00

34 lines
657 B
PHP

<?php
namespace Espo\Controllers;
class Metadata extends \Espo\Core\Controllers\Base
{
public function actionRead($params, $data)
{
$data = $this->getContainer()->get('metadata')->get(true);
return array($data, 'Cannot reach metadata data');
}
public function actionUpdate($params, $data)
{
$result = $this->getContainer()->get('metadata')->set($data, $params['type'], $params['scope']);
if ($result===false) {
return array($result, 'Cannot save metadata data');
}
$data= $this->getContainer()->get('metadata')->get(true, true);
return array($data, 'Cannot get metadata data');
}
}
?>