_endpoint = $endpoint; } /** * Append to array yet another attribute of query * * @param string $word * @return QueryInterface */ public function add(string $word): QueryInterface { $this->_attributes[] = $word; return $this; } /** * Get attributes array of current query * * @return array */ public function getAttributes(): array { return $this->_attributes; } /** * Get endpoint of current query * * @return string */ public function getEndpoint(): string { return $this->_endpoint; } /** * Build body of query * * @return array */ public function getQuery(): array { $endpoint = $this->getEndpoint(); $attributes = $this->getAttributes(); array_unshift($attributes, $endpoint); return $attributes; } }