gutterboy Posted August 30, 2014 Report Share Posted August 30, 2014 I am passing the client data via the below array to the clients::create() method: $data = array ( 'vars' => array ( 'username' => $user_data['username'], 'new_password' => $password, 'confirm_password' => $password, 'client_group_id' => 1, 'first_name' => $user_data['first_name'], 'last_name' => $user_data['last_name'], 'company' => $company_name, 'address1' => $user_data['address'], 'city' => $user_data['city'], 'state' => $user_data['state_iso'], 'zip' => $user_data['zip_code'], 'country' => $user_data['country_iso'], 'email' => $user_data['email'], 'numbers' => array ( 'number' => $user_data['phone'] ), 'settings' => array ( 'send_registration_email' => false ) ) ); Everything gets stored correctly other than the phone - am I doing something wrong there? Thanks! Quote Link to comment Share on other sites More sharing options...
Blesta Addons Posted August 30, 2014 Report Share Posted August 30, 2014 The number structure should be [numbers] => Array ( [0] => stdClass Object ( [number] => 256632541 [type] => phone [location] => home ) [1] => stdClass Object ( [number] => 145236222 [type] => fax [location] => home ) ) try $data = array ( 'vars' => array ( 'username' => $user_data['username'], 'new_password' => $password, 'confirm_password' => $password, 'client_group_id' => 1, 'first_name' => $user_data['first_name'], 'last_name' => $user_data['last_name'], 'company' => $company_name, 'address1' => $user_data['address'], 'city' => $user_data['city'], 'state' => $user_data['state_iso'], 'zip' => $user_data['zip_code'], 'country' => $user_data['country_iso'], 'email' => $user_data['email'], 'numbers' => array ( '0' => array ( 'number' => $user_data['phone'] ), ), 'settings' => array ( 'send_registration_email' => false ) ) ); the numbers should be a incremental array Quote Link to comment Share on other sites More sharing options...
gutterboy Posted August 31, 2014 Author Report Share Posted August 31, 2014 Ahhhh.... makes sense, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.