Problem/Motivation

I am working on a module that provides block plugins for Mautic forms and focus items. In the configuration for the blocks, a user will be able to select which form or focus item they want. To be able to do this, I need an additional method added to mautic_api service.

Proposed resolution

Add a method that returns an array from a Mautic API endpoint.

Comments

kevinfunk created an issue. See original summary.

kevinfunk’s picture

StatusFileSize
new2.79 KB

Patch adds a new method, getList, to return an array from a Mautic API endpoint. It also creates a new method, initiateConnection, so I didn't have to repeat code.

jeremyr’s picture

Issue summary: View changes
StatusFileSize
new3.45 KB

Patch applies cleanly and in doing some basic test goes I was able to fetch lists from a Mautic instance.

A few house keeping items:

The comment above the this function private function initiateConnection($endpoint) is {@inheritdoc} but since it's a private function, there is nothing to inherit from.

There is an empty line between the comment and this function public function getList($endpoint), however, since there is an interface I'd recommend adding it to the comment and function toMauticApiServiceInterface.php.

I've rerolled the patch with my proposed changes.

jeremyr’s picture

StatusFileSize
new3.46 KB

One more thing change... the docblock suggests the $endpoint should be an array but it really should be a string. New patch to reflect that change.

  • archnode committed 92ccd29 on 8.x-1.x
    Issue #3166629 by kevinfunk, jeremyr: Add abstraction for mautic...
archnode’s picture

Status: Active » Fixed

Patch looks good. Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.