I'm reading Master Joomla! 1.5 book, and I notice in the Revue model has a function like that
// model
function 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();
why use _revues variable in class model? If I remove _revues variable and rewrite getRevues function as follows:
function getRevues() {
$db =& $this->_db;
$query = $this->_buildQuery();
$limitstart = $this->getState('limitstart');
$limit = $this->getState('limit');
$revues = $this->_getLimit($query, $limitstart, $limit);
return &$revues;
}
what difference between 2 functions?