Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Task Creation scenario implemented
- Loading branch information
Alexander Kupreev
committed
May 30, 2014
1 parent
0e233d6
commit 0f80973be9579424ebb76157d681b39ae988293d
Showing
6 changed files
with
96 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,46 @@ | ||
<?php | ||
|
||
namespace app\interactor; | ||
namespace app\interactor\Task; | ||
|
||
use app\entity as Entity; | ||
use app\repository as Repo; | ||
use app\service as Service; | ||
|
||
/** | ||
* Task Creation Interactor | ||
*/ | ||
class Creation | ||
{ | ||
public function __construct(Repo\Task $taskRepo) | ||
/** | ||
* | ||
* @var Repo\TaskInterface | ||
*/ | ||
protected $taskRepo; | ||
|
||
/** | ||
* | ||
* @var Repo\UserInterface | ||
*/ | ||
protected $userRepo; | ||
|
||
/** | ||
* | ||
* @var Service\SessionInterface | ||
*/ | ||
protected $session; | ||
|
||
public function __construct(Repo\TaskInterface $taskRepo, Repo\UserInterface $userRepo, Service\SessionInterface $session) | ||
{ | ||
|
||
$this->taskRepo = $taskRepo; | ||
$this->userRepo = $userRepo; | ||
$this->session = $session; | ||
} | ||
|
||
public function execute($params = []) | ||
public function execute($data = []) | ||
{ | ||
|
||
$data['userId'] = $this->session->getLoggedInUserId(); | ||
$this->taskRepo->create($data); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace app\interactor; | ||
namespace app\interactor\User; | ||
|
||
use app\entity as Entity; | ||
use app\repository as Repo; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters