use an array of profiles rather than a looping cursor for profile lists

This commit is contained in:
Evan Prodromou
2011-08-27 12:53:15 -04:00
parent 01fd24ce6a
commit f81c1f7554
4 changed files with 36 additions and 31 deletions

View File

@@ -98,7 +98,7 @@ class Profile extends Managed_DataObject
return $this->_user;
}
protected $_avatars = array();
protected $_avatars;
function getAvatar($width, $height=null)
{
@@ -106,6 +106,10 @@ class Profile extends Managed_DataObject
$height = $width;
}
if (!isset($this->_avatars)) {
$this->_avatars = array();
}
if (array_key_exists($width, $this->_avatars)) {
return $this->_avatars[$width];
}