Fixing Bpmn::getEvent()
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user