| 1 |
<?php |
| 2 |
|
| 3 |
namespace BitCode\BitForm\Core\Database; |
| 4 |
|
| 5 |
class FallbackModel extends Model |
| 6 |
{ |
| 7 |
public function changeMetaKey($fieldKey, $name) |
| 8 |
{ |
| 9 |
$prefix = $this->app_db->prefix; |
| 10 |
$sql = "UPDATE {$prefix}bitforms_form_entrymeta SET meta_key = '{$fieldKey}' WHERE meta_key = '{$fieldKey}{$name}'"; |
| 11 |
|
| 12 |
return $this->execute($sql); |
| 13 |
} |
| 14 |
|
| 15 |
public function changeIntegKey($integId, $conf) |
| 16 |
{ |
| 17 |
$prefix = $this->app_db->prefix; |
| 18 |
$sql = "UPDATE {$prefix}bitforms_integration SET integration_details = '%s' WHERE id = %d"; |
| 19 |
$values = [$conf, $integId]; |
| 20 |
|
| 21 |
return $this->execute($sql, $values)->getResult(); |
| 22 |
} |
| 23 |
|
| 24 |
public function changeWorkflowKey($workflowId, $logics, $workflowAction) |
| 25 |
{ |
| 26 |
$prefix = $this->app_db->prefix; |
| 27 |
$sql = "UPDATE {$prefix}bitforms_workflows SET workflow_condition = '%s', workflow_action = '%s' WHERE id = %d"; |
| 28 |
$values = [$logics, $workflowAction, $workflowId]; |
| 29 |
return $this->execute($sql, $values)->getResult(); |
| 30 |
} |
| 31 |
|
| 32 |
public function changeSuccessMessageKey($messageId, $title, $content, $config) |
| 33 |
{ |
| 34 |
$prefix = $this->app_db->prefix; |
| 35 |
$sql = "UPDATE {$prefix}bitforms_success_messages SET message_title = '%s', message_content = '%s', message_config = '%s' WHERE id = %d"; |
| 36 |
$values = [$title, $content, $config, $messageId]; |
| 37 |
return $this->execute($sql, $values)->getResult(); |
| 38 |
} |
| 39 |
|
| 40 |
public function changeEmailTempKey($tempId, $sub, $body) |
| 41 |
{ |
| 42 |
$prefix = $this->app_db->prefix; |
| 43 |
$sql = "UPDATE {$prefix}bitforms_email_template SET sub = '%s', body = '%s' WHERE id = %d"; |
| 44 |
$values = [$sub, $body, $tempId]; |
| 45 |
return $this->execute($sql, $values)->getResult(); |
| 46 |
} |
| 47 |
} |
| 48 |
|