Amanu
Projektmanagement für Selbstständige und Freelancer
PdfDoc Class Reference

Public Member Functions

 __construct ($type, $id)
 
 streamPreview ()
 
 saveToDisk ()
 

Private Member Functions

 getInfo ()
 
 getItems ()
 
 updateState ($path)
 
 generatePath ()
 
 generateFilename ()
 
 generateHTML ()
 
 calcDueDate ($date)
 

Detailed Description

Represents a PDF Document, for example an offer or an invoice.

This file is part of the project codename "AMANUENSIS"

Author
Sebastian Antosch s.ant.nosp@m.osch.nosp@m.@i-sa.nosp@m.n.de

Constructor & Destructor Documentation

__construct (   $type,
  $id 
)

Constructs a new PDF Doc

Parameters
$type- the document type (e.g. offer, invoice...)
$id- the id of the document

Member Function Documentation

streamPreview ( )

Will stream a preview for this document

saveToDisk ( )

Will render the doc and save it to disk at the proper location

Returns
String - the path the PDF was saved
getInfo ( )
private

Gathers the document info

Returns
array
Exceptions
Exception- if the thing is not found
getItems ( )
private

Gathers the associated items

updateState (   $path)
private

Will update the database state and path of the document

Parameters
$path
generatePath ( )
private

generates desired path and filename for the document, and ensures it is existent

Returns
String
Exceptions
Exception
generateFilename ( )
private

generates an appropriate filename

Returns
String
generateHTML ( )
private

Generates the HTML for the doc

Returns
string
calcDueDate (   $date)
private

Calcs a due date for a date

Parameters
$date- the invoice date
Returns
bool|string

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