escpos-php
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Mike42\Escpos\CapabilityProfile Class Reference

Public Member Functions

 getCodePageCacheKey ()
 
 getCodePages ()
 
 getFeature ($featureName)
 
 getId ()
 
 getName ()
 
 getSupportsBarcodeB ()
 
 getSupportsBitImageRaster ()
 
 getSupportsGraphics ()
 
 getSupportsPdf417Code ()
 
 getSupportsQrCode ()
 
 getSupportsStarCommands ()
 
 getVendor ()
 

Static Public Member Functions

static getProfileNames ()
 
static load ($profileName)
 
static suggestNearest ($input, array $choices, $num)
 

Protected Member Functions

 __construct ($profileId, array $profileData)
 
 suggestFeatureName ($featureName)
 

Static Protected Member Functions

static loadCapabilitiesDataFile ()
 
static suggestProfileName ($profileName)
 

Protected Attributes

 $codePageCacheKey
 
 $codePages
 
 $colors
 
 $features
 
 $fonts
 
 $media
 
 $name
 
 $notes
 
 $profileId
 
 $vendor
 

Static Protected Attributes

static $encodings = null
 
static $profiles = null
 

Detailed Description

Store compatibility information about one printer.

Constructor & Destructor Documentation

Mike42\Escpos\CapabilityProfile::__construct (   $profileId,
array  $profileData 
)
protected

Construct new CapabilityProfile. The encoding data must be loaded from disk before calling.

Parameters
string$profileIdID of the profile
array$profileDataProfile data from disk.

Member Function Documentation

Mike42\Escpos\CapabilityProfile::getCodePageCacheKey ( )
Returns
string Hash of the code page data structure, to identify it for caching.
Mike42\Escpos\CapabilityProfile::getCodePages ( )
Returns
array Associtive array of CodePage objects, indicating which encodings the printer supports.
Mike42\Escpos\CapabilityProfile::getFeature (   $featureName)
Parameters
string$featureNameName of the feature to retrieve.
Exceptions
Mike42\Escpos\CapabilityProfile::getId ( )
Returns
string ID of the profile.
Mike42\Escpos\CapabilityProfile::getName ( )
Returns
string Name of the printer.
static Mike42\Escpos\CapabilityProfile::getProfileNames ( )
static
Returns
array Names of all profiles that exist.
Mike42\Escpos\CapabilityProfile::getSupportsBarcodeB ( )
Returns
boolean True if Barcode B command is supported, false otherwise
Mike42\Escpos\CapabilityProfile::getSupportsBitImageRaster ( )
Returns
boolean True if Bit Image Raster command is supported, false otherwise
Mike42\Escpos\CapabilityProfile::getSupportsGraphics ( )
Returns
boolean True if Graphics command is supported, false otherwise
Mike42\Escpos\CapabilityProfile::getSupportsPdf417Code ( )
Returns
boolean True if PDF417 code command is supported, false otherwise
Mike42\Escpos\CapabilityProfile::getSupportsQrCode ( )
Returns
boolean True if QR code command is supported, false otherwise
Mike42\Escpos\CapabilityProfile::getSupportsStarCommands ( )
Returns
boolean True if Star mode commands are supported, false otherwise
Mike42\Escpos\CapabilityProfile::getVendor ( )
Returns
string Vendor of this printer.
static Mike42\Escpos\CapabilityProfile::load (   $profileName)
static

Retrieve the CapabilityProfile with the given ID.

Parameters
string$profileNameThe ID of the profile to load.
Exceptions
InvalidArgumentExceptionWhere the ID does not exist. Some similarly-named profiles will be suggested in the Exception text.
Returns
CapabilityProfile The CapabilityProfile that was requested.
static Mike42\Escpos\CapabilityProfile::loadCapabilitiesDataFile ( )
staticprotected

Ensure that the capabilities.json data file has been loaded.

Mike42\Escpos\CapabilityProfile::suggestFeatureName (   $featureName)
protected
Parameters
string$featureNameFeature that does not exist
Returns
array Three most similar feature names that do exist.
static Mike42\Escpos\CapabilityProfile::suggestNearest (   $input,
array  $choices,
  $num 
)
static

Return choices with smallest edit distance to an invalid input.

Parameters
string$inputInput that is not a valid choice
array$choicesArray of valid choices.
int$numNumber of suggestions to return
static Mike42\Escpos\CapabilityProfile::suggestProfileName (   $profileName)
staticprotected
Parameters
string$profileNameprofile name that does not exist
Returns
array Three similar profile names that do exist, plus 'simple' and 'default' for good measure.

Member Data Documentation

string Mike42\Escpos\CapabilityProfile::$codePageCacheKey
protected

Hash of the code page data structure, to identify it for caching.

array Mike42\Escpos\CapabilityProfile::$codePages
protected

Associtive array of CodePage objects, indicating which encodings the printer supports.

array Mike42\Escpos\CapabilityProfile::$colors
protected

Not used.

array Mike42\Escpos\CapabilityProfile::$encodings = null
staticprotected

Data structure containing encodings loaded from disk, null if not loaded yet.

array Mike42\Escpos\CapabilityProfile::$features
protected

Feature values.

array Mike42\Escpos\CapabilityProfile::$fonts
protected

Not used

array Mike42\Escpos\CapabilityProfile::$media
protected

Not used

string Mike42\Escpos\CapabilityProfile::$name
protected

Name of the profile, including model number.

string Mike42\Escpos\CapabilityProfile::$notes
protected

Notes on the profile, null if not set.

string Mike42\Escpos\CapabilityProfile::$profileId
protected

ID of the profile.

array Mike42\Escpos\CapabilityProfile::$profiles = null
staticprotected

Data structure containing profiles loaded from disk, null if not loaded yet.

string Mike42\Escpos\CapabilityProfile::$vendor
protected

Name of manufacturer.


The documentation for this class was generated from the following file: