Ejemplo n.º 1
0
    private function migratePayoutOptions() {
    	echo "  Migrating payout options.....";
    	
    	$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->add('*');
        $selectBuilder->from->add('wd_pa_payoutoptions');

        $result = $selectBuilder->getAllRows();

        $count = 0;
        foreach($result as $record) {
        	$obj = new Gpf_Db_FieldGroup();
        	$obj->setID($record->get('payoptid'));
           	$obj->setAccountId(Pap3Compatibility_Migration_Pap3Constants::DEFAULT_ACCOUNT_ID);
        	$obj->setName($record->get('name'));
           	$obj->setType(Pap_Common_Constants::FIELDGROUP_TYPE_PAYOUTOPTION);
           	$obj->setStatus(($record->get('disabled') == 1 ? Gpf_Db_FieldGroup::DISABLED : Gpf_Db_FieldGroup::ENABLED));
        	$obj->save();
        	$count++;
        }
    	echo " ($count) ..... DONE<br/>";
    }
Ejemplo n.º 2
0
 /**
  * Gets payout option name for Default payout method
  *
  * @service
  * @anonym
  * @param $id
  */
 public function getPayoutName(Gpf_Rpc_Params $params) {
 	$data = new Gpf_Rpc_Data($params);
     $payoutOption = new Gpf_Db_FieldGroup();
     $this->setType(Pap_Common_Constants::FIELDGROUP_TYPE_PAYOUTOPTION);
     $payoutOption->setPrimaryKeyValue($params->get('id'));
     try {
     	$payoutOption->load();
     	$data->setValue('payoutoptionid', $payoutOption->getPrimaryKeyValue());
     	$data->setValue('name', $this->_localize($payoutOption->getName()));
     } catch (Gpf_DbEngine_NoRowException $e) {
         $data->setValue('payoutoptionid', null);
     	$data->setValue('name', $this->_('None'));
     }
     
     return $data;
 }
 function __construct(){
     parent::__construct();
     $this->setType(Pap_Common_Constants::FIELDGROUP_TYPE_SIGNUPACTION);
 }