|
@@ -86,28 +86,28 @@ class Entity {
|
|
|
$comment = strlen($comment) > 0 ? " ". $comment : "";
|
|
|
|
|
|
$doc = [];
|
|
|
- if(($tableInfo['rules']['int'] && isset($tableInfo['rules']['int'][$field])) ||
|
|
|
- ($tableInfo['rules']['number'] && isset($tableInfo['rules']['number'][$field]))
|
|
|
+ if(isset($tableInfo['rules']['int'][$field]) ||
|
|
|
+ isset($tableInfo['rules']['number'][$field])
|
|
|
) {
|
|
|
$doc[] = "\t/**";
|
|
|
$doc[] = "\t * @var int ". $convertField . $comment;
|
|
|
$doc[] = "\t */";
|
|
|
- } else if (($tableInfo['rules']['maxlength'] && isset($tableInfo['rules']['maxlength'][$field]))
|
|
|
+ } else if (isset($tableInfo['rules']['maxlength'][$field])
|
|
|
|| (isset($tableInfo['rules']['text']) && in_array($field, $tableInfo['rules']['text']))
|
|
|
) {
|
|
|
$doc[] = "\t/**";
|
|
|
$doc[] = "\t * @var string ". $convertField . $comment;
|
|
|
$doc[] = "\t */";
|
|
|
- } else if ($tableInfo['rules']['timestamp'] && in_array($field, $tableInfo['rules']['timestamp'])) {
|
|
|
+ } else if (isset($tableInfo['rules']['timestamp']) && in_array($field, $tableInfo['rules']['timestamp'])) {
|
|
|
$doc[] = "\t/**";
|
|
|
$doc[] = "\t * @var datetime ". $convertField . $comment;
|
|
|
$doc[] = "\t */";
|
|
|
- } else if($tableInfo['rules']['float'] && isset($tableInfo['rules']['float'][$field])) {
|
|
|
+ } else if(isset($tableInfo['rules']['float'][$field])) {
|
|
|
$doc[] = "\t/**";
|
|
|
$doc[] = "\t * @var float ". $convertField . $comment;
|
|
|
$doc[] = "\t */";
|
|
|
}
|
|
|
- if($tableInfo['rules']['default'] && isset($tableInfo['rules']['default'][$field])) {
|
|
|
+ if(isset($tableInfo['rules']['default'][$field])) {
|
|
|
$default = $tableInfo['rules']['default'][$field];
|
|
|
$defaults[$convertField] = $default;
|
|
|
}
|