Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -227,6 +227,41 @@ class _Gateway extends \IPS\Node\Model
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* [ActiveRecord] Save Changed Columns
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
parent::save();
|
||||
static::recountCardStorageGateways();
|
||||
}
|
||||
|
||||
/**
|
||||
* [ActiveRecord] Delete
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
parent::delete();
|
||||
static::recountCardStorageGateways();
|
||||
}
|
||||
|
||||
/**
|
||||
* Recount card storage gateays
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function recountCardStorageGateways()
|
||||
{
|
||||
$count = count( static::cardStorageGateways() );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $count ), array( 'conf_key=?', 'card_storage_gateways' ) );
|
||||
\IPS\Settings::i()->card_storage_gateways = $count;
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
}
|
||||
|
||||
/* !Features (Each gateway will override) */
|
||||
|
||||
const SUPPORTS_REFUNDS = FALSE;
|
||||
|
||||
Reference in new issue
Block a user