Skip to content

Import a database array as a collection response #2

@lode

Description

@lode

It would be nice to do something like this:

$results = 'mysqli_query() + fetch_assoc() while-loop';
$jsonapi = new jsonapi\collection($type='users');
$jsonapi->import_from_array($results);

And maybe a way to split keys as relationships. Like import_from_array($array, $split_relation_names) or $array = collection::split_relations($array, $relation_names).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions