Posted by Areric on 05/07/06 23:46
Hey all,
Anyone have any idea what im doing wrong here:
$image = new Image();
$image->SetImageContent($imageRow['imageContent']);
$image->SetFileSize($imageRow['fileSize']);
$image->SetFileName($imageRow['fileName']);
$image->SetImageId($imageRow['imageId']);
$image->SetParentImageId($imageRow['parentId']);
$image->SetFileType($imageRow['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($imageIndex)
{
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/ImageManipulator/POCPages/DisplayAllImagesInAlbum.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?
[Back to original message]
|