You are here

function xbbcode_custom_tag_save in Extensible BBCode 8.2

Same name and namespace in other branches
  1. 8 xbbcode.crud.inc \xbbcode_custom_tag_save()
  2. 7 xbbcode.crud.inc \xbbcode_custom_tag_save()

Save a custom tag.

Parameters

$tag: A full tag object, with the options in a single array property.

Return value

The result of the merge query.

1 call to xbbcode_custom_tag_save()
XBBCodeTagForm::_submitFormSave in src/Form/XBBCodeTagForm.php
Save (create or update) a custom tag.

File

./xbbcode.crud.inc, line 68
Data interface for creating, reading, updating and deleting records.

Code

function xbbcode_custom_tag_save($tag) {
  $query = db_merge('xbbcode_custom_tag')
    ->fields(array(
    'markup' => "{$tag->markup}",
    'description' => "{$tag->description}",
    'sample' => "{$tag->sample}",
    'options' => serialize($tag->options),
  ))
    ->key(array(
    'name' => "{$tag->name}",
  ))
    ->execute();
  return $query;
}