File tree 1 file changed +27
-0
lines changed
src/Symfony/Component/Security/Acl/Dbal
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,18 @@ public function deleteAcl(ObjectIdentityInterface $oid)
108
108
}
109
109
}
110
110
111
+ /**
112
+ * Deletes the security identity from the database.
113
+ * ACL entries have the CASCADE option on their foreign key so they will also get deleted
114
+ *
115
+ * @param SecurityIdentityInterface $sid
116
+ * @throws \InvalidArgumentException
117
+ */
118
+ public function deleteSecurityIdentity (SecurityIdentityInterface $ sid )
119
+ {
120
+ $ this ->connection ->executeQuery ($ this ->getDeleteSecurityIdentityIdSql ($ sid ));
121
+ }
122
+
111
123
/**
112
124
* {@inheritDoc}
113
125
*/
@@ -595,6 +607,21 @@ protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid
595
607
);
596
608
}
597
609
610
+ /**
611
+ * Constructs the SQL to delete a security identity.
612
+ *
613
+ * @param SecurityIdentityInterface $sid
614
+ * @throws \InvalidArgumentException
615
+ * @return string
616
+ */
617
+ protected function getDeleteSecurityIdentityIdSql (SecurityIdentityInterface $ sid )
618
+ {
619
+ $ select = $ this ->getSelectSecurityIdentityIdSql ($ sid );
620
+ $ delete = preg_replace ('/^SELECT id FROM/ ' , 'DELETE FROM ' , $ select );
621
+
622
+ return $ delete ;
623
+ }
624
+
598
625
/**
599
626
* Constructs the SQL for updating an object identity.
600
627
*
You can’t perform that action at this time.
0 commit comments