System\Traits\KeyCodeModel
Overview
KeyCodeModel trait adds findByKey and findByCode cached methods to a model
Protected Properties
protected static array $cacheByKey
cacheByKey cache of self, by key.
protected static array $cacheByCode
cacheByCode cache of self, by code.
Public Methods
public static clearKeyCodeCache()
public static clearKeyCodeCache(): void
clearKeyCodeCache clears the static lookup caches
public static findByCode()
public static findByCode($code = null): self|null
findByCode locates a payment method by its code, cached.
public static findByKey()
public static findByKey($key = null): self|null
findByKey locates a tax class by its key, cached.