Phosphorum\Models\CacheableModel::createKey PHP Method

createKey() protected static method

Returns a string key based on the query parameters
protected static createKey ( mixed $parameters ) : null | string
$parameters mixed
return null | string
    protected static function createKey($parameters)
    {
        if (!is_array($parameters) || !$parameters['bind']) {
            return null;
        }
        $key = null;
        if (isset($parameters[0])) {
            $key = $parameters[0] . '-' . join('-', $parameters['bind']);
        } elseif (isset($parameters['conditions'])) {
            $key = $parameters['conditions'] . '-' . join('-', $parameters['bind']);
        } else {
            return null;
        }
        return strtolower(preg_replace('#[^0-9A-Za-z]#', '-', substr(get_called_class(), 18) . '-' . $key));
    }