Created
March 31, 2020 17:58
-
-
Save albe/4aa3291cadb648d843a4bf4c05b5ae26 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Vendor\Site\DataSource; | |
use Neos\Flow\Annotations as Flow; | |
use Neos\Flow\Persistence\PersistenceManagerInterface; | |
use Neos\Neos\Domain\Service\UserService; | |
use Neos\Neos\Service\DataSource\AbstractDataSource; | |
use Neos\ContentRepository\Domain\Model\NodeInterface; | |
class MyDataSource extends AbstractDataSource | |
{ | |
/** | |
* @var string | |
*/ | |
static protected $identifier = 'vendor-site-mydata'; | |
/** | |
* @Flow\Inject | |
* @var \Neos\Flow\Http\Client\Browser | |
*/ | |
protected $browser; | |
/** | |
* @param NodeInterface $node The node that is currently edited (optional) | |
* @param array $arguments Additional arguments (key / value) | |
* @return array | |
*/ | |
public function getData(NodeInterface $node = null, array $arguments) | |
{ | |
$response = $this->browser->request('https://your-symfony-service'); | |
return json_decode($response->getBody()->getContents(), true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment