Documentation

UkCompaniesHouse extends Base
in package

United Kingdom Companies House record collector class.

Table of Contents

EXTERNAL_URL  = 'https://find-and-update.company-information.service.gov.uk/company/'
LIMIT  = 4
REMOVE_KEYS  = ['linksSelf', 'linksFiling_history', 'linksOfficers', 'linksPersons_with_significant_control-statements', 'linksCharges']
$allowedModules  : array<string|int, string>
$description  : string
$displayType  : string
$docUrl  : string
$formFieldsToRecordMap  : mixed
{@inheritdoc}
$icon  : string
$label  : string
$moduleName  : string
$settingsFields  : array<string|int, mixed>
$addOnName  : string
$data  : array<string|int, mixed>
$fields  : mixed
var array List of fields for the modal search window.
$modulesFieldsMap  : array<string|int, mixed>
$name  : string
$paid  : bool
$request  : Request
$response  : array<string|int, mixed>
$apiKey  : string
$url  : string
__construct()  : mixed
Constructor.
getFields()  : array<string|int, Vtiger_Field_Model>
Get fields for the modal search window.
getFieldsLabelsByModule()  : array<string|int, string>
Get fields labels for the module name.
getFieldsModule()  : array<string|int, string>
Get fields for the module name.
getName()  : string
Get record collector name.
isActive()  : bool
Check whether it is active.
isAvailable()  : bool
Check if product is available.
loadData()  : void
Load data.
search()  : array<string|int, mixed>
Search data function.
setRequest()  : void
Set request.
getParams()  : array<string|int, mixed>
Get params of collector.
getDataFromApiByName()  : void
Function finding NCR Number by company name.
getDataFromApiByNcr()  : array<string|int, mixed>
Function fetching from Companies House API.
getPersonsWithSignificantControl()  : array<string|int, mixed>
Function fetching persons Persons with significant control .
parseData()  : array<string|int, mixed>
Function parsing data to fields from Companies House API.
setApiKey()  : void
Function setup Api Key.

Constants

EXTERNAL_URL

public string EXTERNAL_URL = 'https://find-and-update.company-information.service.gov.uk/company/'

CH sever address

REMOVE_KEYS

public array<string|int, string> REMOVE_KEYS = ['linksSelf', 'linksFiling_history', 'linksOfficers', 'linksPersons_with_significant_control-statements', 'linksCharges']

Keys to skip in additional

Properties

$allowedModules

public array<string|int, string> $allowedModules = ['Accounts', 'Leads', 'Vendors', 'Competition']

Allowed modules.

$description

public string $description = 'LBL_UK_CH_DESC'

Additional description, visible in the modal window.

$displayType

public string $displayType = 'FillFields'

Search results display type.

$docUrl

public string $docUrl = 'https://developer.company-information.service.gov.uk/'

Url to Documentation API

$formFieldsToRecordMap

{@inheritdoc}

public mixed $formFieldsToRecordMap = ['Accounts' => ['company_name' => 'accountname', 'company_number' => 'registration_number_1', 'sic_codes0' => 'siccode', 'registered_office_addressAddress_line_1' => 'addresslevel8a', 'registered_office_addressPostal_code' => 'addresslevel7a', 'registered_office_addressLocality' => 'addresslevel5a', 'registered_office_addressRegion' => 'addresslevel4a', 'registered_office_addressAddress_line_2' => 'addresslevel3a', 'registered_office_addressCountry' => 'addresslevel1a', 'registered_office_addressPo_box' => 'poboxa', 'service_addressAddress_line_1' => 'addresslevel8b', 'service_addressAddress_line_2' => 'addresslevel3b', 'service_addressLocality' => 'addresslevel5b', 'service_addressPostal_code' => 'addresslevel7b', 'service_addressCountry' => 'addresslevel1b', 'service_addressRegion' => 'addresslevel4b', 'service_addressPo_box' => 'poboxb'], 'Leads' => ['company_name' => 'company', 'company_number' => 'registration_number_1', 'registered_office_addressAddress_line_1' => 'addresslevel8a', 'registered_office_addressAddress_line_2' => 'addresslevel3a', 'registered_office_addressLocality' => 'addresslevel5a', 'registered_office_addressPostal_code' => 'addresslevel7a', 'registered_office_addressCountry' => 'addresslevel1a', 'registered_office_addressRegion' => 'addresslevel4a', 'registered_office_addressPo_box' => 'poboxa'], 'Vendors' => ['company_name' => 'vendorname', 'company_number' => 'registration_number_1', 'registered_office_addressAddress_line_1' => 'addresslevel8a', 'registered_office_addressAddress_line_2' => 'addresslevel3a', 'registered_office_addressLocality' => 'addresslevel5a', 'registered_office_addressPostal_code' => 'addresslevel7a', 'registered_office_addressCountry' => 'addresslevel1a', 'registered_office_addressRegion' => 'addresslevel4a', 'registered_office_addressPo_box' => 'poboxa', 'service_addressAddress_line_1' => 'addresslevel8b', 'service_addressAddress_line_2' => 'addresslevel3b', 'service_addressLocality' => 'addresslevel5b', 'service_addressPostal_code' => 'addresslevel7b', 'service_addressCountry' => 'addresslevel1b', 'service_addressRegion' => 'addresslevel4b', 'service_addressPo_box' => 'poboxb'], 'Competition' => ['company_name' => 'subject', 'registered_office_addressAddress_line_1' => 'addresslevel8a', 'registered_office_addressPostal_code' => 'addresslevel7a', 'registered_office_addressLocality' => 'addresslevel5a', 'registered_office_addressRegion' => 'addresslevel4a', 'registered_office_addressAddress_line_2' => 'addresslevel3a', 'registered_office_addressCountry' => 'addresslevel1a', 'registered_office_addressPo_box' => 'poboxa']]

