DriverBehavior base class.


Public Properties

There are no public properties in the class.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected mixed $fieldConfig

fieldConfig is extra configuration for the converter type.

protected string $configPath

configPath specifies a path to the config directory.

Show inherited protected properties

Inherited Protected Properties

Public Methods

public __construct()

public __construct($model = null): void

public defineFormFields()

public defineFormFields(): void

defineFormFields for extra field configuration for the shipping type.

public getConfigPath()

public getConfigPath(
    string $fileName,
    mixed $configPath = null
): string 

getConfigPath locates a file based on it's definition. If the file starts with the ~ symbol it will be returned in context of the application base path, otherwise it will be returned in context of the config path.

public getFieldConfig()

public getFieldConfig(): void

getFieldConfig returns the field configuration used by this model.

public getHostObject()

public getHostObject(): Shop\Models\CurrencyRate 

getHostObject returns the host object with configuration.

public guessConfigPath()

public guessConfigPath(string $suffix = ''): string 

guessConfigPath guesses the package path for the called class.

public guessConfigPathFrom()

public guessConfigPathFrom(string $class, string $suffix = ''): string 

guessConfigPathFrom guesses the package path from a specified class.

public initDriverHost()

public initDriverHost(Model $host): void

initDriverHost when the converter is first created.

public makeConfig()

public makeConfig(
    mixed $configFile = [],
    array $requiredConfig = []
): object 

makeConfig reads the contents of the supplied file and applies it to this object.

public makeConfigFromArray()

public makeConfigFromArray(array $configArray = []): stdClass 

makeConfigFromArray makes a config object from an array, making the first level keys properties of a new object.

public mergeConfig()

public mergeConfig(mixed $configA, mixed $configB): stdClass 

mergeConfig merges two configuration sources, either prepared or not, and returns them as a single configuration object.

public validateDriverHost()

public validateDriverHost(Model $host): void

validateDriverHost validates the host data before saving, this method can throw a ValidationException for invalid fields. For example:

throw new \ValidationException(['max_weight' => 'Max weight cannot be less than Min weight!']);

Show inherited public methods

Inherited Public Methods

Protected Methods

protected getConfigValueFrom()

protected getConfigValueFrom($configObj, $name = null, $default = null): void

getConfigValueFrom will apply the config getter convention

Show inherited protected methods

Inherited Protected Methods