First attempt at basic tag functionality.

This commit is contained in:
James Cole
2015-04-28 08:58:01 +02:00
parent 6081cc399f
commit e7165a526b
26 changed files with 1046 additions and 67 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace FireflyIII\Repositories\Tag;
use Auth;
use FireflyIII\Models\Tag;
/**
* Class TagRepository
*
* @package FireflyIII\Repositories\Tag
*/
class TagRepository implements TagRepositoryInterface
{
/**
* @param array $data
*
* @return Tag
*/
public function store(array $data)
{
$tag = new Tag;
$tag->tag = $data['tag'];
$tag->date = $data['date'];
$tag->description = $data['description'];
$tag->latitude = $data['latitude'];
$tag->longitude = $data['longitude'];
$tag->zoomLevel = $data['zoomLevel'];
$tag->tagMode = $data['tagMode'];
$tag->user()->associate(Auth::user());
$tag->save();
return $tag;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace FireflyIII\Repositories\Tag;
use FireflyIII\Models\Tag;
/**
* Interface TagRepositoryInterface
*
* @package FireflyIII\Repositories\Tag
*/
interface TagRepositoryInterface {
/**
* @param array $data
*
* @return Tag
*/
public function store(array $data);
}