Documentation

CRM_Extension_Upgrader_TasksTrait

The TasksTrait provides a library of tasks that are useful to run during an upgrade.

Table of Contents

Methods

executeCustomDataFile()  : bool
Run a CustomData file.
executeSql()  : bool
Run one SQL query.
executeSqlFile()  : bool
Run a SQL file.
executeSqlTemplate()  : bool
Run the sql commands in the specified file.
getExtensionDir()  : string
executeCustomDataFileByAbsPath()  : bool
Run a CustomData file

Methods

executeCustomDataFile()

Run a CustomData file.

public executeCustomDataFile(string $relativePath) : bool
Parameters
$relativePath : string

the CustomData XML file path (relative to this extension's dir)

Return values
bool

executeSql()

Run one SQL query.

public executeSql(mixed $query[, mixed $params = [] ]) : bool

This is just a wrapper for CRM_Core_DAO::executeSql, but it provides syntactic sugar for queueing several tasks that run different queries

Parameters
$query : mixed
$params : mixed = []
Return values
bool

executeSqlFile()

Run a SQL file.

public executeSqlFile(string $tplFile) : bool
Parameters
$tplFile : string

The SQL file path (relative to this extension's dir, or absolute)

Return values
bool

executeSqlTemplate()

Run the sql commands in the specified file.

public executeSqlTemplate(string $tplFile) : bool
Parameters
$tplFile : string

The SQL file path (relative to this extension's dir, or absolute). Ex: "sql/mydata.mysql.tpl".

Tags
throws
CRM_Core_Exception
Return values
bool

getExtensionDir()

public abstract getExtensionDir() : string
Return values
string

executeCustomDataFileByAbsPath()

Run a CustomData file

protected executeCustomDataFileByAbsPath(string $xml_file) : bool
Parameters
$xml_file : string

the CustomData XML file path (absolute path)

Return values
bool

        
On this page

Search results