LazyRecord\Inflector::_cache PHP Method

_cache() public method

Cache inflected values, and return if already available.
public _cache ( string $type, string $key, string $value = false ) : string
$type string Inflection type
$key string Original value
$value string Inflected value
return string Inflected value, from cache
    public function _cache($type, $key, $value = false)
    {
        $key = '_' . $key;
        $type = '_' . $type;
        if ($value !== false) {
            $this->{$type}[$key] = $value;
            return $value;
        }
        if (!isset($this->{$type}[$key])) {
            return false;
        }
        return $this->{$type}[$key];
    }