$table = JTable::getInstance('mytable', 'MyTable'); $table->load($id); $parentId = $table->_getAssetParentId(); echo "The asset parent ID of record $id is $parentId";
$table = JTable::getInstance('mytable', 'MyTable'); $data = array('title' => 'New Record', 'text' => 'Lorem Ipsum'); $table->bind($data); $table->_getAssetParentId(true); // Assigns default asset parent ID to the new record $table->store();In this example, we create a new record in the "mytable" table and assign a default asset parent ID using _getAssetParentId(true) method. We then store the record in the table using store() method. Package library: Joomla Platform - JTable class.