-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.php
More file actions
37 lines (31 loc) · 1.27 KB
/
User.php
File metadata and controls
37 lines (31 loc) · 1.27 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
<?php
namespace Syntax\Core;
class User_Preference_User extends \BaseModel
{
/********************************************************************
* Declarations
*******************************************************************/
/**
* Table declaration
*
* @var string $table The table this model uses
*/
protected $table = 'preferences_users';
/********************************************************************
* Relationships
*******************************************************************/
public static $relationsData = array(
'user' => array('belongsTo', 'User', 'foreignKey' => 'user_id'),
'preference' => array('belongsTo', 'User_Preference', 'foreignKey' => 'preference_id'),
);
/********************************************************************
* Getter and Setter methods
*******************************************************************/
/********************************************************************
* Extra Methods
*******************************************************************/
public function validateValue()
{
return (preg_match('/'. $this->preference->value .'/', $this->value) == 1 ? true : false);
}
}