public function getReference($data, $type)
    {
        $index = array_search($data, $this->store[$type], true);
        if ($index !== false) {
            return $index;
        }

        if (!$this->validate($data)) {
            return false;
        }

        $this->addReference($data, $type);
        return false;
    }