Fixing Bpmn::getEvent()

This commit is contained in:
Erik Amaru Ortiz
2014-02-11 17:50:14 -04:00
parent f4bca968b8
commit ea1f82ed3e
4 changed files with 29 additions and 12 deletions

View File

@@ -314,19 +314,15 @@ class Bpmn extends Handler
}
}
public function getEvent($evnUid)
public function getEvent($evnUid, $retType = 'array')
{
if (empty($this->events) || ! array_key_exists($evnUid, $this->activities)) {
$event = EventPeer::retrieveByPK($evnUid);
$event = EventPeer::retrieveByPK($evnUid);
if (! is_object($event)) {
return null;
}
$this->events[$evnUid] = $event;
if ($retType != "object" && ! empty($activity)) {
$event = $event->toArray();
}
return $this->events[$evnUid];
return $event;
}
public function getEvents($start = null, $limit = null, $filter = '', $changeCaseTo = CASE_UPPER)

View File

@@ -17,6 +17,12 @@ class Logger
protected function __construct()
{
$this->logFile = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'processmaker.log';
if (! file_exists($this->logFile)) {
file_put_contents($this->logFile, "");
chmod($this->logFile, 0777);
}
$this->fp = fopen($this->logFile, "a+");
}
@@ -40,8 +46,8 @@ class Logger
fwrite($this->fp, "- " . date('Y-m-d H:i:s') . " " . $arg . PHP_EOL);
}
if (count($args) > 1)
fwrite($this->fp, PHP_EOL);
//if (count($args) > 1)
// fwrite($this->fp, PHP_EOL);
}
public static function log()