- \Somnambulist\Components\Collection\Behaviours\Export\Serializable
- \Somnambulist\Components\Collection\Behaviours\Export\ExportToString
- \Somnambulist\Components\Collection\Behaviours\Export\ExportToJson
- \Somnambulist\Components\Collection\Behaviours\Export\ExportToArray
- \Somnambulist\Components\Collection\Behaviours\Export\JsonSerialize
- \Somnambulist\Components\Collection\Behaviours\Export\ExportToQueryString
Trait Serializable
Visibility | Function |
---|---|
public | serialize() : string |
public | unserialize(\string $serialized) : \Somnambulist\Components\Collection\Collection/static |
Trait ExportToString
Visibility | Function |
---|---|
public | implode(\string $glue=',' , \null $value=null, \string $withKeys=null) : stringImplodes all the values into a single string, objects should support __toString If a specific value is specified it will be pulled from any sub-arrays or objects; alternatively it can be a closure to fetch specific properties from any objects in the collection. If $withKeys is set to a string, it will prefix the string value with the key and the $withKeys string. |
public | toString() : string Converts the collection to a JSON string |
Trait ExportToJson
Visibility | Function |
---|---|
public | toJson(\int $options) : string Return the collection as a JSON string, uses toArray to convert to an Array |
Trait ExportToArray
Visibility | Function |
---|---|
public | toArray() : array Convert the collection and any nested data to an array Note: some objects may fail to convert to arrays if they do not have appropriate export / array methods. |
Trait JsonSerialize
Visibility | Function |
---|---|
public | jsonSerialize() : array Returns the collection in a form suitable for encoding to JSON |
Trait ExportToQueryString
Visibility | Function |
---|---|
public | toQueryString(\string $separator='&' , \int $encoding=2) : stringReturns a HTTP query string of the values Note: should only be used with elements that can be cast to scalars. |