- initialize arrays to avoid error messages when arrays are empty

- use correct $this->array and not $array in application class
This commit is contained in:
Jonathan Ernst
2005-02-09 23:53:25 +00:00
committed by WineHQ
parent b79965941d
commit b516f4a78f
2 changed files with 6 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ class Application {
AND appFamily.appId = ".$iAppId; AND appFamily.appId = ".$iAppId;
if($hResult = query_appdb($sQuery)) if($hResult = query_appdb($sQuery))
{ {
$this->aVersionsIds = array();
while($oRow = mysql_fetch_object($hResult)) while($oRow = mysql_fetch_object($hResult))
{ {
if(!$this->iAppId) if(!$this->iAppId)
@@ -205,7 +206,7 @@ class Application {
LIMIT 1"; LIMIT 1";
if($hResult = query_appdb($sQuery)) if($hResult = query_appdb($sQuery))
{ {
foreach($aVersionsIds as $iVersionId) foreach($this->aVersionsIds as $iVersionId)
{ {
$oVersion = new Version($iVersionId); $oVersion = new Version($iVersionId);
$oVersion->delete($bSilent); $oVersion->delete($bSilent);

View File

@@ -60,6 +60,7 @@ class Version {
/* /*
* We fetch notesIds. * We fetch notesIds.
*/ */
$this->aNotesIds = array();
$sQuery = "SELECT noteId $sQuery = "SELECT noteId
FROM appNotes FROM appNotes
WHERE versionId = ".$iVersionId; WHERE versionId = ".$iVersionId;
@@ -89,6 +90,8 @@ class Version {
/* /*
* We fetch screenshotsIds and urlsIds. * We fetch screenshotsIds and urlsIds.
*/ */
$this->aScreenshotsIds = array();
$this->aUrlsIds = array();
$sQuery = "SELECT id, type $sQuery = "SELECT id, type
FROM appData FROM appData
WHERE versionId = ".$iVersionId; WHERE versionId = ".$iVersionId;
@@ -100,7 +103,7 @@ class Version {
if($oRow->type="image") if($oRow->type="image")
$this->aScreenshotsIds[] = $oRow->id; $this->aScreenshotsIds[] = $oRow->id;
else else
$this->aNotesIds[] = $oRow->id; $this->aUrlsIds[] = $oRow->id;
} }
} }
} }