本文整理汇总了PHP中MEMBER::load_extra_info方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::load_extra_info方法的具体用法?PHP MEMBER::load_extra_info怎么用?PHP MEMBER::load_extra_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MEMBER
的用法示例。
在下文中一共展示了MEMBER::load_extra_info方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MEMBER
# Compile data for MP page in Google gadget
# XXX Lots here copied from elsewhere... Damn you deadlines.
include_once 'min-init.php';
include_once INCLUDESPATH . 'easyparliament/member.php';
include_once '../api/api_functions.php';
$pid = $_GET['pid'];
if (!$pid) {
print '<error>No ID</error>';
exit;
}
$member = new MEMBER(array('person_id' => $pid));
if (!$member->valid) {
print '<error>Unknown ID</error>';
exit;
}
$member->load_extra_info();
$row = array('person_id' => $pid, 'full_name' => $member->full_name(), 'constituency' => $member->constituency(), 'party' => $member->party_text(), 'majority_in_seat' => number_format($member->extra_info['majority_in_seat']), 'swing_to_lose_seat_today' => number_format($member->extra_info['swing_to_lose_seat_today']));
list($image, $sz) = find_rep_image($pid, true);
if ($image) {
$row['image'] = $image;
}
foreach ($member->extra_info['office'] as $office) {
if ($office['to_date'] == '9999-12-31' && $office['source'] == 'chgpages/selctee') {
$row['selctee'][] = prettify_office($office['position'], $office['dept']);
}
}
$none = false;
$output = array();
$pw_keys = array_filter(array_keys($member->extra_info), create_function('$a', '
if (substr($a, 0, 11) != "public_whip") return false;
if (substr($a, -7) == "_absent") return false;
示例2: load_member
function load_member($pid)
{
$member = new MEMBER(array('person_id' => $pid));
if (!$member->valid) {
output_error('Unknown ID');
}
$member->load_extra_info();
return $member;
}
示例3: load_member
function load_member($pid) {
$member = new MEMBER(array('guardian_aristotle_id' => $pid));
if (!$member->valid) output_error('Unknown ID');
$member->load_extra_info();
return $member;
}
示例4: testLoadExtraInfo
/**
* Test loading extra info
*
* @todo Implement testing of the Public Whip info loading
*/
public function testLoadExtraInfo()
{
$MEMBER = new MEMBER(array('person_id' => 16));
$MEMBER->load_extra_info();
// Have we correctly loaded the office?
$this->assertEquals(1, $MEMBER->extra_info['office'][0]['moffice_id']);
// Have we correctly loaded the member arbitrary key/value pair?
$this->assertEquals('Test Member Value', $MEMBER->extra_info['test_member_key']);
// Have we correctly loaded the person arbitrary key/value pair?
$this->assertEquals('Test Person Value', $MEMBER->extra_info['test_person_key']);
// Have we correctly loaded the constituency arbitrary key/value pair?
$this->assertEquals('Test Constituency Value', $MEMBER->extra_info['test_constituency_key']);
// Have we correctly loaded the PBC membership?
$this->assertEquals(array('title' => 'Test Bill', 'session' => '2013-14', 'attending' => 1, 'chairman' => 1, 'outof' => 0), $MEMBER->extra_info['pbc'][1]);
}