<commit_before><?php

class Cockpit_Admin_Pexcard extends Cockpit_Admin_Pexcard_Trackchange {

	const CONFIG_KEY_PEX_AMOUNT_TO_SHIFT_START = 'pex_amount_shift_start';
	const CONFIG_KEY_PEX_SHIFT_ENABLE = 'pex_card_funds_shift_enable';
	const CONFIG_KEY_PEX_ORDER_ENABLE = 'pex_card_funds_order_enable';
	const CONFIG_KEY_PEX_ORDER_ENABLE_FOR_CASH = 'pex_card_funds_order_enable_for_cash';
	const CONFIG_KEY_PEX_BUSINESS_CARD = 'pex_business_card';
	const CONFIG_KEY_PEX_TEST_CARD = 'pex_test_card';
	const CONFIG_KEY_PEX_ACTIVE = 'pex-card-active';

	public function __construct($id = null) {
		parent::__construct();
		$this->table( 'admin_pexcard' )->idVar( 'id_admin_pexcard' )->load( $id );
	}

	public function admin(){
		if( !$this->_admin && $this->id_admin ){
			$this->_admin = Admin::o( $this->id_admin );
		}
		return $this->_admin;
	}

	public function pexcard(){
		if( !$this->_pexcard ){
			$this->_pexcard = $this->load_card_info();
		}
		return $this->_pexcard;
	}

	public function load_card_info(){
		if( $this->id_pexcard ){
			$card = Crunchbutton_Pexcard_Card::details( $this->id_pexcard );
			if( $card->body && $card->body->id ){
				return $card->body;
			}
		}
		return false;
	}

	public function actions(){
		return Crunchbutton_Pexcard_Action::actionsByCard( $this->id_admin_pexcard );
	}

	public function getByAdmin( $id_admin = null ){
		if (!$id_admin) {
			return false;
		}
		return Cockpit_Admin_Pexcard::q( 'SELECT * FROM admin_pexcard WHERE id_admin = ?', [$id_admin]);
	}

	public function removeFundsOrderCancelled( $id_order ){<commit_msg>Make another function static because it was breaking tests<commit_after><?php

class Cockpit_Admin_Pexcard extends Cockpit_Admin_Pexcard_Trackchange {

	const CONFIG_KEY_PEX_AMOUNT_TO_SHIFT_START = 'pex_amount_shift_start';
	const CONFIG_KEY_PEX_SHIFT_ENABLE = 'pex_card_funds_shift_enable';
	const CONFIG_KEY_PEX_ORDER_ENABLE = 'pex_card_funds_order_enable';
	const CONFIG_KEY_PEX_ORDER_ENABLE_FOR_CASH = 'pex_card_funds_order_enable_for_cash';
	const CONFIG_KEY_PEX_BUSINESS_CARD = 'pex_business_card';
	const CONFIG_KEY_PEX_TEST_CARD = 'pex_test_card';
	const CONFIG_KEY_PEX_ACTIVE = 'pex-card-active';

	public function __construct($id = null) {
		parent::__construct();
		$this->table( 'admin_pexcard' )->idVar( 'id_admin_pexcard' )->load( $id );
	}

	public function admin(){
		if( !$this->_admin && $this->id_admin ){
			$this->_admin = Admin::o( $this->id_admin );
		}
		return $this->_admin;
	}

	public function pexcard(){
		if( !$this->_pexcard ){
			$this->_pexcard = $this->load_card_info();
		}
		return $this->_pexcard;
	}

	public function load_card_info(){
		if( $this->id_pexcard ){
			$card = Crunchbutton_Pexcard_Card::details( $this->id_pexcard );
			if( $card->body && $card->body->id ){
				return $card->body;
			}
		}
		return false;
	}

	public function actions(){
		return Crunchbutton_Pexcard_Action::actionsByCard( $this->id_admin_pexcard );
	}

	public static function getByAdmin( $id_admin = null ){
		if (!$id_admin) {
			return false;
		}
		return Cockpit_Admin_Pexcard::q( 'SELECT * FROM admin_pexcard WHERE id_admin = ?', [$id_admin]);
	}

	public function removeFundsOrderCancelled( $id_order ){
{'fraction_non_alphanumeric': 0.129595015576324, 'fraction_numerical': 0.0, 'mean_word_length': 5.526422764227642, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1775975', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1175, 'n_words': 207}