- LSldapObject & LSattribute : Ajout du support des triggers before_create et after_c...
authorBenjamin Renard <brenard@easter-eggs.com>
Tue, 10 Mar 2009 09:22:41 +0000 (09:22 +0000)
committerBenjamin Renard <brenard@easter-eggs.com>
Tue, 10 Mar 2009 09:22:41 +0000 (09:22 +0000)
au niveau des LSattributes.

trunk/includes/class/class.LSldapObject.php

index 434e273..8c8bb95 100644 (file)
@@ -563,6 +563,12 @@ class LSldapObject {
             LSerror :: addErrorCode('LSldapObject_20');
             return;
           }
+          foreach ($submitData as $attr_name => $attr) {
+            if (!$this -> attrs[$attr_name] -> fireEvent('before_create')) {
+              LSerror :: addErrorCode('LSldapObject_20');
+              return;
+            }
+          }
         }
         if (!LSldap :: update($this -> getType(),$dn, $submitData)) {
           return;
@@ -572,6 +578,12 @@ class LSldapObject {
             LSerror :: addErrorCode('LSldapObject_21');
             return;
           }
+          foreach ($submitData as $attr_name => $attr) {
+            if (!$this -> attrs[$attr_name] -> fireEvent('after_create')) {
+              LSerror :: addErrorCode('LSldapObject_21');
+              return;
+            }
+          }
         }
         return true;
       }