$moduleName

public string $moduleName

Module name.

$settingsFields

public array<string|int, mixed> $settingsFields = ['api_key' => ['required' => 1, 'purifyType' => 'Text', 'label' => 'LBL_API_KEY']]

Configuration field list.

$addOnName

protected string $addOnName = 'YetiForceRcUkCompaniesHouse'

The name of Add-on.

$data

protected array<string|int, mixed> $data = []

Data from record collector source.

$fields

var array List of fields for the modal search window.

protected mixed $fields = ['ncr' => ['labelModule' => '_Base', 'label' => 'Registration number 1'], 'companyName' => ['labelModule' => '_Base', 'label' => 'Account name']]

$modulesFieldsMap

protected array<string|int, mixed> $modulesFieldsMap = ['Accounts' => ['ncr' => 'registration_number_1', 'companyName' => 'accountname'], 'Leads' => ['ncr' => 'registration_number_1', 'companyName' => 'company'], 'Vendors' => ['ncr' => 'registration_number_1', 'companyName' => 'vendorname'], 'Competition' => ['ncr' => 'registration_number_1', 'companyName' => 'subject']]

Fields mapping for loading record data.

$name

protected string $name

Record collector name.

$paid

protected bool $paid = true

Requires subscription.

$response

protected array<string|int, mixed> $response = []

Response data.

$url

private string $url = 'https://api.company-information.service.gov.uk'

CH sever address

Methods

__construct()

Constructor.

public __construct() : mixed
Return values
mixed

getFields()

Get fields for the modal search window.

public getFields() : array<string|int, Vtiger_Field_Model>
Return values
array<string|int, Vtiger_Field_Model>

getFieldsLabelsByModule()

Get fields labels for the module name.

public getFieldsLabelsByModule(string $moduleName) : array<string|int, string>
Parameters
$moduleName : string
Return values
array<string|int, string>

getFieldsModule()

Get fields for the module name.

public getFieldsModule(string $moduleName) : array<string|int, string>
Parameters
$moduleName : string
Return values
array<string|int, string>

getName()

Get record collector name.

public getName() : string
Return values
string

isActive()

Check whether it is active.

public isActive() : bool
Return values
bool

isAvailable()

Check if product is available.

public isAvailable() : bool
Return values
bool

loadData()

Load data.

public loadData() : void
Return values
void

Search data function.

public search() : array<string|int, mixed>
Return values
array<string|int, mixed>

setRequest()

Set request.

public setRequest(Request $request) : void
Parameters
$request : Request
Return values
void

getParams()

Get params of collector.

protected getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDataFromApiByName()

Function finding NCR Number by company name.

private getDataFromApiByName(string $companyName) : void
Parameters
$companyName : string
Return values
void

getDataFromApiByNcr()

Function fetching from Companies House API.

private getDataFromApiByNcr(string $ncr) : array<string|int, mixed>
Parameters
$ncr : string
Return values
array<string|int, mixed>

getPersonsWithSignificantControl()

Function fetching persons Persons with significant control .

private getPersonsWithSignificantControl(string $url) : array<string|int, mixed>
Parameters
$url : string
Return values
array<string|int, mixed>

parseData()

Function parsing data to fields from Companies House API.

private parseData(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

setApiKey()

Function setup Api Key.

private setApiKey() : void
Return values
void

        

Search results