New exceptions for factories.
This commit is contained in:
parent
1aacdead06
commit
8d29564d18
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Skobkin\Bundle\PointToolsBundle\Service\Exceptions\Factory\Blogs;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Skobkin\Bundle\PointToolsBundle\DTO\Api\Crawler\Post;
|
||||
|
||||
class InvalidPostDataException extends \Exception
|
||||
{
|
||||
/**
|
||||
* @var Post
|
||||
*/
|
||||
private $post;
|
||||
|
||||
public function __construct($message = '', Post $post, $code = 0, Exception $previous = null)
|
||||
{
|
||||
$this->post = $post;
|
||||
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Post
|
||||
*/
|
||||
public function getPost()
|
||||
{
|
||||
return $this->post;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Skobkin\Bundle\PointToolsBundle\Service\Exceptions\Factory;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Skobkin\Bundle\PointToolsBundle\DTO\Api\Crawler\User;
|
||||
|
||||
class InvalidUserDataException extends \Exception
|
||||
{
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
private $user;
|
||||
|
||||
public function __construct($message = "", User $user, $code = 0, Exception $previous = null)
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue