Skip to Content Skip to Menu

SOLVED: CB Auto Actions: What are the available variables at a choosen trigger?

  • NFA
  • NFA
  • OFFLINE
  • Posts: 84
  • Thanks: 15
  • Karma: 0
1 year 6 months ago - 1 year 6 months ago #333610 by NFA
Hi,

Even after reading www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers I find it hard to figure out which variables are available in an Auto Action after a choosen trigger.

For example:
Code:
$_PLUGINS->trigger( 'gj_onAfterJoinGroup', array( $row, $group, $user ) );
I guess that:
var1 = $row --> Is an object with ??? properties. Where can I find or list the content of $row?
var2 = $group --> Is that an object from the given group with all #__groupjive_groups fields as a property?
var3 = $user --> Is that an object of the involved user with all #__comprofiler fields as a property?

If that is the case, then [var2_id] --> returns the id field of the group in the #__groupjive_groups table, while [var3_id] returns the id field of the user in the #__comprofile table?

But what kind of (extra) variables does the $row object give? Which extra properties can I get from $row?

What is the difference between $row and &$row which I see in some other triggers? In other words what is the meaning of & in this?

It would be nice if I could create an Auto Action that emails me all the available $row, $group, $user properties and their values after a chosen trigger? Then I can run that Auto Action once on different triggers and get more grip on what kind of variables I can use on those Auto Actions - triggers. Is that possible?

Hope you can help me to get a better understanding of this magic ;-),
Noa
Last edit: 1 year 6 months ago by NFA.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 6 months ago - 1 year 6 months ago #333614 by krileon

var1 = $row --> Is an object with ??? properties. Where can I find or list the content of $row?

That's the group user object. It contains the data found in _groupjive_users.

var2 = $group --> Is that an object from the given group with all #__groupjive_groups fields as a property?

Correct, that's the group object.

var3 = $user --> Is that an object of the involved user with all #__comprofiler fields as a property?

Correct, that's the CB user object.

If that is the case, then [var2_id] --> returns the id field of the group in the #__groupjive_groups table, while [var3_id] returns the id field of the user in the #__comprofile table?

Correct.

But what kind of (extra) variables does the $row object give? Which extra properties can I get from $row?

It will depend on the trigger, but in this case everything that's in _groupjive_users.

What is the difference between $row and &$row which I see in some other triggers? In other words what is the meaning of & in this?

The & makes it a reference variable. Reference variables can be changed using Code actions with PHP. Reference variables can be specified under the Parameters tab.

It would be nice if I could create an Auto Action that emails me all the available $row, $group, $user properties and their values after a chosen trigger? Then I can run that Auto Action once on different triggers and get more grip on what kind of variables I can use on those Auto Actions - triggers. Is that possible?

There's no functionality for that. We'll be improving trigger documentation sometime after CB 3.x when we redo them into Symfony API as we need to add some internal documentation to each trigger call so we can better explain what each is doing and what it contains.

The best I can advise if you're unsure which trigger or auto action to use is to simply make a forum topic explaining what you're wanting to do, where, and when. We can then try to best suggest what trigger you should use to cover that use case.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 1 year 6 months ago by krileon.
The following user(s) said Thank You: NFA

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum