Many updates to get split transactions and normal transactions working side by side.

This commit is contained in:
James Cole
2016-10-21 19:06:22 +02:00
parent 801c7c0ab6
commit 9a3cd27700
25 changed files with 960 additions and 435 deletions

View File

@@ -124,6 +124,28 @@ class FireflyValidator extends Validator
return (intval($checksum) === 1);
}
/**
* @param $attribute
* @param $value
* @param $parameters
*
* @return bool
*/
public function validateMustExist($attribute, $value, $parameters): bool
{
$field = $parameters[1] ?? 'id';
if (intval($value) === 0) {
return true;
}
$count = DB::table($parameters[0])->where($field, $value)->count();
if ($count === 1) {
return true;
}
return false;
}
/**
* @param $attribute
*