Backend\Modules\Tags\Engine\Model::insert PHP Method

insert() public static method

Insert a new tag
public static insert ( string $tag, string $language = null ) : integer
$tag string The data for the tag.
$language string The language wherein the tag will be inserted, if not provided the workinglanguage will be used.
return integer
    public static function insert($tag, $language = null)
    {
        $tag = (string) $tag;
        $language = $language != null ? (string) $language : BL::getWorkingLanguage();
        // build record
        $item['language'] = $language;
        $item['tag'] = $tag;
        $item['number'] = 0;
        $item['url'] = self::getURL($tag);
        // insert and return id
        return (int) BackendModel::getContainer()->get('database')->insert('tags', $item);
    }