-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
216 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* MSs Class | ||
* | ||
* @package TheyWorkForYou | ||
*/ | ||
|
||
namespace MySociety\TheyWorkForYou\People; | ||
|
||
class MSs extends \MySociety\TheyWorkForYou\People { | ||
|
||
public $type = 'mss'; | ||
public $rep_name = 'MS'; | ||
public $rep_plural = 'MSs'; | ||
public $house = HOUSE_TYPE_WALES; | ||
public $cons_type = 'WAC'; | ||
public $reg_cons_type = 'WAE'; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
include_once INCLUDESPATH . 'easyparliament/member.php'; | ||
include_once dirname(__FILE__) . '/api_getPerson.php'; | ||
|
||
function api_getMS_front() { | ||
?> | ||
<p><big>Fetch a particular MS.</big></p> | ||
|
||
<h4>Arguments</h4> | ||
<dl> | ||
<dt>postcode (optional)</dt> | ||
<dd>Fetch the MSs for a particular postcode.</dd> | ||
<dt>constituency (optional)</dt> | ||
<dd>The name of a constituency.</dd> | ||
<dt>id (optional)</dt> | ||
<dd>If you know the person ID for the member you want (returned from getMSs or elsewhere), this will return data for that person.</dd> | ||
|
||
<dt>always_return (optional)</dt> | ||
<dd>For the postcode and constituency options, sets whether to always try and | ||
return an MS (due to e.g. the period before an election when there are no | ||
MSs).</dd> | ||
|
||
</dl> | ||
|
||
<h4>Example Response</h4> | ||
<pre><twfy> | ||
</twfy> | ||
</pre> | ||
|
||
<?php | ||
} | ||
|
||
function api_getMS_id($id) { | ||
return api_getPerson_id($id, HOUSE_TYPE_WALES); | ||
} | ||
|
||
function api_getMS_postcode($pc) { | ||
api_getPerson_postcode($pc, HOUSE_TYPE_WALES); | ||
} | ||
|
||
function api_getMS_constituency($constituency) { | ||
api_getPerson_constituency($constituency, HOUSE_TYPE_WALES); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
include_once dirname(__FILE__) . '/api_getMembers.php'; | ||
|
||
function api_getMSs_front() { | ||
?> | ||
<p><big>Fetch a list of MSs.</big></p> | ||
|
||
<h4>Arguments</h4> | ||
<dl> | ||
<dt>date (optional)</dt> | ||
<dd>Fetch the list of MSs as it was on this date.</dd> | ||
<dt>party (optional)</dt> | ||
<dd>Fetch the list of MSs from the given party.</dd> | ||
<dt>search (optional)</dt> | ||
<dd>Fetch the list of MSs that match this search string in their name.</dd> | ||
</dl> | ||
|
||
<h4>Example Response, serialised PHP</h4> | ||
<pre>a:646:{ | ||
i:0; a:5:{ | ||
s:9:"member_id"; s:4:"1368"; | ||
s:9:"person_id"; s:5:"10900"; | ||
s:4:"name"; s:13:"Hywel Francis"; | ||
s:5:"party"; s:6:"Labour"; | ||
s:12:"constituency"; s:8:"Aberavon"; | ||
} | ||
i:1; ... | ||
</pre> | ||
|
||
<?php | ||
} | ||
|
||
/* See api_getMembers.php for these shared functions */ | ||
function api_getMSs_party($s) { | ||
api_getMembers_party(HOUSE_TYPE_WALES, $s); | ||
} | ||
function api_getMSs_search($s) { | ||
api_getMembers_search(HOUSE_TYPE_WALES, $s); | ||
} | ||
function api_getMSs_date($date) { | ||
api_getMembers_date(HOUSE_TYPE_WALES, $date); | ||
} | ||
function api_getMSs($date = 'now()') { | ||
api_getMembers(HOUSE_TYPE_WALES, $date); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.