netsensia/companies-house

This package is abandoned and no longer maintained. No replacement package was suggested.

Wrapper classes for Companies House Gateway

v0.2.3 2014-03-18 21:19 UTC

README

This package is no longer maintained.

It has been superceded by https://packagist.org/packages/netsensia/companieshouse-api-php-client which wraps the new gov.uk companies house Rest API rather than the XML gateway.

Zend Framework 2 (optional) module to simplify access to company data via the Companies House (UK) XML Gateway.

Very early stages of development. Currently supports retrieving the following elements from the XML gateway:

  • Company details
  • Company appointments
  • Company name search

Development of the remainder should be fairly swift, but any contributions will be appreciated :)

Add the following to your composer.json:

"require" : {
    "netsensia/companies-house" : ">=0.2.0"
},

To integrate as a Zend Framework 2 module, copy config/netsensia-companies-house.php.dist to config/autoload/netsensia-companies-house.php and fill in the blanks. Add the module to your config/application.config.php Then, from within a controller you can use like this:

$request = $this->getServiceLocator()->get('NetsensiaCompanies\Request\CompanyDetailsRequest');
$companyModel = $loader->loadCompanyDetails($companyNumber);

Or, if not using ZF2:

$config = [
    'SenderID' => '',
    'password' => '',
    'email'    => '',
];

$request = new \NetsensiaCompanies\Request\CompanyDetailsRequest($config);
$companyModel->loadCompanyDetails($companyNumber);

Then:

$companyName = $companyModel->getCompanyName();

Other model examples (follow chosen pattern above to instantiate the request object in each case)

$companyAppointmentsModel = $request->loadCompanyAppointments(
    $companyNumber,
    $companyModel->getCompanyName(),
    true /* include resigned appointments */
    true /* request all continuation pages when results are paginated */
);

$nameSearchResults = $request->loadResults(
    $partialCompanyName, /* will return results close to this name */
    $numResults /* max 1000 */
);