MisterBooth (4) [Avatar] Offline
#1
Sorry I'm probably just being thick but the public function fetchByPlaceId() in the class Reviews is not in the book? I've search the ebook and the Errata but nobody has mentioned it.

I only came about it when the Errata mention that the following two lines where missing in Listing 5.8 on page 99:

$reviewsFinder = new Reviews();
$this->view->reviews = $reviewsFinder->fetchByPlaceId($id);

The supplied source code has the function.

Am I missing something perhaps I need more sleep.

Thanks in advance.
apprentice (77) [Avatar] Offline
#2
Re: Missing function fetchByPlaceId()
Let's see if I can manage to answer your question, I'm newbie. It might end up with the blind leading the blind smilie

The file class Reviews extends the Zend_Db_Table component in order to support database manipulation at the table level.
http://pastebin.com/m4ce8d649
You will understand the class Reviews file better when you have finished reading:
Chapter 6: Managing the database

If I'm not mistaken the book isn't written in such a way that it comments and explains every line of code it presents. Only key parts is marked on the side and commented in the text if you have the printed book.
I had an outdated ZFiA ebook once the layout isn't as good as the printed book, maybe that's why you can't see the gist of how to work with this book. Personally I have to jump back and forth a lot in order to understand certain code snippets as I go along.
MisterBooth (4) [Avatar] Offline
#3
Re: Missing function fetchByPlaceId()
Hello apprentice,

Thank you for your reply.

I understand the fetchByPlaceId() method, it was just strange that the method itself is not in the book or the ebook as far as I can see.

I was unaware of the missing method until I checked the errata which mentions a call to the fetchByPlaceId() as stated in my first message. I then went back over the book thinking I had missed something while typing the code, but it wasn't there. I then checked the source code and found it.

Anyway I managed to finish the chapter successfully with the slight confusion.

Yes I find myself jumping back and forth when my mind wanders of the path.
I read chapter 4 about 3 timessmilie

Again thanks for the reply.
noma (5) [Avatar] Offline
#4
Re: Missing function fetchByPlaceId()
Hi, my opinion is that everything cant be in book, cause than book will be to lengthy. Iam at the end of chapter 15 and with the source code its easy to follow everything.
Btw your function really isnt in book, so look to source code for further if you missing something, GL.

Martin
MisterBooth (4) [Avatar] Offline
#5
Re: Missing function fetchByPlaceId()
Hello Martin

Yes I'm planning to look at the code from now on as a reference. It just confused me for a bit thinking I had missed something.
akrabat (479) [Avatar] Offline
#6
Re: Missing function fetchByPlaceId()
Certainly some functionality wasn't in the book as I worried about the length. However, it sounds like I probably should have included that one.

The source code download is certainly worth grabbing and having a look at.


Regards,

Rob...
MisterBooth (4) [Avatar] Offline
#7
Re: Missing function fetchByPlaceId()
No worries Rob

It's good to tax the brain occasionally, The main thing is I'm not going mad...yet.

Regards
Anthony