Automation init...3
This commit is contained in:
parent
4eb8d52318
commit
6ad2ecedba
@ -26,7 +26,7 @@ class YamapCrawler extends MyCrawler
|
||||
final protected function getMyStorage()
|
||||
{
|
||||
if ($this->_myStorage === null) {
|
||||
$this->_myStorage = new MangboardStorage($this->_category, $this->_user_entity);
|
||||
$this->_myStorage = new MangboardStorage($this->_category);
|
||||
}
|
||||
return $this->_myStorage;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ class YamoonCrawler extends MyCrawler
|
||||
final protected function getMyStorage()
|
||||
{
|
||||
if ($this->_myStorage === null) {
|
||||
$this->_myStorage = new MangboardStorage($this->_category, $this->_user_entity);
|
||||
$this->_myStorage = new MangboardStorage($this->_category);
|
||||
}
|
||||
return $this->_myStorage;
|
||||
}
|
||||
|
||||
@ -3,38 +3,12 @@
|
||||
namespace App\Libraries\MyStorage;
|
||||
|
||||
use App\Entities\Mangboard\UserEntity;
|
||||
use App\Libraries\Mangboard\Board;
|
||||
use App\Libraries\Mangboard\Boards;
|
||||
use App\Libraries\Mangboard\File;
|
||||
use App\Libraries\Mangboard\Image;
|
||||
|
||||
class MangboardStorage extends FileStorage
|
||||
{
|
||||
private $_boards = null;
|
||||
private $_board = null;
|
||||
private $_file = null;
|
||||
private $_image = null;
|
||||
private $_category = "";
|
||||
private $_user_entity = null;
|
||||
public function __construct(string $category, UserEntity $user_entity)
|
||||
public function __construct(string $path)
|
||||
{
|
||||
parent::__construct($category);
|
||||
$this->_category = $category;
|
||||
$this->_user_entity = $user_entity;
|
||||
}
|
||||
private function getCategory(): string
|
||||
{
|
||||
if ($this->_category == "") {
|
||||
throw new \Exception("저장할 Category가 정의되지 않았습니다.");
|
||||
}
|
||||
return $this->_category;
|
||||
}
|
||||
private function getUserEntity(): UserEntity
|
||||
{
|
||||
if ($this->_user_entity === null) {
|
||||
throw new \Exception("사용자정보가 없습니다.");
|
||||
}
|
||||
return $this->_user_entity;
|
||||
parent::__construct($path);
|
||||
}
|
||||
final public function getBasePath(): string
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user