-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublic_classlib.php
More file actions
41 lines (34 loc) · 1.02 KB
/
public_classlib.php
File metadata and controls
41 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once 'php-activerecord/ActiveRecord.php';
ActiveRecord\Config::initialize(function($cfg)
{
$cfg->set_model_directory('models');
$cfg->set_connections(array(
'development' => 'mysql://root@localhost/streetlight')
);
//'development' => 'mysql://username:password@localhost/database_name'));
});
class CouncilRequest extends ActiveRecord\Model
{
static $table_name = 'councils';
static $primary_key = 'councilid';
protected $councilId;
function retrieve_CouncilInfo($councilId)
{
//$userInfo = user->find("userid = $userId");
try{
$coucilInfo =& parent::find($councilId);
}
catch(ActiveRecord\RecordNotFound $rnf){
$coucilInfo = array();
}
// retrieves a particular user's information and stores the result into an array.
return $coucilInfo;
}
function get_CouncilName($councilId){
$coucilInfo =& parent::find('name', array('conditions' => "councilid LIKE '$councilId'"));
}
}
$ccl = new CouncilRequest;
print_r($usr->retrieve_CouncilInfo("4"));
?>