Documentation

CRM_Utils_Schema
in package

Helper classes for parsing the xml schema files.

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Methods

composeTitle()  : string
Fallback used when field in schema xml is missing a title.
getCrmTypeFromSqlType()  : int
getDataType()  : string|null
Get the data type from a field array. Defaults to 'data_type' with fallback to mapping based on the 'sql_type'.
getDefaultSize()  : mixed
getFieldHtml()  : array<string|int, mixed>|null
getFieldPermission()  : array<string|int, mixed>|null
getFieldPseudoconstant()  : array<string|int, mixed>|null
getFieldUsage()  : array<string|int, mixed>
Get the 'usage' property for a field.
getFieldWidget()  : array<string|int, mixed>|array<string|int, string>|null
In multilingual context popup, we need extra information to create appropriate widget
getSize()  : string
Sets the size property of a textfield.
getTypeAttributes()  : array<string|int, mixed>
Get some attributes related to html type
toBool()  : bool|null
toString()  : string|null

Methods

composeTitle()

Fallback used when field in schema xml is missing a title.

public static composeTitle(string $name) : string

TODO: Trigger a deprecation notice when this happens.

Parameters
$name : string
Return values
string

getCrmTypeFromSqlType()

public static getCrmTypeFromSqlType(string $sqlType) : int
Parameters
$sqlType : string
Return values
int

getDataType()

Get the data type from a field array. Defaults to 'data_type' with fallback to mapping based on the 'sql_type'.

public static getDataType(array<string|int, mixed>|null $field) : string|null
Parameters
$field : array<string|int, mixed>|null

Field array as returned from EntityMetadataInterface::getField()

Return values
string|null

getDefaultSize()

public static getDefaultSize(mixed $length) : mixed
Parameters
$length : mixed

getFieldHtml()

public static getFieldHtml(SimpleXMLElement $fieldXML) : array<string|int, mixed>|null
Parameters
$fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>|null

getFieldPermission()

public static getFieldPermission(SimpleXMLElement $fieldXML) : array<string|int, mixed>|null
Parameters
$fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>|null

getFieldPseudoconstant()

public static getFieldPseudoconstant(SimpleXMLElement $fieldXML) : array<string|int, mixed>|null
Parameters
$fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>|null

getFieldUsage()

Get the 'usage' property for a field.

public static getFieldUsage(SimpleXMLElement $fieldXML) : array<string|int, mixed>
Parameters
$fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>

getFieldWidget()

In multilingual context popup, we need extra information to create appropriate widget

public static getFieldWidget(SimpleXMLElement $fieldXML) : array<string|int, mixed>|array<string|int, string>|null
Parameters
$fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>|array<string|int, string>|null

getSize()

Sets the size property of a textfield.

public static getSize(SimpleXMLElement $fieldXML) : string
Parameters
$fieldXML : SimpleXMLElement
Return values
string

getTypeAttributes()

Get some attributes related to html type

public static getTypeAttributes(SimpleXMLElement $fieldXML) : array<string|int, mixed>

Extracted during refactor, still a bit messy.

Parameters
$fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>

toBool()

public static toBool(string $key, SimpleXMLElement $xml) : bool|null
Parameters
$key : string
$xml : SimpleXMLElement
Return values
bool|null

toString()

public static toString(string $key, SimpleXMLElement $xml) : string|null
Parameters
$key : string
$xml : SimpleXMLElement
Return values
string|null

        
On this page

Search results