Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

create_resource_type()

Description

Create a new resource type with the specified name

Parameters

ColumnTypeDefaultDescription
$name
Name $name of new resouce type

Return

int| bool ref of new resource type or false if invalid data passed

Location

include/config_functions.php lines 1498 to 1513

Definition

 
function create_resource_type($name)
    {
    if(!
checkperm('a') || trim($name) == "")
        {
        return 
false;
        }

    
ps_query("INSERT INTO resource_type (name) VALUES (?) ",array("s",$name));
    
$newid sql_insert_id();
    
clear_query_cache("schema");
    if(isset(
$GLOBALS["restype_cache"]))
        {
        unset(
$GLOBALS["restype_cache"]);
        }
    return 
$newid;
    }

This article was last updated 27th April 2024 21:35 Europe/London time based on the source file dated 18th April 2024 17:15 Europe/London time.