The item of my interest is in the __zoo_item table. My query:
$query
->select($db->quoteName(array('params')))
->from($db->quoteName('#__zoo_item'));
$db->setQuery($query);
$resultado = $db->loadObjectList();
The contents of params is a JSON like this:
{
"metadata.title": "",
"metadata.description": "",
"metadata.keywords": "",
"metadata.robots": "",
"metadata.author": "",
"config.enable_comments": "0",
"config.primary_category": "27"
}
I need to retrieve the value of primary_category. That is, I need retrieve: 27. How do I do that? I try to recover it as follows:
foreach ($resultado as value) {
if ( is_object($value) ) {
echo $value->config.primary_category;
}
}
This is the best way to do this? The browser returns this: primary_category. How to retrieve the value: 27?