CRM_Utils_Schema
in package
Helper classes for parsing the xml schema files.
Tags
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
stringgetCrmTypeFromSqlType()
public
static getCrmTypeFromSqlType(string $sqlType) : int
Parameters
- $sqlType : string
Return values
intgetDataType()
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|nullgetDefaultSize()
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>|nullgetFieldPermission()
public
static getFieldPermission(SimpleXMLElement $fieldXML) : array<string|int, mixed>|null
Parameters
- $fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>|nullgetFieldPseudoconstant()
public
static getFieldPseudoconstant(SimpleXMLElement $fieldXML) : array<string|int, mixed>|null
Parameters
- $fieldXML : SimpleXMLElement
Return values
array<string|int, mixed>|nullgetFieldUsage()
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>|nullgetSize()
Sets the size property of a textfield.
public
static getSize(SimpleXMLElement $fieldXML) : string
Parameters
- $fieldXML : SimpleXMLElement
Return values
stringgetTypeAttributes()
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|nulltoString()
public
static toString(string $key, SimpleXMLElement $xml) : string|null
Parameters
- $key : string
- $xml : SimpleXMLElement