1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/Event/TaskModification.php

52 lines
986 B
PHP
Raw Normal View History

2014-07-20 12:26:15 +02:00
<?php
namespace Event;
use Core\Listener;
use Model\Project;
/**
* Task modification listener
*
* @package events
* @author Frederic Guillot
*/
class TaskModification implements Listener
{
/**
* Project model
*
* @accesss private
* @var \Model\Project
*/
private $project;
/**
* Constructor
*
* @access public
* @param \Model\Project $project Project model instance
*/
public function __construct(Project $project)
{
$this->project = $project;
}
/**
* Execute the action
*
* @access public
* @param array $data Event data dictionary
* @return bool True if the action was executed or false when not executed
*/
public function execute(array $data)
{
if (isset($data['project_id'])) {
$this->project->updateModificationDate($data['project_id']);
return true;
}
return false;
}
}