Skip to content

Instantly share code, notes, and snippets.

@deichbrise
Created August 2, 2016 11:43
Show Gist options
  • Save deichbrise/834ed939c34904ea85c1c81f32a8d131 to your computer and use it in GitHub Desktop.
Save deichbrise/834ed939c34904ea85c1c81f32a8d131 to your computer and use it in GitHub Desktop.
class Machine extends AbstractEntity
{
/**
* pdf
*
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
protected $pdf = null;
/**
* Returns the pdf
*
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf
*/
public function getPdf()
{
return $this->pdf;
}
/**
* Sets the pdf
*
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf
* @return void
*/
public function setPdf(\TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf)
{
$this->pdf = $pdf;
}
}
class RestController extends ActionController {
public function filterSledPositionsAction() {
if($this->request->hasArgument('machine')) {
$machineUid = $this->request->getArgument('machine');
/** @var \Deichbrise\GoeltenbodtProducts\Domain\Model\Machine $machine */
$machine = $this->machineRepository->findByIdentifier($machineUid);
var_dump($machine->getPdf()->getOriginalResource()->getOriginalFile()->getPublicUrl());die();
$this->view->assign('value', $machine->getSledPosition()->toArray());
} else {
$this->view->assign('value', null);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment