|
|
|
@ -29,16 +29,11 @@ class People {
|
|
|
|
|
|
|
|
|
|
|
|
return self::find();
|
|
|
|
return self::find();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static function delete($index){
|
|
|
|
static function delete($id){
|
|
|
|
$people = array();
|
|
|
|
$query = file_get_contents(__DIR__ . '/../database/sql/delete.sql');
|
|
|
|
$people[] = new Person('joni', 52);
|
|
|
|
$result = pg_query_params($query, array($id));
|
|
|
|
$people[] = new Person('bob', 34);
|
|
|
|
|
|
|
|
$people[] = new Person('sally', 21);
|
|
|
|
|
|
|
|
$people[] = new Person('matt', 37);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
array_splice($people, $index, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $people;
|
|
|
|
return self::find();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static function update($index, $updatedPerson){
|
|
|
|
static function update($index, $updatedPerson){
|
|
|
|
$people = array();
|
|
|
|
$people = array();
|
|
|
|
|