pokeb / php-mvc-router

Lightweight Rails-style MVC router for PHP

This URL has Read+Write access

php-mvc-router / models / friend.php
100644 22 lines (17 sloc) 0.522 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
 
/*
This is an example object that takes two parameters in the constructor
This might be typical if this class maps a database table with a composite key
*/
 
class friend extends model {
 
public $user = "";
public $friend = "";
 
function __construct($user="",$other_user="") {
//Normally you'd connect to the database to fetch the object's properties here
if ($user != "" && $other_user != "") {
$this->user = $user;
$this->friend = $other_user;
$this->is_valid = true;
}
}
 
}