Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1.  
  2.  
  3. class ConfigurationsTable extends Table {
  4.  
  5. // deleting threaded records
  6.     private function _deleteChildren($parentId) {
  7.         $children = $this->find('all', [
  8.             'conditions' => [
  9.                 'parent_id' => $parentId
  10.             ]
  11.         ]);
  12.         if (!empty($children)) {
  13.             foreach ($children as $child) {
  14.                 $this->delete($child['id']);
  15.             }
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement