getItems method overwrites in the ClientsModel

This commit is contained in:
Artem Vasilev 2024-03-12 01:20:08 +03:00
parent d87a9b1471
commit 4e594ac303

View File

@ -84,6 +84,44 @@ class ClientsModel extends ListModel
return parent::getStoreId($id); return parent::getStoreId($id);
} }
/**
* @inheritDoc
* @since version
*/
public function getItems()
{
$result = parent::getItems();
if (!$result)
{
return $result;
}
// Get a storage key.
$store = $this->getStoreId();
/** @var \stdClass $row */
foreach ($result as &$row)
{
// Convert `public` field to bool
$row->public = !empty($row->public);
if (!empty($row->scopes))
{
$row->scopes = json_decode($row->scopes, true);
}
if (!empty($row->grants))
{
$row->grants = json_decode($row->grants, true);
}
}
$this->cache[$store] = $result;
return $this->cache[$store];
}
/** /**
* Method to get a DatabaseQuery object for retrieving the data set from a database. * Method to get a DatabaseQuery object for retrieving the data set from a database.
* *