/** * Return the time when the issue was reopened * * @return false if closed, otherwise a timestamp */ public function whenReopened() { if ($this->isClosed()) { return false; } $crit = new \b2db\Criteria(); $crit->addSelectionColumn(tables\Log::TIME); $crit->addWhere(tables\Log::TARGET, $this->_id); $crit->addWhere(tables\Log::TARGET_TYPE, 1); $crit->addWhere(tables\Log::CHANGE_TYPE, 22); $crit->addOrderBy(tables\Log::TIME, 'desc'); $res = tables\Log::getTable()->doSelect($crit); $ret_arr = array(); if (count($res) == 0) { return false; } $row = $res->getNextRow(); return $row->get(tables\Log::TIME); }