I’m getting an array to string conversion notice and this is how the data comes back:
<b>Notice</b>: Array to string conversion in <b>/Applications/MAMP/htdocs/Feedback/vendor/dhtmlx/connector-php/codebase/Dhtmlx/Connector/MixedConnector.php</b> on line <b>32</b>
<b>Notice</b>: Array to string conversion in <b>/Applications/MAMP/htdocs/Feedback/vendor/dhtmlx/connector-php/codebase/Dhtmlx/Connector/MixedConnector.php</b> on line <b>32</b>
'{"inv1":Array
,
"inv2":Array
}'
Here is my code:
$dbtype = "PDO";
$data = new JSONDataConnector($this->connection, $dbtype);
$data->configure("inv_central",
"id",
"cogs");
$data1 = new JSONDataConnector($this->connection, $dbtype);
$data1->configure("inv_central",
"id",
"cogs");
$conn = new MixedConnector();
$conn->add("inv1", $data);
$conn->add("inv2", $data1);
$conn->render();
I can get the notices to go away by adding json_encode() here, but the data still doesn’t load.
private function render_json() {
$result = "{";
$parts = array();
foreach($this->connectors as $name => $conn) {
$conn->asString(true);
$parts[] = "\"".$name."\":".(json_encode($conn->render()))."\n";
}
$result .= implode(",\n", $parts)."}";
echo $result;
}
Documentation is sparse on this. Any help would be appreciated.