Last active
July 29, 2019 07:36
-
-
Save cgi-caesar/a1c24a2778a637fadd9a02a9574865f5 to your computer and use it in GitHub Desktop.
aMember (site.php): Ability to clear invoice log from admin interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add new item to aMember CP -> Utilities -> Delete Old Records | |
*/ | |
Am_Di::getInstance()->hook->add(Am_Event::CLEAR_ITEMS, function(Am_Event $e) { | |
$di = $e->getDi(); | |
$e->addReturn([ | |
'method' => function ($date) use ($di) { | |
$di->invoiceLogTable->deleteBy([['tm', '<', $date]]); | |
}, | |
'title' => 'Invoice Log', | |
'desc' => 'invoice log table (used by admin only)' | |
], 'invoice_log'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment