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 be664cb..71cfa5c 100644
--- a/Digitigrade/Model.php
+++ b/Digitigrade/Model.php
@@ -287,4 +287,12 @@ abstract class Model {
$db->exec("DELETE FROM $tableName WHERE $where");
}
+
+ /**
+ * Converts the model to an opaque string, to be used for equality checking or debugging purposes only.
+ * @return string
+ */
+ public function __tostring(): string {
+ return '<Model:' . static::class . '[' . $this->getUpdateWhereClause(Db::getInstance()->getPdo()) . ']>';
+ }
} \ No newline at end of file