From 1cda8059b577d4025efa96377def082bf8f35f94 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 10 Mar 2014 21:49:24 -0400 Subject: Lowercase file --- actions/base.php | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 actions/base.php (limited to 'actions/base.php') diff --git a/actions/base.php b/actions/base.php new file mode 100644 index 00000000..bb9b8bc1 --- /dev/null +++ b/actions/base.php @@ -0,0 +1,55 @@ +project_id = $project_id; + } + + public function setParam($name, $value) + { + $this->params[$name] = $value; + } + + public function getParam($name, $default_value = null) + { + return isset($this->params[$name]) ? $this->params[$name] : $default_value; + } + + public function isExecutable(array $data) + { + if (isset($data['project_id']) && $data['project_id'] == $this->project_id && $this->hasRequiredParameters($data)) { + return true; + } + + return false; + } + + public function hasRequiredParameters(array $data) + { + foreach ($this->getEventRequiredParameters() as $parameter) { + if (! isset($data[$parameter])) return false; + } + + return true; + } + + public function execute(array $data) + { + if ($this->isExecutable($data)) { + return $this->doAction($data); + } + + return false; + } +} -- cgit v1.2.3