aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Model.php
diff options
context:
space:
mode:
Diffstat (limited to 'Digitigrade/Model.php')
-rw-r--r--Digitigrade/Model.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/Digitigrade/Model.php b/Digitigrade/Model.php
index a065154..40e85f4 100644
--- a/Digitigrade/Model.php
+++ b/Digitigrade/Model.php
@@ -128,6 +128,14 @@ abstract class Model {
protected function hydrate() {
}
+ /**
+ * Checks that all fields of the model are valid and allowed
+ * @return bool true if the model is valid, false otherwise
+ */
+ protected function validate(): bool {
+ return true;
+ }
+
public static function findWhere(string $whereClause, array $parameters): ?static {
$classNameParts = explode('\\', static::class);
$className = $classNameParts[count($classNameParts) - 1];