If I create a new custom table directly in the database (mysql/wordpress), is there a way to access that table using the civicrm api (read and/or write)?
-
Ideally you should add an entity and not a custom table with SQL (see docs.civicrm.org/dev/en/latest/step-by-step/create-entity or github.com/systopia/de.systopia.eck– ErikH - CiviCooPCommented Jul 15 at 12:48
-
Alternatively, if interacting with WordPress and CiviCRM thru a wordpress plugin, you can use wordpress $wpdb to access any tables in the db.– jsherkCommented Jul 15 at 14:58
Add a comment
|
1 Answer
The short answer is no. I assume your table doesn't represent an entity or you would have just created it as an entity and then it would be available to the api.
You can always use CRM_Core_DAO::executeQuery() - it's not technically api but it's used everywhere.