Results 1 to 2 of 2

Thread: Adding ondelete_callback to tl_member [SOLVED]

  1. #1
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Adding ondelete_callback to tl_member [SOLVED]

    I'm still trying to get some sort of callback or hook going so that when I delete a FE member FROM THE BACKEND, another module will be purged of related data.
    I've given up on the closeAccount hook, as this only works with a members self-deletion using the FE closeAccount module.

    So now I'm trying to add an ondelete_callback to tl_member.php from myModule, but I can't get that to work either.

    Can anyone see the reason why this doesn't work?

    In myModule/dca/tl_member.php
    Code:
    //add an ondelete_callback to the tl_member module
    $GLOBALS['TL_DCA']['tl_member']['config']['ondelete_callback'] = array('tl_joblistings_members', 'resetAfterMemberDelete');
    In myModule/dca/tl_joblistings_members.php
    Code:
    class tl_joblistings_members extends Backend
    {
    	public function resetAfterMemberDelete(Datacontainer $dc)
    	{
    	$thememberno = "callback worked";
    	
    		$this->Database->prepare("UPDATE tl_joblistings_members SET company =? WHERE memberno =115")
    		->limit(1)
    		->execute($thememberno);	
    	}
    }

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Adding ondelete_callback to tl_member [SOLVED]

    My problem was that my class was extending Backend, and should have been extending tl_member instead

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •