Paperyard
Public Member Functions | Private Member Functions | List of all members
Paperyard\Controllers\Archive\Confirm Class Reference
Inheritance diagram for Paperyard\Controllers\Archive\Confirm:
Paperyard\Controllers\BasicController

Public Member Functions

 __construct (Twig $view, LoggerInterface $logger, Messages $flash)
 
 __invoke (Request $request, Response $response, $args)
 
 render ()
 
- Public Member Functions inherited from Paperyard\Controllers\BasicController
 getPlugins ()
 
 registerPlugin ($name, $type=PluginType::NORMAL)
 
 getLanguageFlag ()
 

Private Member Functions

 getOutboxFile ()
 
 getInboxFiles ()
 
 getDocumentsFromPattern ($pattern)
 

Additional Inherited Members

- Protected Attributes inherited from Paperyard\Controllers\BasicController
 $view
 
 $logger
 
 $flash
 

Detailed Description

Definition at line 14 of file Confirm.php.

Constructor & Destructor Documentation

Paperyard\Controllers\Archive\Confirm::__construct ( Twig  $view,
LoggerInterface  $logger,
Messages  $flash 
)
Parameters
Twig$view
LoggerInterface$logger
Messages$flash

Definition at line 21 of file Confirm.php.

22  {
23  $this->view = $view;
24  $this->logger = $logger;
25  $this->flash = $flash;
26 
27  $this->registerPlugin('ekko-lightbox.min');
28  $this->registerPlugin('confirm');
29  }
registerPlugin($name, $type=PluginType::NORMAL)

Member Function Documentation

Paperyard\Controllers\Archive\Confirm::__invoke ( Request  $request,
Response  $response,
  $args 
)

Definition at line 31 of file Confirm.php.

32  {
33  $this->view->render($response, 'archive/confirm.twig', $this->render());
34  return $response;
35  }
Paperyard\Controllers\Archive\Confirm::getDocumentsFromPattern (   $pattern)
private

Definition at line 56 of file Confirm.php.

57  {
58  // get files as strings from filesystem
59  $pdfs = glob($pattern, GLOB_NOSORT);
60 
61  // get document information as array
62  array_walk($pdfs, function (&$pdf) {
63  $pdf = (new \Paperyard\Models\Document($pdf))->toArray();
64  });
65 
66  return array_filter($pdfs, function ($pdf) {
67  return !$pdf['isConfirmed'];
68  });
69  }
$pdfs
Paperyard\Controllers\Archive\Confirm::getInboxFiles ( )
private

Definition at line 51 of file Confirm.php.

52  {
53  return $this->getDocumentsFromPattern("/data/inbox/*.pdf");
54  }
Paperyard\Controllers\Archive\Confirm::getOutboxFile ( )
private

Definition at line 46 of file Confirm.php.

47  {
48  return $this->getDocumentsFromPattern("/data/outbox/*.pdf");
49  }
Paperyard\Controllers\Archive\Confirm::render ( )

Definition at line 37 of file Confirm.php.

38  {
39  return array(
40  'plugins' => parent::getPlugins(),
41  'outboxFiles' => $this->getOutboxFile(),
42  'inboxFiles' => $this->getInboxFiles()
43  );
44  }

The documentation for this class was generated from the following file: