patrickisgreat / exacttargetlaravel

A simple API for communicating with Exact Target within PHP applications
MIT License
4 stars 3 forks source link

missing a function #1

Closed keneasson closed 8 years ago

keneasson commented 9 years ago

Hey, trying out this library with Lumen Ran into an issue out of the box: $this->etConnect()

there is no such function etConnect how do you get to $this in the controller? Here's what i've tried and nothing's working. Looks like there is a part of the library missing.


namespace App\Http\Middleware;

use Closure;
use digitaladditive\exacttargetlaravel\LaravelEtApi;

class VerifyEmailMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {

        if ($request->input('Email')) {

            $responce = LaravelEtApi::getRows('Campaign_Master_DE','Email', $request->input('Email')); // Error Not a static method
            // $responce = $this->etConnect()->getRows('Campaign_Master_DE','Email', $request->input('Email')); // Call to undefined method App\Http\Middleware\VerifyEmailMiddleware::etConnect()
            // $et = new LaravelEtApi; // where do i get all the credentials! doesn't work?

            print_r($responce);
            die('done with middleware');

            return $next($request);
        }
    }
}
patrickisgreat commented 9 years ago

Hi!

Yeah this is a real work in progress. I have a lot of changes that I need to finalize and commit but it is working well for us so far.

Try this in your controller:

/**

On Thu, Sep 17, 2015 at 3:33 PM, keneasson notifications@github.com wrote:

Hey, trying out this library with Lumen Ran into an issue out of the box: $this->etConnect()

there is no such function etConnect how do you get to $this in the controller? Here's what i've tried and nothing's working. Looks like there is a part of the library missing.

namespace App\Http\Middleware;

use Closure; use digitaladditive\exacttargetlaravel\LaravelEtApi;

class VerifyEmailMiddleware { /* * Handle an incoming request. * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) {

    if ($request->input('Email')) {

        $responce = LaravelEtApi::getRows('Campaign_Master_DE','Email', $request->input('Email')); // Error Not a static method
        // $responce = $this->etConnect()->getRows('Campaign_Master_DE','Email', $request->input('Email')); // Call to undefined method App\Http\Middleware\VerifyEmailMiddleware::etConnect()
        // $et = new LaravelEtApi; // where do i get all the credentials! doesn't work?

        print_r($responce);
        die('done with middleware');

        return $next($request);
    }
}

}

— Reply to this email directly or view it on GitHub https://github.com/patrickisgreat/exacttargetlaravel/issues/1.

Patrick Bennett 404.514.7647 facebook.com/patrickisgreat twitter.com/patrickisgreat

patrickisgreat commented 9 years ago

I've altered the getRows method to handle more the 2500 record per request limit. That is coming very soon. Also I have a script that helps automate the process of installation via composer command line dialogue so you don't have to copy and rename config files.

Let me know if you need any other assistance to get it up and running!

Thanks, Patrick

keneasson commented 9 years ago

Thanks for the fast response! The addition of the App::make did the trick!