]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/schemaupdater.php
Merge branch 'master' of git.gnu.io:Quix0r/gnu-social
[quix0rs-gnu-social.git] / lib / schemaupdater.php
index d336135464a54c6ff083411f5ee12056334f416a..03892970c5d3794b68a793d3c3c21141daf3d5cf 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 class SchemaUpdater
 {
@@ -46,6 +44,11 @@ class SchemaUpdater
      */
     public function register($tableName, array $tableDef)
     {
+        // Check if the table we're registering is related to a Managed_DataObject
+        if (is_a(ucfirst($tableName), 'Managed_DataObject', true)) {
+            call_user_func("{$tableName}::beforeSchemaUpdate");
+        }
+
         $this->tables[$tableName] = $tableDef;
     }