Skip to content

Commit d0a40a5

Browse files
authored
Merge pull request #97 from alfredbuehler/f/isTypeDate
Add new function isTypeDate
2 parents ac9fdea + bdb5455 commit d0a40a5

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)