Move some stuff around.

This commit is contained in:
James Cole
2016-03-02 19:41:22 +01:00
parent 2fd476ada8
commit 5b949d6e00
4 changed files with 19 additions and 11 deletions

View File

@@ -1,39 +0,0 @@
<?php
/**
* BaseModel.php
* Copyright (C) 2016 Sander Dorigo
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class BaseModel
*
* @package FireflyIII\Models
*/
class BaseModel extends Model
{
/**
* @param $query
* @param $table
*
* @return bool
*/
public static function isJoined($query, $table)
{
$joins = $query->getQuery()->joins;
if($joins == null) {
return false;
}
foreach ($joins as $join) {
if ($join->table == $table) {
return true;
}
}
return false;
}
}

View File

@@ -3,6 +3,7 @@
use Auth;
use Carbon\Carbon;
use Crypt;
use FireflyIII\Support\Models\TransactionJournalSupport;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -58,7 +59,7 @@ use Watson\Validating\ValidatingTrait;
*
*/
class TransactionJournal extends BaseModel
class TransactionJournal extends TransactionJournalSupport
{
use SoftDeletes, ValidatingTrait;