Flow PHP

ScalarFunctionChain implements ScalarFunction

AbstractYes

Interfaces

ScalarFunction

Methods

and()  : All
andNot()  : All
arrayFilter()  : ArrayFilter
Filters an array by removing all elements that matches passed value.
arrayGet()  : ArrayGet
arrayGetCollection()  : ArrayGetCollection
arrayGetCollectionFirst()  : ArrayGetCollection
arrayKeep()  : ArrayKeep
Filters an array by keeping only elements that matches passed value.
arrayKeys()  : ArrayKeys
Returns all keys from an array, ignoring the values.
arrayMerge()  : ArrayMerge
arrayMergeCollection()  : ArrayMergeCollection
arrayPathExists()  : ArrayPathExists
arrayReverse()  : ArrayReverse
arraySort()  : ArraySort
arrayValues()  : ArrayValues
Returns all values from an array, ignoring the keys.
ascii()  : Ascii
between()  : Between
call()  : CallUserFunc
capitalize()  : Capitalize
cast()  : Cast
coalesce()  : Coalesce
concat()  : Concat
concatWithSeparator()  : ConcatWithSeparator
contains()  : Contains
dateFormat()  : DateTimeFormat
dateTimeFormat()  : DateTimeFormat
divide()  : Divide
domElementAttribute()  : DOMElementAttributeValue
domElementAttributesCount()  : DOMElementAttributesCount
domElementAttributeValue()  : DOMElementAttributeValue
domElementValue()  : DOMElementValue
endsWith()  : EndsWith
equals()  : Equals
exists()  : Exists
expand()  : ArrayExpand
Expands each value into entry, if there are more than one value, multiple rows will be created.
greaterThan()  : GreaterThan
greaterThanEqual()  : GreaterThanEqual
hash()  : Hash
indexOf()  : IndexOf
Returns the index of given $needle in string.
isEven()  : Equals
isFalse()  : Same
isIn()  : IsIn
isNotNull()  : IsNotNull
isNotNumeric()  : IsNotNumeric
isNull()  : IsNull
isNumeric()  : IsNumeric
isOdd()  : NotEquals
isTrue()  : Same
isType()  : IsType
isUtf8()  : IsUtf8
Check string is utf8 and returns true or false.
jsonDecode()  : JsonDecode
jsonEncode()  : JsonEncode
lessThan()  : LessThan
lessThanEqual()  : LessThanEqual
literal()  : Literal
lower()  : ToLower
minus()  : Minus
mod()  : Mod
modifyDateTime()  : ModifyDateTime
multiply()  : Multiply
notEquals()  : NotEquals
notSame()  : NotSame
numberFormat()  : NumberFormat
onEach()  : OnEach
Execute a scalar function on each element of an array/list/map/structure entry.
or()  : Any
orNot()  : Any
plus()  : Plus
power()  : Power
regex()  : Regex
regexAll()  : RegexAll
regexMatch()  : RegexMatch
regexMatchAll()  : RegexMatchAll
regexReplace()  : RegexReplace
round()  : Round
same()  : Same
sanitize()  : Sanitize
size()  : Size
slug()  : Slug
split()  : Split
sprintf()  : Sprintf
startsWith()  : StartsWith
stringAfter()  : StringAfter
Returns the contents found after the first occurrence of the given string.
stringAfterLast()  : StringAfterLast
Returns the contents found after the last occurrence of the given string.
stringBefore()  : StringBefore
Returns the contents found before the first occurrence of the given string.
stringBeforeLast()  : StringBeforeLast
Returns the contents found before the last occurrence of the given string.
stringFold()  : StringFold
Returns a string that you can use in case-insensitive comparisons.
stringStyle()  : StringStyle
Covert string to a style from enum list, passed in parameter.
stringTitle()  : StringTitle
Changes all graphemes/code points to "title case".
strPad()  : StrPad
strPadBoth()  : StrPad
strPadLeft()  : StrPad
strPadRight()  : StrPad
strReplace()  : StrReplace
toDate()  : ToDate
toDateTime()  : ToDateTime
trim()  : Trim
unpack()  : ArrayUnpack
upper()  : ToUpper
xpath()  : XPath

