* modelAction
*
* @param bool $actionData
+ *
* @access public
* @return void
*/
'view' => 'admin/management/leads.html',
'data' => $templateData
);
-
-
}
+ /**
+ * addInterestGroup
+ *
+ * Helper function to add the interests groups, and interests.
+ * Runs through the $form array and checks for the setting given for the
+ * group name. It adds the groups then the interests for the group from the
+ * form.
+ *
+ * @param mixed $form
+ * @param mixed $field_id
+ * @param mixed $group_name
+ *
+ * @access public
+ * @return void
+ */
public function addInterestGroup( $form, $field_id, $group_name ) {
$interests = array();
// go through the $form array and get all the inputs for the group_name field
* If the group is found it simply returns the group id.
* If the group is not found it will add the group and return the new id.
*
- * @param mixed $name
+ * @param mixed $name Name of the Group
*
* @access public
* @return int The id of the group
/**
* addEntry
*
- * @param mixed $entry
- * @param mixed $import_fields
+ * @param mixed $entry Entry array from Gravity Form
+ * @param mixed $import_fields Array of the import_fields
*
* @access public
* @return boolean True if added false if not
return $this->wpdb->insert_id;
}
}
+ /**
+ * getSourceId
+ *
+ * From the form id get this forms source id. If it's not found then
+ * create and entry and return the source id.
+ *
+ * @param mixed $form_id The id for the form.
+ *
+ * @access public
+ * @return int
+ */
public function getSourceId( $form_id ) {
$source_id = $this->wpdb->get_var(
$this->wpdb->prepare(
/**
* addMemberLeadEntry
*
+ * Adds the entry to the leads entry table.
+ * Checks first to see if it has a match comparing the gf_entry_id field.
+ * If found it will update the entry and return the id.
+ * If not found it will insert the entry and return the id.
+ *
* @param mixed $lead_id Id from the leads table
* @param mixed $lead Lead array
* @param mixed $entry Entry array
*
* @access public
- * @return void
+ * @return int Entry id
*/
public function addMemberLeadEntry( $lead_id, $lead, $entry ) {
if ( !isset( $lead_id ) || !filter_var( $lead_id, FILTER_VALIDATE_INT ) ) {
if ( !isset( $lead ) || !is_array( $lead ) ) {
return false;
}
- /*
- echo '<pre>$lead_id: ' . print_r( $lead_id, true ) . '</pre>';
- echo '<pre>$lead: ' . print_r( $lead, true ) . '</pre>';
- echo '<pre>$entry: ' . print_r( $entry, true ) . '</pre>';
- exit;
- */
// see if the gf_entry_id is already in
$entry_id = $this->wpdb->get_var(
$this->wpdb->prepare(
return $this->wpdb->insert_id;
}
}
+ /**
+ * getMembersInterests
+ *
+ * Returns the interests records with the gravity form field id's.
+ *
+ * @param mixed $form_id The id of the gravity form.
+ *
+ * @access public
+ * @return mixed
+ */
public function getMembersInterests( $form_id ) {
static $interest = array();
if ( empty( $interest ) ) {
}
return $interest;
}
+ /**
+ * addMemberLeadInterests
+ *
+ * Add the Lead interests for the entry.
+ *
+ * @param mixed $entry_id Id for the enty
+ * @param mixed $entry Entry array from gravity forms.
+ *
+ * @access public
+ * @return mixed
+ */
public function addMemberLeadInterests( $entry_id, $entry ) {
if ( !filter_var( $entry_id, FILTER_VALIDATE_INT ) ) {
return false;