Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

$this->models[$key] issue #3

Open
Silentscripter opened this issue Oct 20, 2016 · 0 comments
Open

$this->models[$key] issue #3

Silentscripter opened this issue Oct 20, 2016 · 0 comments

Comments

@Silentscripter
Copy link

From your Repository.php:

protected function getModel($key)
    {
        if (!array_key_exists($key, $this->models)) {
            list($namespace, $key) = $this->splitNamespaceAndKey($key);

            $this->models[$key] = Config::query()
                                        ->where(Config::FIELD_NAMESPACE, $namespace)
                                        ->where(Config::FIELD_KEY, $key)
                                        ->first();
/* omissis */

The $key parameter is overriden when splitting namespace and keys. When $this->model[$key] is called, if the orginal key had a namespace it will be ignored thus provoking a possible conflict when two equal keys from different namespaces are used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant