-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmployer.php
55 lines (48 loc) · 1 KB
/
Employer.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Employer Model [ActiveRecord]
*
* Created: November 5, 2021
*
* @package: Ovia Incentives Management
* @author: Kevin Carwile
* @since: 1.0.0
*/
namespace Ovia\Incentives\Models;
if ( ! defined( 'ABSPATH' ) ) {
die( 'Access denied.' );
}
use MWP\Framework\Pattern\ActiveRecord;
/**
* Employer Class
*/
class _Employer extends ActiveRecord
{
/**
* @var array Multitons cache (needs to be defined in subclasses also)
*/
protected static $multitons = array();
/**
* @var string Table name
*/
protected static $table = 'incentives_employer';
/**
* @var array Table columns
*/
protected static $columns = array(
'id',
'title' => [ 'type' => 'varchar', 'length' => 255 ],
);
/**
* @var string Table primary key
*/
protected static $key = 'id';
/**
* Get the active programs for this employer
*
* @return array[EmployerProgram]
*/
public function getActivePrograms() {
return EmployerProgram::loadWhere([ 'employer_id = %d', $this->id() ]);
}
}