mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
Dependency Injection
This commit is contained in:
@@ -2,31 +2,27 @@
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
use Espo\Utils as Utils;
|
||||
|
||||
class Metadata extends Utils\Controllers\Controller
|
||||
class Metadata extends \Espo\Core\Controllers\Base
|
||||
{
|
||||
|
||||
public function read($params, $data)
|
||||
{
|
||||
$metadata= new Utils\Metadata();
|
||||
|
||||
$data= $metadata->getMetadata(true);
|
||||
$data= $this->getContainer()->get('metadata')->get(true);
|
||||
|
||||
return array($data, 'Cannot reach metadata data');
|
||||
}
|
||||
|
||||
|
||||
public function update($params, $data)
|
||||
{
|
||||
$metadata = new Utils\Metadata();
|
||||
$result = $metadata->setMetadata($data, $params['type'], $params['scope']);
|
||||
{
|
||||
$result = $this->getContainer()->get('metadata')->set($data, $params['type'], $params['scope']);
|
||||
|
||||
if ($result===false) {
|
||||
return array($result, 'Cannot save metadata data');
|
||||
}
|
||||
|
||||
$data= $metadata->getMetadata(true, true);
|
||||
$data= $this->getContainer()->get('metadata')->get(true, true);
|
||||
return array($data, 'Cannot get metadata data');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user