<?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: Which Model Should Contain That Method?</title>
	<atom:link href="/2010/07/28/which-model-should-contain-that-method/feed/" rel="self" type="application/rss+xml" />
	<link>/2010/07/28/which-model-should-contain-that-method/</link>
	<description>on web development</description>
	<lastBuildDate>Fri, 26 Oct 2018 21:40:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>By: Lukas</title>
		<link>/2010/07/28/which-model-should-contain-that-method/comment-page-1/#comment-13294</link>
		<dc:creator><![CDATA[Lukas]]></dc:creator>
		<pubDate>Thu, 29 Jul 2010 14:11:56 +0000</pubDate>
		<guid isPermaLink="false">/?p=1866#comment-13294</guid>
		<description><![CDATA[Hey there,

I just wanted to throw in that from my logical understanding it would be better to implement that method on User instead of Article. Why?

Usually you have your User object which can deliver a set of Articles belonging to it. So you could simply do $user-&#062;getArticles(); - the other way round would require you to 

a) use the table class i.e. ArticleS not ArticlE and 
b) passing a parameter to the method -  $articles-&#062;getUserArticles($userId).

When working with a somewhat domain-driven model, you should imo really not care which table is being queried when designing your models]]></description>
		<content:encoded><![CDATA[<p>Hey there,</p>
<p>I just wanted to throw in that from my logical understanding it would be better to implement that method on User instead of Article. Why?</p>
<p>Usually you have your User object which can deliver a set of Articles belonging to it. So you could simply do $user-&gt;getArticles(); &#8211; the other way round would require you to </p>
<p>a) use the table class i.e. ArticleS not ArticlE and<br />
b) passing a parameter to the method &#8211;  $articles-&gt;getUserArticles($userId).</p>
<p>When working with a somewhat domain-driven model, you should imo really not care which table is being queried when designing your models</p>
]]></content:encoded>
	</item>
</channel>
</rss>
