getOne checks for uniqueness, but its perfectly valid to have more than
a single check, do'h!
This commit is contained in:
parent
6e305eb541
commit
ff77046783
@ -69,9 +69,9 @@ class IDF_ProjectActivity extends Pluf_Model
|
||||
{
|
||||
$prj = $this->get_project();
|
||||
$sql = new Pluf_SQL('project=%s', array($prj->id));
|
||||
$latest = Pluf::factory('IDF_ProjectActivity')->getOne(array('filter' => $sql->gen(), 'order' => 'date desc'));
|
||||
if ($prj->current_activity != $latest->id) {
|
||||
$prj->current_activity = $latest;
|
||||
$list = Pluf::factory('IDF_ProjectActivity')->getList(array('filter' => $sql->gen(), 'order' => 'date desc'));
|
||||
if (count($list) > 0 && $prj->current_activity != $list[0]->id) {
|
||||
$prj->current_activity = $list[0];
|
||||
$prj->update();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user