public function createClient(Client $client, $password)
    {
        $data = $client->toArray();
        $data['password_confirm'] = $data['password'] = $password;
        $data['send_email'] = 0;
        $data['submit'] = 'Save';

        $response = $this->post('/en/client/add', $data);

        if ($response->getStatusCode() == 200) {
            $error = $this->getBetween((string)$response->getBody(), '<ul class="errors">', '</ul>');
            $error = $this->getBetween($error, '<li>', '</li>');
            throw new YouHostingException("Unable to create profile: " . $error);
        }

        $response = $this->get($response->getHeader('Location'));

        $client->id = $this->getBetweenReverse((string)$response->getBody(), '/en/client/view/id/', '">' . $client->email);
        return $client;
    }
public function createClient(Client $client, $password)
    {
        $data = $client->toArray();
        $data['password_confirm'] = $data['password'] = $password;
        $data['send_email'] = 0;
        $data['submit'] = 'Save';

        $response = $this->post('/en/client/add', $data);

        if ($response->getStatusCode() == 200) {
            $error = $this->getBetween((string)$response->getBody(), '<ul class="errors">', '</ul>');
            $error = $this->getBetween($error, '<li>', '</li>');
            throw new YouHostingException("Unable to create profile: " . $error);
        }

        $response = $this->get($response->getHeader('Location'));

        $client->id = $this->getBetweenReverse((string)$response->getBody(), '/en/client/view/id/', '">' . $client->email);
        return $client;
    }
public function createClient ( Client $ client , $ password ) { $ data = $ client -> toArray ( ) ; $ data [ 'password_confirm' ] = $ data [ 'password' ] = $ password ; $ data [ 'send_email' ] = 0 ; $ data [ 'submit' ] = 'Save' ; $ response = $ this -> post ( '/en/client/add' , $ data ) ; if ( $ response -> getStatusCode ( ) == 200 ) { $ error = $ this -> getBetween ( ( string ) $ response -> getBody ( ) , '<ul class="errors">' , '</ul>' ) ; $ error = $ this -> getBetween ( $ error , '<li>' , '</li>' ) ; throw new YouHostingException ( "Unable to create profile: " . $ error ) ; } $ response = $ this -> get ( $ response -> getHeader ( 'Location' ) ) ; $ client -> id = $ this -> getBetweenReverse ( ( string ) $ response -> getBody ( ) , '/en/client/view/id/' , '">' . $ client -> email ) ; return $ client ; }
Create a new client on YouHosting

@param Client $client a container for client details
@param string $password
@return Client
@throws YouHostingException
Create a new client on YouHosting