Hey all,
Anyone have any idea what im doing wrong here:
$image = new Image();
$image->SetImageConten t($imageRow['imageContent']);
$image->SetFileSize($i mageRow['fileSize']);
$image->SetFileName($i mageRow['fileName']);
$image->SetImageId($im ageRow['imageId']);
$image->SetParentImage Id($imageRow['parentId']);
$image->SetFileType($i mageRow['fileType']);
$image->SetImageHeight ($imageRow['height']);
$image->SetImageWidth( $imageRow['width']);
$image->SetIsThumbnail ($imageRow['isThumb']);
$this->mImages[$this->mImageCount] = $image;
where Image is a custom class and mImages is an array declared as
follows:
$this->mImages = array();
Whats happening is im executing this function
function GetImage($image Index)
{
return $this->mImages[$imageIndex];
}
and then trying to call a member function on the returned value
i.e.
$image = $album->GetImage(1);
$imageId = $image->GetImageId() ;
and im getting this error" Fatal error: Call to a member function on a
non-object in
/home/flyerweb/public_html/ImageManipulato r/POCPages/DisplayAllImage sInAlbum.php
on line 30"
Any idea why i cant add a custom object to an array then pull it back
out and call a method?
Anyone have any idea what im doing wrong here:
$image = new Image();
$image->SetImageConten t($imageRow['imageContent']);
$image->SetFileSize($i mageRow['fileSize']);
$image->SetFileName($i mageRow['fileName']);
$image->SetImageId($im ageRow['imageId']);
$image->SetParentImage Id($imageRow['parentId']);
$image->SetFileType($i mageRow['fileType']);
$image->SetImageHeight ($imageRow['height']);
$image->SetImageWidth( $imageRow['width']);
$image->SetIsThumbnail ($imageRow['isThumb']);
$this->mImages[$this->mImageCount] = $image;
where Image is a custom class and mImages is an array declared as
follows:
$this->mImages = array();
Whats happening is im executing this function
function GetImage($image Index)
{
return $this->mImages[$imageIndex];
}
and then trying to call a member function on the returned value
i.e.
$image = $album->GetImage(1);
$imageId = $image->GetImageId() ;
and im getting this error" Fatal error: Call to a member function on a
non-object in
/home/flyerweb/public_html/ImageManipulato r/POCPages/DisplayAllImage sInAlbum.php
on line 30"
Any idea why i cant add a custom object to an array then pull it back
out and call a method?
Comment