blob: 398b0b697a544fc0e3e30d3abb70e6c8612eb4c9 (
plain)
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
42
43
44
45
46
47
|
<?php
class ItemRecord extends TActiveRecord
{
const TABLE='items';
public $item_id;
public $name;
public $brand_specific;
public $description;
public $meta;
public $active;
public $need_review;
public $category_id;
public $type_id;
public $content;
public $standard_id;
public $timestamp;
public $related_items = array();
public $related_item_id;
public static $RELATIONS=array
(
'related_items' => array(self::MANY_TO_MANY, 'ItemRecord', 'related_items.related_item_id'),
);
public function getDbConnection()
{
static $conn;
if($conn===null)
{
$conn = new TDbConnection('mysql:host=localhost;dbname=prado_unitest', 'prado_unitest','prado_unitest');
$this->OnExecuteCommand[] = array($this,'logger');
}
return $conn;
}
public function logger($sender,$param)
{
//var_dump($param->Command->Text);
}
public static function finder($className=__CLASS__)
{
return parent::finder($className);
}
}
|