I want to store a category record from controller by using JTable
. My working code is-
$table = JTable::getInstance('Category');
$data = array('id' => 0, 'parent_id' = 1, 'path' => 'demo', 'level' => 1, 'title' => 'demo');
if ($table->bind($data)) {
$table->store(true);
}
This code section store the record into #__categories
table but problem is it stores parent_id = 0
and level = 0
always. How can I solve this problem?
var_dump($table)
? This looks perhaps related forum.joomla.org/viewtopic.php?t=554960 or maybe this: forum.joomla.org/viewtopic.php?t=247046