forked from etsy/411
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReportTarget.php
More file actions
43 lines (38 loc) · 1.17 KB
/
Copy pathReportTarget.php
File metadata and controls
43 lines (38 loc) · 1.17 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
42
43
<?php
namespace FOO;
/**
* Class ReportTarget
* A ReportTarget is an entry in a Report.
* @package FOO
*/
class ReportTarget extends Model {
public static $TABLE = 'report_targets';
public static $PKEY = 'report_target_id';
protected static function generateSchema() {
return [
'report_id' => [static::T_NUM, null, 0],
'search_id' => [static::T_NUM, null, 0],
'position' => [static::T_NUM, null, 0],
];
}
}
/**
* Class ReportTargetFinder
* Finder for ReportTargets.
* @package FOO
* @method static ReportTarget getById(int $id, bool $archived=false)
* @method static ReportTarget[] getAll()
* @method static ReportTarget[] getByQuery(array $query=[], $count=null, $offset=null, $sort=[], $reverse=null)
* @method static ReportTarget[] hydrateModels($objs)
*/
class ReportTargetFinder extends ModelFinder {
public static $MODEL = 'ReportTarget';
/**
* Get ReportTargets for a given Report.
* @param int $id The Report id.
* @return ReportTarget[] An array of ReportTargets.
*/
public static function getByReport($id) {
return self::getByQuery(['report_id' => $id]);
}
}