com\setasign\SetaSite\PropertyContainer\Property

StringProperty

File: /SetaSite/src/PropertyContainer/Property/StringProperty.php

Class hierarchy

Implements

Summary

Constants

VALIDATOR_EMPTY

public const StringProperty::VALIDATOR_EMPTY = 'empty'

VALIDATOR_MAX_LENGTH

public const StringProperty::VALIDATOR_MAX_LENGTH = 'maxLength'

VALIDATOR_MIN_LENGTH

public const StringProperty::VALIDATOR_MIN_LENGTH = 'minLength'

VALIDATOR_REGEX

public const StringProperty::VALIDATOR_REGEX = 'regex'

The regex will be checked via preg_match.

Regex must not contain a delimiter, slash(/) will be automatically used as delimiter

Has two optional config params: regexModifier & regexMessage

Note: The regex need to be compatible to php preg_match & javascript String::match

See

VALIDATOR_SYMBOLS

public const StringProperty::VALIDATOR_SYMBOLS = 'symbols'

Allowed symbols

This validator is case-sensitive


Properties

$config

protected \com\setasign\SetaFramework\Config\Config AbstractProperty::$config

$value

protected mixed AbstractProperty::$value

Static Methods

cleanupConfig()

public static AbstractProperty::cleanupConfig (
\com\setasign\SetaFramework\Config\Config $config
): void
Parameters
$config : \com\setasign\SetaFramework\Config\Config
 

Methods

__construct()

public AbstractProperty::__construct (
\com\setasign\SetaSite\PropertyContainer\ContainerParent\ContainerParentInterface $containerParent,
?\com\setasign\SetaFramework\Config\Config $config = null
)
Parameters
$containerParent : \com\setasign\SetaSite\PropertyContainer\ContainerParent\ContainerParentInterface
 
$config : ?\com\setasign\SetaFramework\Config\Config
 

__clone()

public AbstractProperty::__clone (
void
): void

__toString()

public StringProperty::__toString (
void
): string

exportValue()

public StringProperty::exportValue (
void
): mixed

Export the value, to use it in a Database

getConfig()

public AbstractProperty::getConfig (
void
): \com\setasign\SetaFramework\Config\Config

getDefaultValue()

public AbstractProperty::getDefaultValue (
void
): void

getValidators()

public AbstractProperty::getValidators (
void
): \com\setasign\SetaFramework\Config\Config

getValue()

public AbstractProperty::getValue (
void
): mixed

isNull()

public AbstractProperty::isNull (
void
): bool

Checks whether the value is null

isValid()

public StringProperty::isValid (
array &$result = array ( )
): bool

Validators:

maxLength symbols regex empty

Parameters
$result : array
 

parseValue()

protected StringProperty::parseValue (
mixed $value
): mixed

Parses the value to the correct format

Parameters
$value : mixed
 

setValue()

public AbstractProperty::setValue (
mixed $value,
bool $ignoreEditable = false
): void

Sets the value

Strings that are empty will be null

Parameters
$value : mixed
 
$ignoreEditable : bool

Ignore editable property, only for internal use!