Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Yes.Would I create an instance of the FieldTable class and then use the store function to create the new field, and will it also add the associated columns in the comprofiler table?
With Joomla/CB APIs you don't manually open or close the connection. That's all handled further up the chain in the database APIs. Basically doing a ->store opens and closes the connection automatically.Is there code I should be usinig to close database connection as well or does CB already do that after the store?
Please Log in to join the conversation.
if ( ( ! file_exists( JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) ) {
echo 'CB not installed'; return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
PHP Fatal error: Call to a member function loadPluginGroup() on a non-object in C:\WebRoot\website\joomla\libraries\CBLib\CB\Database\Table\FieldTable.php on line 234
$field_Table = new \CB\Database\Table\FieldTable();
$field_Table->set( 'name', 'cb_newfield');
$field_Table->set( 'title', 'New field');
$field_Table->set( 'profile', '0');
$field_Table->set( 'readonly', '1');
$field_Table->set( 'published', '1');
$field_Table->set( 'type', 'date');
$field_Table->set( 'tabid', '11');
$field_Table->set( 'table', '#__comprofiler');
Please Log in to join the conversation.