New stuff! [skip ci]

This commit is contained in:
James Cole
2014-07-27 20:29:58 +02:00
parent b782bb8d93
commit 92f2e30ed1
22 changed files with 868 additions and 251 deletions

View File

@@ -37,6 +37,7 @@ class LimitRepetition extends Ardent
$start->startOfMonth();
$end = clone $start;
$end->endOfMonth();
return [
'limit_id' => 'factory|Limit',
'startdate' => $start,
@@ -45,11 +46,6 @@ class LimitRepetition extends Ardent
];
}
public function limit()
{
return $this->belongsTo('Limit');
}
public function getDates()
{
return ['created_at', 'updated_at', 'startdate', 'enddate'];
@@ -60,10 +56,6 @@ class LimitRepetition extends Ardent
*/
public function left()
{
$key = 'limit-rep-left-' . $this->id;
if (Cache::has($key)) {
return Cache::get($key);
}
$left = floatval($this->amount);
// budget:
@@ -80,11 +72,14 @@ class LimitRepetition extends Ardent
}
}
}
Cache::forever($key, $left);
return $left;
}
public function limit()
{
return $this->belongsTo('Limit');
}
}