for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* (c) Tomasz Kunicki <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Domain\CategoryStructure\UseCase\MoveCategory;
use Domain\CategoryStructure\Structure\Tree\TreeManager;
use Domain\Common\UseCase\ResponderAwareInterface;
use Domain\Common\UseCase\ResponderAwareTrait;
* Class MoveCategoryUseCase
* @package Domain\CategoryStructure\UseCase\MoveCategory
class MoveCategoryUseCase implements ResponderAwareInterface
{
use ResponderAwareTrait;
/** @var TreeManager */
private $treeManager;
* MoveCategoryUseCase constructor.
* @param TreeManager $treeManager
public function __construct(TreeManager $treeManager)
$this->treeManager = $treeManager;
}
* @param MoveCategoryRequest $request
public function execute(MoveCategoryRequest $request)
$child = $request->getChild();
$parent = $request->getNewParent();
$this->treeManager->assignParent($child, $parent);