'PortalUserId'=>Array('type'=>'int','unique'=>Array(),'formatter'=>'kLEFTFormatter','error_msgs'=>Array('invalid_option'=>'!la_error_UserNotFound!','unique'=>'!la_affiliate_already_exists!'),'options'=>Array(USER_ROOT=>'root',USER_GUEST=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'Users WHERE %s','left_key_field'=>'PortalUserId','left_title_field'=>USER_TITLE_FIELD,'required'=>1,'default'=>null),
'AffiliatePlanId'=>Array('type'=>'int','formatter'=>'kOptionsFormatter','options_sql'=>'SELECT Name, AffiliatePlanId FROM '.TABLE_PREFIX.'AffiliatePlans WHERE Enabled = 1 ORDER BY Name','option_key_field'=>'AffiliatePlanId','option_title_field'=>'Name','not_null'=>1,'default'=>0),
'PaymentTypeId'=>Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>''),'options_sql'=>'SELECT Name, PaymentTypeId FROM '.TABLE_PREFIX.'AffiliatePaymentTypes WHERE Status = 1 ORDER BY IsPrimary DESC, Priority DESC, Name ASC','option_key_field'=>'PaymentTypeId','option_title_field'=>'Name','not_null'=>1,'default'=>0),