mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-22 12:04:00 +00:00
39 lines
768 B
PHP
39 lines
768 B
PHP
![]() |
<?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;
|
||
|
}
|
||
|
}
|