|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace StarCitizen\Accounts; |
|
4
|
|
|
|
|
5
|
|
|
use StarCitizen\Base\StarCitizenAbstract; |
|
6
|
|
|
use StarCitizen\Models\Posts; |
|
7
|
|
|
use StarCitizen\Models\Profile; |
|
8
|
|
|
use StarCitizen\Models\Threads; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class Accounts |
|
12
|
|
|
* |
|
13
|
|
|
* @package StarCitizen\Accounts; |
|
14
|
|
|
*/ |
|
15
|
|
|
class Accounts extends StarCitizenAbstract |
|
16
|
|
|
{ |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @var string |
|
20
|
|
|
*/ |
|
21
|
|
|
protected static $system = "accounts"; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* Constants Profile Types |
|
25
|
|
|
*/ |
|
26
|
|
|
const FULL = "full_profile"; |
|
27
|
|
|
const THREADS = "threads"; |
|
28
|
|
|
const POSTS = "posts"; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Model Map |
|
32
|
|
|
*/ |
|
33
|
|
|
const MODELS = [ |
|
34
|
|
|
Accounts::FULL => '\Profile', |
|
35
|
|
|
Accounts::THREADS => '\Threads', |
|
36
|
|
|
Accounts::POSTS => '\Posts', |
|
37
|
|
|
]; |
|
38
|
|
|
|
|
39
|
|
|
const BASEPROFILE = Accounts::FULL; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @param $id |
|
43
|
|
|
* @param bool $cache |
|
44
|
|
|
* @param bool $raw |
|
45
|
|
|
* |
|
46
|
|
|
* @return bool|Profile|string |
|
47
|
|
|
*/ |
|
48
|
|
|
public static function findProfile($id, $cache = false, $raw = false) |
|
49
|
|
|
{ |
|
50
|
|
|
return parent::find($id, Accounts::FULL, $cache, $raw); |
|
|
|
|
|
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @param $id |
|
55
|
|
|
* @param bool $cache |
|
56
|
|
|
* @param bool $raw |
|
57
|
|
|
* |
|
58
|
|
|
* @return bool|Threads|string |
|
59
|
|
|
*/ |
|
60
|
|
|
public static function findThreads($id, $cache = false, $raw = false) |
|
61
|
|
|
{ |
|
62
|
|
|
return parent::find($id, Accounts::THREADS, $cache, $raw); |
|
|
|
|
|
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param $id |
|
67
|
|
|
* @param bool $cache |
|
68
|
|
|
* @param bool $raw |
|
69
|
|
|
* |
|
70
|
|
|
* @return bool|Posts|string |
|
71
|
|
|
*/ |
|
72
|
|
|
public static function findPosts($id, $cache = false, $raw = false) |
|
73
|
|
|
{ |
|
74
|
|
|
return parent::find($id, Accounts::POSTS, $cache, $raw); |
|
|
|
|
|
|
75
|
|
|
} |
|
76
|
|
|
} |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.