gutterboy Posted August 30, 2014 Report 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!
Blesta Addons Posted August 30, 2014 Report 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
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now