<?php



use Idearia\Logger;



class Pipeline {



	protected $itemId = false;

	protected $itemAction = false;

	protected $body = false;



	public function __construct($payload) {

		$this->itemId = $payload["itemId"];

		$this->itemAction = $payload["itemAction"];

		$this->body = $payload["body"];

	}



	public function run() {

		Logger::info( "Pipeline::run() {$this->itemAction}" );

		if (method_exists($this, $this->itemAction)) {

			Logger::info( "Pipeline::run() executing" );

			return $this->{$this->itemAction}();

		} else {

			Logger::error( "Pipeline::run() method not found" );

		}

		return false;

	}

}