tp TouchPointWP Utilities NotableAttributes - TenthPres/TouchPoint-WP GitHub Wiki

tp\TouchPointWP\Utilities\NotableAttributes

A collection of things that can be cast to a string by gluing them together with a simple implode().

Methods

__construct

mixed tp\TouchPointWP\Utilities\StringableArray::__construct(object|array array, int flags, string iteratorClass)

StringableArray constructor.

Arguments

  • array object|array* flags int* iteratorClass string

Returns

  • mixed

count

int tp\TouchPointWP\Utilities\StringableArray::count()

Length of array.

Returns

  • int -

prepend

mixed tp\TouchPointWP\Utilities\StringableArray::prepend(mixed value, null key)

Append to the start of the array.

Arguments

  • value mixed* key null

Returns

  • mixed

toArray

array tp\TouchPointWP\Utilities\StringableArray::toArray()

Get the stringable array, as an array.

Returns

  • array -

contains

bool tp\TouchPointWP\Utilities\StringableArray::contains(mixed needle)

Determine if the stringable array (haystack) contains the given needle

Arguments

  • needle mixed

Returns

  • bool -

keys

array tp\TouchPointWP\Utilities\StringableArray::keys()

Get the keys of the array.

Returns

  • array -

__toString

string tp\TouchPointWP\Utilities\StringableArray::__toString()

Standard method to stringify.

Returns

  • string -

join

string tp\TouchPointWP\Utilities\StringableArray::join(string|null separator, string|null prefix, string|null postfix)

Link the items together with a given separator, which may be different from the separator used in the constructor.

Arguments

  • separator string|null* prefix string|null* postfix string|null

Returns

  • string -

toListString

string tp\TouchPointWP\Utilities\StringableArray::toListString(int limit, bool andOthers)

Convert the array to a list string with ampersands and such.

Arguments

  • limit int* andOthers bool

Returns

  • string -