Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-ALPHA2
-
Fix Version/s: 1.2.0-ALPHA3
-
Component/s: Geographical
-
Labels:None
Description
With the current code, the return data is outside the method's documentation for @return and there will be a notice from PHP about $result being undefined.
Fixed with the following patch.
public function nextId($seqName, $onDemand = true) { $sequenceName = $this->conn->quoteIdentifier($this->conn->formatter->getSequenceName($seqName), true); $query = "SELECT NEXTVAL('" . $sequenceName . "')"; try { $result = (int) $this->conn->fetchOne($query); } catch(Doctrine_Connection_Exception $e) { if ($onDemand && $e->getPortableCode() == Doctrine::ERR_NOSUCHTABLE) { try { $result = $this->conn->export->createSequence($seqName); } catch(Doctrine_Exception $e) { throw new Doctrine_Sequence_Exception('on demand sequence ' . $seqName . ' could not be created'); } return $this->nextId($seqName, false); + } else { + throw new Doctrine_Sequence_Exception('sequence ' .$seqName . ' does not exist'); } } return $result; }
Issue fixed for 1.2 =)