Why use variable in model (MVC)?

akari1212

New Member
I'm reading Master Joomla! 1.5 book, and I notice in the Revue model has a function like that\[code\]// modelfunction getRevues() { $db =& $this->_db; if( empty($this->_revues) ) // ????? { $query = $this->_buildQuery(); $limitstart = $this->getState('limitstart'); $limit = $this->getState('limit'); $this->_revues = $this->_getLimit($query, $limitstart, $limit); } return $this->_revues;}// view....revues =& model->getRevues();\[/code\]why use _revues variable in class model? If I remove _revues variable and rewrite getRevues function as follows:\[code\]function getRevues() { $db =& $this->_db; $query = $this->_buildQuery(); $limitstart = $this->getState('limitstart'); $limit = $this->getState('limit'); $revues = $this->_getLimit($query, $limitstart, $limit); return &$revues;}\[/code\]what difference between 2 functions?
 
Back
Top