/** * Image * * Return a URL for the member's image. * * @return string The URL of the member's image. */ public function image() { $is_lord = $this->house(HOUSE_TYPE_LORDS); if ($is_lord) { list($image, $size) = Utility\Member::findMemberImage($this->person_id(), false, 'lord'); } else { list($image, $size) = Utility\Member::findMemberImage($this->person_id(), false, true); } // We can determine if the image exists or not by testing if size is set if ($size !== NULL) { $exists = TRUE; } else { $exists = FALSE; } return array('url' => $image, 'size' => $size, 'exists' => $exists); }
private function addImagesToData($data) { $new_data = array(); foreach ($data as $pid => $details) { list($image, ) = Utility\Member::findMemberImage($pid, true, $this->subs_missing_image); $details['image'] = $image; $new_data[$pid] = $details; } return $new_data; }