PHP Class Mike42\Escpos\CapabilityProfile

Show file Open project: mike42/escpos-php Class Usage Examples

Protected Properties

Property Type Description
$codePageCacheKey string Hash of the code page data structure, to identify it for caching.
$codePages array Associtive array of CodePage objects, indicating which encodings the printer supports.
$colors array Not used.
$encodings array Data structure containing encodings loaded from disk, null if not loaded yet.
$features array Feature values.
$fonts array Not used
$media array Not used
$name string Name of the profile, including model number.
$notes string Notes on the profile, null if not set.
$profileId string ID of the profile.
$profiles array Data structure containing profiles loaded from disk, null if not loaded yet.
$vendor string Name of manufacturer.

Public Methods

Method Description
getCodePageCacheKey ( ) : string
getCodePages ( ) : array
getFeature ( string $featureName ) : mixed
getId ( ) : string
getName ( ) : string
getProfileNames ( ) : array
getSupportsBarcodeB ( ) : boolean
getSupportsBitImageRaster ( ) : boolean
getSupportsGraphics ( ) : boolean
getSupportsPdf417Code ( ) : boolean
getSupportsQrCode ( ) : boolean
getSupportsStarCommands ( ) : boolean
getVendor ( ) : string
load ( string $profileName ) : CapabilityProfile Retrieve the CapabilityProfile with the given ID.
suggestNearest ( string $input, array $choices, integer $num ) Return choices with smallest edit distance to an invalid input.

Protected Methods

Method Description
__construct ( unknown $profileId, array $profileData ) Construct new CapabilityProfile.
loadCapabilitiesDataFile ( ) Ensure that the capabilities.json data file has been loaded.
suggestFeatureName ( string $featureName ) : array
suggestProfileName ( string $profileName ) : array

Method Details

__construct() protected method

The encoding data must be loaded from disk before calling.
protected __construct ( unknown $profileId, array $profileData )
$profileId unknown ID of the profile
$profileData array Profile data from disk.

getCodePageCacheKey() public method

public getCodePageCacheKey ( ) : string
return string Hash of the code page data structure, to identify it for caching.

getCodePages() public method

public getCodePages ( ) : array
return array Associtive array of CodePage objects, indicating which encodings the printer supports.

getFeature() public method

public getFeature ( string $featureName ) : mixed
$featureName string Name of the feature to retrieve.
return mixed feature value.

getId() public method

public getId ( ) : string
return string ID of the profile.

getName() public method

public getName ( ) : string
return string Name of the printer.

getProfileNames() public static method

public static getProfileNames ( ) : array
return array Names of all profiles that exist.

getSupportsBarcodeB() public method

public getSupportsBarcodeB ( ) : boolean
return boolean True if Barcode B command is supported, false otherwise

getSupportsBitImageRaster() public method

public getSupportsBitImageRaster ( ) : boolean
return boolean True if Bit Image Raster command is supported, false otherwise

getSupportsGraphics() public method

public getSupportsGraphics ( ) : boolean
return boolean True if Graphics command is supported, false otherwise

getSupportsPdf417Code() public method

public getSupportsPdf417Code ( ) : boolean
return boolean True if PDF417 code command is supported, false otherwise

getSupportsQrCode() public method

public getSupportsQrCode ( ) : boolean
return boolean True if QR code command is supported, false otherwise

getSupportsStarCommands() public method

public getSupportsStarCommands ( ) : boolean
return boolean True if Star mode commands are supported, false otherwise

getVendor() public method

public getVendor ( ) : string
return string Vendor of this printer.

load() public static method

Retrieve the CapabilityProfile with the given ID.
public static load ( string $profileName ) : CapabilityProfile
$profileName string The ID of the profile to load.
return CapabilityProfile The CapabilityProfile that was requested.

loadCapabilitiesDataFile() protected static method

Ensure that the capabilities.json data file has been loaded.
protected static loadCapabilitiesDataFile ( )

suggestFeatureName() protected method

protected suggestFeatureName ( string $featureName ) : array
$featureName string Feature that does not exist
return array Three most similar feature names that do exist.

suggestNearest() public static method

Return choices with smallest edit distance to an invalid input.
public static suggestNearest ( string $input, array $choices, integer $num )
$input string Input that is not a valid choice
$choices array Array of valid choices.
$num integer Number of suggestions to return

suggestProfileName() protected static method

protected static suggestProfileName ( string $profileName ) : array
$profileName string profile name that does not exist
return array Three similar profile names that do exist, plus 'simple' and 'default' for good measure.

Property Details

$codePageCacheKey protected property

Hash of the code page data structure, to identify it for caching.
protected string $codePageCacheKey
return string

$codePages protected property

Associtive array of CodePage objects, indicating which encodings the printer supports.
protected array $codePages
return array

$colors protected property

Not used.
protected array $colors
return array

$encodings protected static property

Data structure containing encodings loaded from disk, null if not loaded yet.
protected static array $encodings
return array

$features protected property

Feature values.
protected array $features
return array

$fonts protected property

Not used
protected array $fonts
return array

$media protected property

Not used
protected array $media
return array

$name protected property

Name of the profile, including model number.
protected string $name
return string

$notes protected property

Notes on the profile, null if not set.
protected string $notes
return string

$profileId protected property

ID of the profile.
protected string $profileId
return string

$profiles protected static property

Data structure containing profiles loaded from disk, null if not loaded yet.
protected static array $profiles
return array

$vendor protected property

Name of manufacturer.
protected string $vendor
return string