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 findByCode()

public static findByCode($code = null): static|null 

findByCode locates a payment method by its code, cached.

public static findByKey()

public static findByKey($key = null): static|null 

findByKey locates a tax class by its key, cached.