Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1
This is the forum to discuss the Wrox book Professional PHP5 by Ed Lecky-Thompson, Heow Eide-Goodman, Steven D. Nowicki, Alec Cove; ISBN: 9780764572821
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 24th, 2005, 09:44 AM
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Collection Class chapter 5

Hi everyone,

Just a quick message about the Nightclub example in chapter 5. Using the code specified in the book, php throws the error:

Fatal error: Call to private method NightClub::_loadSingers() from context 'Collection' in d:\web\book\ch05\class.Collection.php on line 91

To fix this, change the _loadSingers function from private to public in the NightClub class (ie public function _loadSingers(Collection $col))

Ed

  #2 (permalink)  
Old November 27th, 2006, 04:46 PM
Authorized User
 
Join Date: Jan 2004
Location: Des Moines, IA, USA.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the same error in the code on page 119:

To fix this, change the _loadCourses function from private to public.

I notice the code I downloaded has the correction for the _loadSingers function but the _loadCourses example is just like it is printed in the book and doesn't run correctly.

Carl Olsen
www.carl-olsen.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to build class structure for collection output jimusa Visual Basic 2005 Basics 3 August 7th, 2008 04:49 PM
return collection by function in class jimusa Visual Basic 2005 Basics 1 July 30th, 2008 03:18 PM
function return collection in class by VB jimusa Visual Studio 2005 1 July 30th, 2008 03:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.