-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_model.php
35 lines (31 loc) · 914 Bytes
/
test_model.php
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
<?php
namespace Framework{
require_once('autoloader.php');
$database = new Database(array("type"=>"mysql"
,"options"=>array("host"=>"localhost"
,"username"=>"root"
,"password"=>""
,"schema"=>"prophpmvc"
,"port"=>"3306"
,"charset"=>"UTF8")));
$mysql = $database->initialize();
Registry::set('database',$mysql);
$mysql->sync(new User());
$elijah = new User(array("connector" => $mysql,
"first" => "Chris",
"last" => "Pitt",
"email" => "[email protected]",
"password" => "password",
"notes" => "testtesttest",
"live" => true,
"deleted" => false,
"created" => date("Y-m-d H:i:s"),
"modified" => date("Y-m-d H:i:s")
));
$elijah->save();
$all = User::all(array('last = ?'=>'Pitt'));
echo '<pre>';
print_r($all);
echo '</pre>';
$elijah->delete();
}