Object constructors shouldn't require an id if passed a $oRow object. Gets rid of
objectGetInstanceFromRow() since we can pass the row into the constructor instead.
This commit is contained in:
committed by
WineHQ
parent
d0022decd4
commit
f7b24fab9a
@@ -27,36 +27,36 @@ class testData{
|
||||
function testData($iTestingId = null, $oRow = null)
|
||||
{
|
||||
// we are working on an existing test
|
||||
if($iTestingId)
|
||||
{
|
||||
// We fetch the data related to this test.
|
||||
if(!$oRow)
|
||||
{
|
||||
$sQuery = "SELECT *
|
||||
FROM testResults
|
||||
WHERE testingId = '?'";
|
||||
if($hResult = query_parameters($sQuery, $iTestingId))
|
||||
$oRow = mysql_fetch_object($hResult);
|
||||
}
|
||||
if(!$iTestingId && !$oRow)
|
||||
return;
|
||||
|
||||
if($oRow)
|
||||
{
|
||||
$this->iTestingId = $oRow->testingId;
|
||||
$this->iVersionId = $oRow->versionId;
|
||||
$this->shWhatWorks = $oRow->whatWorks;
|
||||
$this->shWhatDoesnt = $oRow->whatDoesnt;
|
||||
$this->shWhatNotTested = $oRow->whatNotTested;
|
||||
$this->sTestedDate = $oRow->testedDate;
|
||||
$this->iDistributionId = $oRow->distributionId;
|
||||
$this->sTestedRelease = $oRow->testedRelease;
|
||||
$this->sInstalls = $oRow->installs;
|
||||
$this->sRuns = $oRow->runs;
|
||||
$this->sTestedRating = $oRow->testedRating;
|
||||
$this->sComments = $oRow->comments;
|
||||
$this->sSubmitTime = $oRow->submitTime;
|
||||
$this->iSubmitterId = $oRow->submitterId;
|
||||
$this->sQueued = $oRow->queued;
|
||||
}
|
||||
// We fetch the data related to this test.
|
||||
if(!$oRow)
|
||||
{
|
||||
$sQuery = "SELECT *
|
||||
FROM testResults
|
||||
WHERE testingId = '?'";
|
||||
if($hResult = query_parameters($sQuery, $iTestingId))
|
||||
$oRow = mysql_fetch_object($hResult);
|
||||
}
|
||||
|
||||
if($oRow)
|
||||
{
|
||||
$this->iTestingId = $oRow->testingId;
|
||||
$this->iVersionId = $oRow->versionId;
|
||||
$this->shWhatWorks = $oRow->whatWorks;
|
||||
$this->shWhatDoesnt = $oRow->whatDoesnt;
|
||||
$this->shWhatNotTested = $oRow->whatNotTested;
|
||||
$this->sTestedDate = $oRow->testedDate;
|
||||
$this->iDistributionId = $oRow->distributionId;
|
||||
$this->sTestedRelease = $oRow->testedRelease;
|
||||
$this->sInstalls = $oRow->installs;
|
||||
$this->sRuns = $oRow->runs;
|
||||
$this->sTestedRating = $oRow->testedRating;
|
||||
$this->sComments = $oRow->comments;
|
||||
$this->sSubmitTime = $oRow->submitTime;
|
||||
$this->iSubmitterId = $oRow->submitterId;
|
||||
$this->sQueued = $oRow->queued;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,7 +552,8 @@ class testData{
|
||||
if(!$hResult)
|
||||
return 0;
|
||||
|
||||
$oRow = mysql_fetch_object($hResult);
|
||||
if(!$oRow = mysql_fetch_object($hResult))
|
||||
return 0;
|
||||
|
||||
return $oRow->testingId;
|
||||
}
|
||||
@@ -902,11 +903,6 @@ class testData{
|
||||
return $aCells;
|
||||
}
|
||||
|
||||
function objectGetInstanceFromRow($oRow)
|
||||
{
|
||||
return new testData($oRow->testingId, $oRow);
|
||||
}
|
||||
|
||||
function objectOutputTableRow($oObject, $sClass, $sEditLinkLabel)
|
||||
{
|
||||
$oVersion = new version($this->iVersionId);
|
||||
|
||||
Reference in New Issue
Block a user