Последняя версия с сервера прошлого разработчика
This commit is contained in:
29
app/Domain/Feeds/Action/CreateFeedAction.php
Executable file
29
app/Domain/Feeds/Action/CreateFeedAction.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace App\Domain\Feeds\Action;
|
||||
|
||||
use App\Domain\Feeds\ToFeedAction;
|
||||
use App\Domain\Tags\Action\CreateTagAction;
|
||||
|
||||
class CreateFeedAction
|
||||
{
|
||||
public $tooFeedAction;
|
||||
public $tagAction;
|
||||
|
||||
|
||||
public function __construct(ToFeedAction $tooFeedAction, CreateTagAction $tagAction)
|
||||
{
|
||||
$this->tooFeedAction = $tooFeedAction;
|
||||
$this->tagAction = $tagAction;
|
||||
}
|
||||
|
||||
public function __invoke($dataFeed)
|
||||
{
|
||||
|
||||
$feed = ($this->tooFeedAction)($dataFeed);
|
||||
|
||||
if(count($dataFeed->tags)){
|
||||
$idsTag = ($this->tagAction)($dataFeed->tags);
|
||||
$feed->tags()->sync($idsTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user