Skip to content

Commit bdb5455

Browse files
committed
Add new function isTypeDate
1 parent ac9fdea commit bdb5455

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Model/MetadataTypeModel.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ public function getType($id)
3838
->eq('id', $id)
3939
->findOne();
4040
}
41-
41+
42+
public function isTypeDate(string $name) : bool
43+
{
44+
$row = $this->db->table(self::TABLE)
45+
->eq('human_name', $name)
46+
->findOne();
47+
return $row != null ? $row['data_type'] == 'date' : false;
48+
}
49+
4250
public function checkName($name, $id)
4351
{
4452
$test = $this->db->table(self::TABLE)

0 commit comments

Comments
 (0)