1 | <?php |
||
20 | class V2UnitModel extends \Entity\KeyedModel { |
||
21 | /** |
||
22 | * Name of table for this entity |
||
23 | * |
||
24 | * @var string $tableName |
||
25 | */ |
||
26 | protected $tableName = 'unit'; |
||
27 | /** |
||
28 | * Name of key field field in this table |
||
29 | * |
||
30 | * @var string $idFieldName |
||
31 | */ |
||
32 | protected $idFieldName = 'unit_id'; |
||
33 | |||
34 | // protected $exceptionClass = 'Entity\EntityException'; |
||
|
|||
35 | protected $entityContainerClass = 'V2Unit\V2UnitContainer'; |
||
36 | |||
37 | // protected $properties = array( |
||
38 | // 'dbId' => array( |
||
39 | // P_DB_FIELD => 'unit_id', |
||
40 | // ), |
||
41 | // 'playerOwnerId' => array( |
||
42 | // P_DB_FIELD => 'unit_player_id', |
||
43 | // ), |
||
44 | // 'locationType' => array( |
||
45 | // P_DB_FIELD => 'unit_location_type', |
||
46 | // ), |
||
47 | // 'locationId' => array( |
||
48 | // P_DB_FIELD => 'unit_location_id', |
||
49 | // ), |
||
50 | // 'type' => array( |
||
51 | // P_DB_FIELD => 'unit_type', |
||
52 | // ), |
||
53 | // 'snId' => array( |
||
54 | // P_DB_FIELD => 'unit_snid', |
||
55 | // ), |
||
56 | // // Order is important! |
||
57 | // // TODO - split dbLevel to level and count |
||
58 | // 'level' => array( |
||
59 | // P_DB_FIELD => 'unit_level', |
||
60 | // ), |
||
61 | // 'count' => array(), |
||
62 | // // TODO - move to child class |
||
63 | // 'timeStart' => array( |
||
64 | // P_DB_FIELD => 'unit_time_start', |
||
65 | // ), |
||
66 | // 'timeFinish' => array( |
||
67 | // P_DB_FIELD => 'unit_time_finish', |
||
68 | // ), |
||
69 | // // Do we need it? Or internal no info/getters/setters should be ignored? |
||
70 | // 'unitInfo' => array(), |
||
71 | // 'isStackable' => array(), |
||
72 | // 'locationDefaultType' => array(), |
||
73 | // 'bonusType' => array(), |
||
74 | // ); |
||
75 | |||
76 | public function __construct(\Common\GlobalContainer $gc) { |
||
130 | |||
131 | public function setSnId(V2UnitContainer $that, $value) { |
||
148 | |||
149 | public function unsetSnId(V2UnitContainer $that) { |
||
159 | |||
160 | /** |
||
161 | * @param V2UnitContainer $unitCaptain |
||
162 | * @param int|string $userId |
||
163 | * |
||
164 | * @throws \Entity\EntityException |
||
165 | */ |
||
166 | // TODO - move to unitCaptain |
||
167 | public function validateCaptainVsUser($unitCaptain, $userId) { |
||
181 | |||
182 | /** |
||
183 | * @param V2UnitContainer $cUnit |
||
184 | * |
||
185 | * @return bool |
||
186 | */ |
||
187 | public function isEmpty($cUnit) { |
||
203 | |||
204 | /** |
||
205 | * @param V2UnitContainer $cUnit |
||
206 | * @param string $featureName |
||
207 | * |
||
208 | * return UnitFeature |
||
209 | * |
||
210 | * @return mixed|null |
||
211 | */ |
||
212 | public function feature($cUnit, $featureName) { |
||
215 | |||
216 | } |
||
217 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.