Skip to content

Expose raw settings (from Data) #764

@tacman

Description

@tacman

I'd like to see the raw settings as an array, and I can't see how to do it.

    public function getSettings(): array
    {
        return (new Settings($this->http->get(self::PATH.'/'.$this->uid.'/settings')))
            ->getIterator()->getArrayCopy();
    }

I think the easiest solution is to add a public getter to Data that gets the protected $data property.

class Data implements \ArrayAccess, \Countable, \IteratorAggregate
{
    protected $data = [];

    public function __construct(array $data = [])
    {
        $this->data = $data;
    }

    public function getData(): array
    {
        return $this->data;
    }

It could also be called getRawData()

Although it's great to have the Embedder class and everything else, sometimes I just want the raw data, especially to store with my internal database of indexes. Am I missing an easier way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions