Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 3.58 KB

exportable.md

File metadata and controls

71 lines (45 loc) · 3.58 KB

Table of contents


Class: \Somnambulist\Components\Collection\Behaviours\Export\Serializable

Trait Serializable

Visibility Function
public serialize() : string
public unserialize(\string $serialized) : \Somnambulist\Components\Collection\Collection/static

Class: \Somnambulist\Components\Collection\Behaviours\Export\ExportToString

Trait ExportToString

Visibility Function
public implode(\string $glue=',', \null $value=null, \string $withKeys=null) : string
Implodes 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

Class: \Somnambulist\Components\Collection\Behaviours\Export\ExportToJson

Trait ExportToJson

Visibility Function
public toJson(\int $options) : string
Return the collection as a JSON string, uses toArray to convert to an Array

Class: \Somnambulist\Components\Collection\Behaviours\Export\ExportToArray

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.

Class: \Somnambulist\Components\Collection\Behaviours\Export\JsonSerialize

Trait JsonSerialize

Visibility Function
public jsonSerialize() : array
Returns the collection in a form suitable for encoding to JSON

Class: \Somnambulist\Components\Collection\Behaviours\Export\ExportToQueryString

Trait ExportToQueryString

Visibility Function
public toQueryString(\string $separator='&', \int $encoding=2) : string
Returns a HTTP query string of the values Note: should only be used with elements that can be cast to scalars.