| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Initialize Companies Overrides | 
		
			| 
				 public 
				integer
				
				 | 
			#
			add( array $vars )
				
Add a company Parameters
						$varsarray$vars An array of company info including: - company_id The ID of the company
whose settings to import from - name The name of the company - hostname The
hostname of the company - address The address of the company (whole postal
address) - phone The phone number of the company - fax The fax number of the
company
Returns
						integerThe company ID added, void on error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			edit( integer $company_id, array $vars )
				
Edit an existing company Parameters
						$company_idinteger$company_id The ID of the company to update
$varsarray$vars An array of company info including: - name The name of the company -
hostname The hostname of the company - address The address of the company (whole
postal address) - phone The phone number of the company - fax The fax number of
the company
 | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $company_id )
				
Delete an existing company. Only companies no longer in use may be
removed. 
				
Delete an existing company. Only companies no longer in use may be
removed. Parameters
						$company_idinteger$company_id The company ID to remove from the system
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			generateKeyPair( integer $company_id, integer $bits, string $passphrase = null )
				
Generates a new public/private key pair for the company and stores it in the
database. Will not overwrite any existing key pair for the same company. 
				
Generates a new public/private key pair for the company and stores it in the
database. Will not overwrite any existing key pair for the same company. Parameters
						$company_idinteger$company_id The ID of the company to generate the key pair for
$bitsinteger$bits The number of bits (i.e. 1024) for the key length
$passphrasestring$passphrase The (optional) passphrase to use to encrypt the private key with.
Only set if you want super high security (and don't even trust Blesta to decrypt
things by itself)
Returns
						mixedAn array containing both parts of the key pair on success, false if the key is
already set for this company
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $company_id )
				
Fetches a company with the given ID 
				
Fetches a company with the given ID Parameters
						$company_idinteger$company_id The ID of the company to fetch
Returns
						mixedA stdClass object representing the company, false if no such company exists
 
 | 
		
			| 
				 public 
				stdClass | 
			#
			getByHostname( string $hostname )
				
Retrieves the company configured for the given hostname. Looks for hostname
and www.hostname 
				
Retrieves the company configured for the given hostname. Looks for hostname
and www.hostname Parameters
						$hostnamestring$hostname The hostname to fetch on (also looks at www.hostname)
Returns
						stdClassA stdClass object representing the company if it exists, false otherwise
					 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAllAvailable( integer $staff_id )
				
Fetches all companies available to the given staff ID 
				
Fetches all companies available to the given staff ID Parameters
						$staff_idinteger$staff_id The ID of the staff member
Returns
						arrayAn array of stdClass objects each representing a company
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getAll( )
				
Fetches all companies Returns
						mixedAn array of stdClass objects representing each company, or false if none exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getList( integer $page = 1, string $order_by = array('id'=>"ASC") )
				
Fetches a list of all companies 
				
Fetches a list of all companies Parameters
						$pageinteger$page The page to return results for
$order_bystring$order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
						mixedAn array of objects or false if no results.
 
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			getListCount( )
				
Return the total number of client groups returned from Companies::getList(),
useful in constructing pagination for the getList() method. 
				
Return the total number of client groups returned from Companies::getList(),
useful in constructing pagination for the getList() method. Returns
						integerThe total number of clients
 
 See | 
		
			| 
				 public 
				array
				
				 | 
			#
			getViewDirs( string $type = "client" )
				
Fetches data about each installed view directory 
				
Fetches data about each installed view directory Parameters
						$typestring$type The type of view directory to scan
Returns
						arrayAn array of view dirs
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSettings( integer $company_id, array $settings, array $value_keys = null )
				
Sets a group of company settings 
				
Sets a group of company settings Parameters
						$company_idinteger$company_id The company ID
$settingsarray$settings Settings to set as key/value pairs
$value_keysarray$value_keys An array of key values to accept as valid fields
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSetting( string $company_id, integer $key, string $value, mixed $encrypted = null, integer $inherit = null )
				
Sets a company settings Parameters
						$company_idstring$key The setting key (i.e. name)
$keyinteger$company_id The company ID
$valuestring$value The value to set for this setting
$encryptedmixed$encrypted True to encrypt $value, false to store unencrypted, null to encrypt
if currently set to encrypt
$inheritinteger$inherit Whether or not the setting should be inheritable
 | 
		
			| 
				 public 
				
				
				 | 
			#
			unsetSetting( string $company_id, mixed $key )
				
Unsets a setting from the company settings. CAUTION: This method will
physically remove the setting from the system, and could have dire consequences.
You should never use this method, except when attempting to remove a setting
created by Companies::setSettings() or Companies::setSetting() that did not
previously exist for this installation. 
				
Unsets a setting from the company settings. CAUTION: This method will
physically remove the setting from the system, and could have dire consequences.
You should never use this method, except when attempting to remove a setting
created by Companies::setSettings() or Companies::setSetting() that did not
previously exist for this installation. Parameters
						$company_idstring$key The setting to unset
$key | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getSettings( integer $company_id, boolean $ignore_inheritence = false )
				
Fetch all settings that may apply to this company. Settings are inherited in
the order of company_settings -> settings where "->" represents the left
item inheriting (and overwriting in the case of duplicates) values found in the
right item. 
				
Fetch all settings that may apply to this company. Settings are inherited in
the order of company_settings -> settings where "->" represents the left
item inheriting (and overwriting in the case of duplicates) values found in the
right item. Parameters
						$company_idinteger$company_id The company ID to retrieve settings for
$ignore_inheritenceboolean$ignore_inheritence True to only retrieve company settings, false to get all
inherited settings (default false)
Returns
						mixedAn array of objects containg key/values for the settings, false if no records
found
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getSetting( integer $company_id, string $key )
				
Fetch a specific setting that may apply to this company. Settings are
inherited in the order of company_settings -> settings where "->"
represents the left item inheriting (and overwriting in the case of duplicates)
values found in the right item. 
				
Fetch a specific setting that may apply to this company. Settings are
inherited in the order of company_settings -> settings where "->"
represents the left item inheriting (and overwriting in the case of duplicates)
values found in the right item. Parameters
						$company_idinteger$company_id The company ID to retrieve a setting for
$keystring$key The key name of the setting to fetch
Returns
						mixedA stdObject containg the key and value, false if no such key exists
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateAddAllowed( )
				
Verifies that the company can be added 
				
Verifies that the company can be added Returns
						booleanTrue if the company can be added, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateHostnameUnique( string $hostname, integer $company_id = null )
				
Checks whether the given hostname is unique or not 
				
Checks whether the given hostname is unique or not Parameters
						$hostnamestring$hostname The hostname to check
$company_idinteger$company_id The company ID to exclude from the unique check (ie itself,
optional, default null)
Returns
						booleanTrue if the given hostname is unique, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateCompanyInUse( integer $company_id )
				
Checks whether the given company ID is in use by a client or staff group 
				
Checks whether the given company ID is in use by a client or staff group Deprecated
							3.1.0
 Parameters
						$company_idinteger$company_id The company ID to check
Returns
						booleanTrue if the company is in use, false otherwise
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			validateCustomization( array $vars )
				
Validates Invoice customization settings 
				
Validates Invoice customization settings Parameters
						$varsarray$vars An array of key/value pairs of invoice customization settings to validate
 |