Support

Home Forums Event Espresso Premium Storing additonal comments against a transaction

Storing additonal comments against a transaction

Posted: December 4, 2014 at 4:03 am

Viewing 4 reply threads


Eversion Systems

December 4, 2014 at 4:03 am

I’m building a plugin to push invoices to Xero and was wondering if there was anyway of storing a comment against a transaction? I’ve looked in the wp_posts and there is no post associated with the transaction so I can’t store it in wp_comments.

Should I just add a custom table to store these comments?


Lorenzo Orlando Caum

  • Support Staff

December 4, 2014 at 10:35 am

Hi, I checked with a developer on this and he recommended using the esp_extra_meta DB table with the EEM_Extra_Meta model.

All the model objects have methods get_extra_meta, update_extra_meta, add_extra_meta, delete_extra_meta and all_extra_meta_array

For example, if you have the transaction object $t, you could call $t->update_extra_meta(‘comments’, ‘this is my comment’); then do $comments = $t->get_extra_meta( $t );


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

December 4, 2014 at 11:07 am

Hi,

More information is available here:

http://developer.eventespresso.com/docs/using-ee4-model-objects/#Storing_Meta_information_about_any_Model_Object


Lorenzo


Eversion Systems

December 4, 2014 at 4:10 pm

Thanks! Only issue is that this wouldn’t allow for multiple comment rows per transaction from what you have in your code… Would this be the case?


Lorenzo Orlando Caum

  • Support Staff

December 4, 2014 at 4:55 pm

Hello again,

The example in my original reply would be for a single comment:

https://eventespresso.com/topic/storing-additonal-comments-against-a-transaction/#post-130781

However, the new documentation entry here has an example for multiple comments:

http://developer.eventespresso.com/docs/using-ee4-model-objects/#Storing_Meta_information_about_any_Model_Object


Lorenzo

Viewing 4 reply threads

The support post ‘Storing additonal comments against a transaction’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso