<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fetching eZ Publish User Objects with PHP: Part One</title>
	<atom:link href="http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/feed" rel="self" type="application/rss+xml" />
	<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1</link>
	<description>Tech blog of David Linnard</description>
	<lastBuildDate>Tue, 09 Nov 2010 20:50:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Fetching eZ Publish User Objects with PHP: Part Two &#171; One Quarter English &#124; Tech Blog</title>
		<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/comment-page-1#comment-1250</link>
		<dc:creator>Fetching eZ Publish User Objects with PHP: Part Two &#171; One Quarter English &#124; Tech Blog</dc:creator>
		<pubDate>Tue, 09 Nov 2010 20:50:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.onequarterenglish.co.uk/?p=163#comment-1250</guid>
		<description>[...] Fetching eZ Publish User Objects with PHP: Part One [...]</description>
		<content:encoded><![CDATA[<p>[...] Fetching eZ Publish User Objects with PHP: Part One [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Extended Attribute Filters in eZ Publish &#171; One Quarter English &#124; Tech Blog</title>
		<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/comment-page-1#comment-1248</link>
		<dc:creator>Extended Attribute Filters in eZ Publish &#171; One Quarter English &#124; Tech Blog</dc:creator>
		<pubDate>Tue, 09 Nov 2010 20:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.onequarterenglish.co.uk/?p=163#comment-1248</guid>
		<description>[...] Fetching eZ Publish User Objects with PHP: Part One [...]</description>
		<content:encoded><![CDATA[<p>[...] Fetching eZ Publish User Objects with PHP: Part One [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/comment-page-1#comment-157</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 20 Jun 2010 08:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.onequarterenglish.co.uk/?p=163#comment-157</guid>
		<description>Hey Gaetano, Thanks, that makes sense. I wasn&#039;t aware of the extension you mentioned. One of my previous posts showed a quick way of creating a blank page layout for XML based content but this extension looks a much better way of dealing with it in a lot of situations. Thanks again, David</description>
		<content:encoded><![CDATA[<p>Hey Gaetano, Thanks, that makes sense. I wasn&#8217;t aware of the extension you mentioned. One of my previous posts showed a quick way of creating a blank page layout for XML based content but this extension looks a much better way of dealing with it in a lot of situations. Thanks again, David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaetano</title>
		<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/comment-page-1#comment-155</link>
		<dc:creator>Gaetano</dc:creator>
		<pubDate>Fri, 18 Jun 2010 08:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.onequarterenglish.co.uk/?p=163#comment-155</guid>
		<description>&quot;why the attributes are available as public when they shouldn’t be accessed in this way&quot;

I guess it has to do with historical reasons - eZP was developed in a time when private/protected did not exist in php.

In the end it is more a matter of style (or philosophy): using $obj-&gt;attribute(&#039;xxx&#039;) and $obj-&gt;setattribute(&#039;xxx&#039;, &#039;val&#039;) is more verbose but:
- it matches more closely the way the objects are accessed in templates (ie. every property of an object that is available in template code you can access in php code via attribute() calls)
- it matches more closely the &quot;property&quot; pattern that was intended in the beginning by the developers (some of those calls to attribute() will access actual object members, some will access functions, so if you access members directly it means you either have checked that they are members and not functions and that your code will break in the future if the object definition is changed - unlikely but possible)

As a side note: an interesting projects (on projects.ez.no) to help you extracting data from ezpersitsentobjects: ggxmlview.
It allows to
- map ezpo to json or xml using templates
- map ezpo to a plain php array using a single php call
(of course recursion is considered)</description>
		<content:encoded><![CDATA[<p>&#8220;why the attributes are available as public when they shouldn’t be accessed in this way&#8221;</p>
<p>I guess it has to do with historical reasons &#8211; eZP was developed in a time when private/protected did not exist in php.</p>
<p>In the end it is more a matter of style (or philosophy): using $obj-&gt;attribute(&#8216;xxx&#8217;) and $obj-&gt;setattribute(&#8216;xxx&#8217;, &#8216;val&#8217;) is more verbose but:<br />
- it matches more closely the way the objects are accessed in templates (ie. every property of an object that is available in template code you can access in php code via attribute() calls)<br />
- it matches more closely the &#8220;property&#8221; pattern that was intended in the beginning by the developers (some of those calls to attribute() will access actual object members, some will access functions, so if you access members directly it means you either have checked that they are members and not functions and that your code will break in the future if the object definition is changed &#8211; unlikely but possible)</p>
<p>As a side note: an interesting projects (on projects.ez.no) to help you extracting data from ezpersitsentobjects: ggxmlview.<br />
It allows to<br />
- map ezpo to json or xml using templates<br />
- map ezpo to a plain php array using a single php call<br />
(of course recursion is considered)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/comment-page-1#comment-154</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 15 Jun 2010 20:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.onequarterenglish.co.uk/?p=163#comment-154</guid>
		<description>Hi Jérôme, thanks for the advice, I&#039;ll be sure to make a note of that. Can I check why the attributes are available as public when they shouldn&#039;t be accessed in this way? I would of thought they should be marked as private. Also, I guess I prefer the ease of use you get when you do it as I have done rather than using a bespoke function. Do you know whether the attribute() method will be converted to a standard PHP5 __get function at some point?</description>
		<content:encoded><![CDATA[<p>Hi Jérôme, thanks for the advice, I&#8217;ll be sure to make a note of that. Can I check why the attributes are available as public when they shouldn&#8217;t be accessed in this way? I would of thought they should be marked as private. Also, I guess I prefer the ease of use you get when you do it as I have done rather than using a bespoke function. Do you know whether the attribute() method will be converted to a standard PHP5 __get function at some point?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jérôme Vieilledent</title>
		<link>http://www.onequarterenglish.co.uk/fetching-ez-publish-user-objects-with-php-part-1/comment-page-1#comment-150</link>
		<dc:creator>Jérôme Vieilledent</dc:creator>
		<pubDate>Wed, 09 Jun 2010 08:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.onequarterenglish.co.uk/?p=163#comment-150</guid>
		<description>Hi

Excellent and useful.
Just a quick note : It&#039;s a bad practice to access data directly from properties (Username: $user-&gt;Login). You should always use the attribute() accessor when your object is extending eZPersistentObject (Username: $user-&gt;attribute(&#039;login&#039;).
See eZUser::definition() to list all attributes available with this method (see &quot;fields&quot; and &quot;function_attributes&quot;

Cheers !</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Excellent and useful.<br />
Just a quick note : It&#8217;s a bad practice to access data directly from properties (Username: $user-&gt;Login). You should always use the attribute() accessor when your object is extending eZPersistentObject (Username: $user-&gt;attribute(&#8216;login&#8217;).<br />
See eZUser::definition() to list all attributes available with this method (see &#8220;fields&#8221; and &#8220;function_attributes&#8221;</p>
<p>Cheers !</p>
]]></content:encoded>
	</item>
</channel>
</rss>

