Forums / Discussions / Understanding and developing fetch functions

Tuesday 14 September 2010 4:41:08 am - 8 replies

» Read full tutorial

Introduction

This tutorial will explain how template fetch functions work and how to develop custom ones. It will also show you how to call them from PHP.

 
Author Message

SEBBANE Alexandre

Wednesday 15 September 2010 6:43:03 am

Cool, you want the award this year or not ?

Paris, France

Romeo Antony

Wednesday 15 September 2010 11:15:34 am

So simple. It can easily understandable even for a newbie.

I appreciate your time and work for this great article.

I have a suggestion ,it would have been a better idea if you could include some cutom fetch example that make some sense

in the php method ,

<span>public</span> <a href="http://www.php.net/static" mce_href="http://www.php.net/static" target="ez_no_documentation"><span>static</span></a> <span>function</span> getMyFetchFunctionResult<span></span>

Romeo Antony

Oman , GCC

Jérôme Vieilledent

Wednesday 15 September 2010 12:10:05 pm

Hi Romeo

I don't really get your suggestion :/...

Could you be more explicit please ?

Romeo Antony

Wednesday 15 September 2010 1:21:27 pm

Thank you for the followup Jerome.

In function , you did like this

$result = array(
'first_key' => 'foo',
'second_key' => 'bar'
)

I know ,It is for simplicity. instead of that, if you show some meaningful custom fetch function operations with parameters could be really helpful .Since this article is fully focusing on extending custom fetch function .

Anyway I really enjoyed this article. This week beginning I have just started on try to develop simple extensions. This article is an additional help for my tries.

Anders Berre

Friday 17 September 2010 2:05:41 am

Nice tutorial, very good work!

I think this is one of my favorite functionallity with eZ Publish. Have made many custom fetches to make things easy! :-)

Sincerely,

Anders Sandvik Berre
http://www.netmaking.no/

André R.

Monday 20 September 2010 3:49:45 am

Nice article, however I don't see the need to have an catch all try block on the "How it works" page. 1. No fetch functions use exceptions, they use null/false normally to indicate issues. 2. pokemon exceptions handling ( "Gotta Catch 'Em All" ) ? :)

As in: basically only use try block if the api your using uses exceptions, and then stricten the match for those exceptions instead of unintentionally catching exceptions your not supposed to handle(that might show up in the future, lets say for mvc exceptions for instance).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jérôme Vieilledent

Thursday 23 September 2010 5:06:24 am

Hi everyone

Thanks for your nice feedback :)

André : Actually, I always use try/catch blocks as I always use exceptions in case of errors. This is just a (nice) habit ;-)

Joël LEGER

Monday 04 October 2010 1:49:42 am

Hi Jérôme,

Clear and neat tutorial ... perfect work.

Joël

You must be logged in to post messages in this topic!