-
-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ability for zapier to poll by new ideas and updated ideas
- Loading branch information
1 parent
7521832
commit bdaf783
Showing
2 changed files
with
67 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Leantime\Domain\Ideas\Services { | ||
|
||
use Leantime\Domain\Ideas\Repositories\Ideas as IdeasRepository; | ||
|
||
class Ideas | ||
{ | ||
private IdeasRepository $ideasRepository; | ||
|
||
public function __construct(IdeasRepository $ideasRepository) | ||
{ | ||
$this->ideasRepository = $ideasRepository; | ||
} | ||
|
||
public function pollIdeas(): array | ||
{ | ||
return $this->ideasRepository->getAllIdeas(); | ||
} | ||
|
||
public function pollForUpdatedIdeas(): array | ||
{ | ||
$ideas = $this->ideasRepository->getAllIdeas(); | ||
|
||
foreach ($ideas as $key => $idea) { | ||
$ideas[$key]['id'] = $idea['id'] . '-' . $idea['modified']; | ||
} | ||
|
||
return $ideas; | ||
} | ||
} | ||
} |