Amanu
Projektmanagement für Selbstständige und Freelancer
cronjob.php File Reference

Functions

 catchAll ($e)
 
 pushEvent ($type, $id, $name, $state)
 
 isPast ($date, $offset=false)
 
 getState ($type, $id)
 
 getLink ($event)
 

Variables

 $start = microtime(true)
 
 $events = array()
 
 $dbal = DBAL::getInstance()
 
 $q
 
 $projectArchived = PROJECT_ARCHIVED
 
 $projectids = $q->fetchAll(PDO::FETCH_ASSOC)
 
foreach($projectids as $projectid) $stream = AmaStream::getInstance()
 
 $x
 

Function Documentation

catchAll (   $e)

This function catches all uncaught Exceptions!

Parameters
Exception$e
pushEvent (   $type,
  $id,
  $name,
  $state 
)

Adds an event to the event array

Parameters
$type- the type of the thing
$id- the id of the thing
$name- the display name
$state- the state of the thing
isPast (   $date,
  $offset = false 
)
Parameters
String$date- a date in format yyy-MM-dd
boolean$offset- if the invoice-due-days offset should be calculated
Returns
boolean
getState (   $type,
  $id 
)

Returns a name of a state

Parameters
$type
$id
getLink (   $event)

Returns a linked name and declaration

Parameters
$event- the event
Returns
string $html

Change project state if necessary

Variable Documentation

$start = microtime(true)
$events = array()
$dbal = DBAL::getInstance()
$q
Initial value:
= $dbal->prepare('
SELECT id FROM projects WHERE state < :archived
')
$dbal
Definition: cronjob.php:149
$projectArchived = PROJECT_ARCHIVED
$projectids = $q->fetchAll(PDO::FETCH_ASSOC)
foreach ($projectids as $projectid) $stream = AmaStream::getInstance()
$x
Initial value:
= $dbal->prepare('
DELETE FROM items
WHERE offer IS NULL
AND contract IS NULL
AND todo IS NULL
AND acceptance IS NULL
AND invoice IS NULL
')
$dbal
Definition: cronjob.php:149