function repo()
{
+ static $cache;
+ if (isset($cache[$this->repo_id])) {
+ return $cache[$this->repo_id];
+ }
$r = DB_DataObject::factory('mtrack_repo');
$r->get($this->repo_id);
+ $cache[$this->repo_id] = $r;
return $r;
}
$start = date('Y-m-d H:i:s', strtotime($notify->act_start . ' - 1 DAY'));
$end = date('Y-m-d H:i:s', strtotime($notify->act_start));
- $object = null;
- $branch = null;
-
- $object = 'branch';
- $branch = $this->name;
- }
+
+ $object = 'branch';
+ $branch = $this->name;
+
//$this->impl()->debug=1;
//print_r(array('since'=> '{'.$start.'}' , 'before' => '{'.$end .'}'));
- $obj = $this->historyToSummary($res, $notify->act_start);
+ $obj = $this->repo()->historyToSummary($res, $notify->act_start);
if (!$obj) {
// echo "History returned nothing";
return true;
$obj->to_dt = $end;
$obj->branch = $br;
//print_r($obj);exit;
-
- $objs[] = $obj;
- }
- $ret = $rcpt->buildMail('repo_daily_changes', array('branches' => $obj));
+
+
+ $ret = $rcpt->buildMail('repo_daily_changes', $obj);
return $ret;