Add ProjectApiFormatter

This commit is contained in:
Frederic Guillot
2017-05-22 16:12:23 -04:00
parent 3c79d11e02
commit 435e053f12
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace Kanboard\Plugin\Calendar\Formatter;
/**
* Class ProjectApiFormatter
*
* @package Kanboard\Plugin\Calendar\Formatter
*/
class ProjectApiFormatter extends \Kanboard\Formatter\ProjectApiFormatter
{
public function format()
{
$project = parent::format();
if (! empty($project)) {
$project['url']['calendar'] = $this->helper->url->to('CalendarController', 'project', array('project_id' => $project['id'], 'plugin' => 'Calendar'), '', true);
}
return $project;
}
}