mirror of
https://github.com/flarum/core.git
synced 2025-08-02 14:37:49 +02:00
Finalize Flarum\Foundation namespace
This commit is contained in:
40
src/Foundation/ValidationException.php
Normal file
40
src/Foundation/ValidationException.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Foundation;
|
||||
|
||||
use Exception;
|
||||
|
||||
class ValidationException extends Exception
|
||||
{
|
||||
protected $attributes;
|
||||
protected $relationships;
|
||||
|
||||
public function __construct(array $attributes, array $relationships = [])
|
||||
{
|
||||
$this->attributes = $attributes;
|
||||
$this->relationships = $relationships;
|
||||
|
||||
$messages = [implode("\n", $attributes), implode("\n", $relationships)];
|
||||
|
||||
parent::__construct(implode("\n", $messages));
|
||||
}
|
||||
|
||||
public function getAttributes()
|
||||
{
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
public function getRelationships()
|
||||
{
|
||||
return $this->relationships;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user