Methods

arrayFilter()

Filters an array by removing all elements that matches passed value.

public arrayFilter(mixed $value) : ArrayFilter

Applicable to all data structures that can be converted to an array:

  • json
  • list
  • map
  • structure.
Parameters
$value : mixed
Return values
ArrayFilter

arrayKeep()

Filters an array by keeping only elements that matches passed value.

public arrayKeep(mixed $value) : ArrayKeep

Applicable to all data structures that can be converted to an array:

  • json
  • list
  • map
  • structure.
Parameters
$value : mixed
Return values
ArrayKeep

arrayKeys()

Returns all keys from an array, ignoring the values.

public arrayKeys() : ArrayKeys

Applicable to all data structures that can be converted to an array:

  • json
  • list
  • map
  • structure.
Return values
ArrayKeys

arrayValues()

Returns all values from an array, ignoring the keys.

public arrayValues() : ArrayValues

Applicable to all data structures that can be converted to an array:

  • json
  • list
  • map
  • structure.
Return values
ArrayValues

call()

public call(ScalarFunction|callable $callable[, array<string|int, mixed> $arguments = [] ][, string|int $refAlias = 0 ][, Type<string|int, mixed> $returnType = null ]) : CallUserFunc
Parameters
$callable : ScalarFunction|callable
$arguments : array<string|int, mixed> = []
$refAlias : string|int = 0
$returnType : Type<string|int, mixed> = null
Return values
CallUserFunc

cast()

public cast(string|Type<string|int, mixed> $type) : Cast
Parameters
$type : string|Type<string|int, mixed>
Return values
Cast

expand()

Expands each value into entry, if there are more than one value, multiple rows will be created.

public expand([ArrayExpand $expand = ArrayExpand::VALUES ]) : ArrayExpand

Array keys are ignored, only values are used to create new rows.

Before: +--+-------------------+ |id| array| +--+-------------------+ | 1|{"a":1,"b":2,"c":3}| +--+-------------------+

After: +--+--------+ |id|expanded| +--+--------+ | 1| 1| | 1| 2| | 1| 3| +--+--------+

Parameters
$expand : ArrayExpand = ArrayExpand::VALUES
Return values
ArrayExpand

isIn()

public isIn(array<string|int, mixed> $haystack) : IsIn
Parameters
$haystack : array<string|int, mixed>
Return values
IsIn

isType()

public isType(string|Type<string|int, mixed> ...$types) : IsType
Parameters
$types : string|Type<string|int, mixed>
Return values
IsType

onEach()

Execute a scalar function on each element of an array/list/map/structure entry.

public onEach(ScalarFunction $function[, ScalarFunction|bool $preserveKeys = true ]) : OnEach

In order to use this function, you need to provide a reference to the "element" that will be used in the function.

Example: $df->withEntry('array', ref('array')->onEach(ref('element')->cast(type_string())))

Parameters
$function : ScalarFunction
$preserveKeys : ScalarFunction|bool = true
Return values
OnEach

strPad()

public strPad(int $length[, string $pad_string = ' ' ][, int $type = STR_PAD_RIGHT ]) : StrPad
Parameters
$length : int
$pad_string : string = ' '
$type : int = STR_PAD_RIGHT
Return values
StrPad

strPadBoth()

public strPadBoth(int $length[, string $pad_string = ' ' ]) : StrPad
Parameters
$length : int
$pad_string : string = ' '
Return values
StrPad

strPadLeft()

public strPadLeft(int $length[, string $pad_string = ' ' ]) : StrPad
Parameters
$length : int
$pad_string : string = ' '
Return values
StrPad

strPadRight()

public strPadRight(int $length[, string $pad_string = ' ' ]) : StrPad
Parameters
$length : int
$pad_string : string = ' '
Return values
StrPad

trim()

public trim([Type $type = TrimType::BOTH ][, string $characters = " " ]) : Trim
Parameters
$type : Type = TrimType::BOTH
$characters : string = " "
Return values
Trim

        
On this page

Search results