根据类名和主键值，获得缓存结果.

@param string $class
@param array  $id

@return Data|false
763597
public function get($class, array $id)
    {
        if (!$this->isEnabled()) {
            return false;
        }

        $key = self::key($class, $id);

        return isset($this->members[$key])
        ? $this->members[$key]
        : false;
    }
927770
public Class<?> getClass(int id) throws IOException {
      if (id < 0 || id > internalIdToClass.length) {
         throw new IOException("Unknown class id " + id);
      }
      Class<?> clazz = internalIdToClass[id];
      if (clazz == null) {
         throw new IOException("Unknown class id " + id);
      }
      return clazz;
   }
21263
public function loadClass( $class ) {

		if ( ! isset( $this->class_map[ $class ] ) )
			return FALSE;

		return $this->loader->loadFile( $this->class_map[ $class ] );
	}
408939
public function image($id, $class = '')
    {
        $img = '';

        if ($image = app('Grafite\Cms\Models\Image')->find($id)) {
            $img = $image->url;
        }

        return '<img class="'.$class.'" src="'.$img.'">';
    }
686890
public function removeItem($class, $id)
    {
        $this->loadFromCookies();
        if (!isset($this->items[$class]))
        {
            return;
        }

        unset($this->items[$class][$id]);
        $this->saveToCookies();
    }
322754
public function findById($className, $id)
    {
        return $this->factory->createTransaction()->findByReference(new Reference($className, $id));
    }
1132640
public function dsql($class = null)
    {
        $obj = parent::dsql($class);
        if (!$obj instanceof DB_dsql_prefixed) {
            throw $this->exception('Specified class must be descendant of DB_dsql_prefixed')
            ->addMoreInfo('class', $class);
        }
        if ($this->table_prefix) {
            $obj->prefix($this->table_prefix);
        }

        return $obj;
    }
446960
public function getByNamedId($classname, $name, $id)
    {
        if (!isset($this->namedId[$classname]) || !in_array($name, $this->namedId[$classname])) {
            throw new InvalidNamedIdExeption('NamedId ' . $name . ' is not a valid type');
        }
        if (!preg_match('/^[a-zA-Z0-9\- _]+$/D', $id)) {
            throw new InvalidIdException('Invalid id: ' . $id);
        }
        $response = $this->request($this->buildUrl(new $classname(), null, '/' . $name . '/' . $id), 'GET');
        return $this->mapper->mapFromStorage($response);
    }
592772
public static function delete_by_id($className, $id)
    {
        $obj = DataObject::get_by_id($className, $id);
        if ($obj) {
            $obj->delete();
        } else {
            user_error("$className object #$id wasn't found when calling DataObject::delete_by_id", E_USER_WARNING);
        }
    }
512764
public function getById($id, $cascade = false) {
        $result = self::getField($this->data, $id, null);
        if ($cascade && null !== $result && isset($this->one[$id])) {
            foreach ($this->one[$id] as $class => $foreignId) {
                $result = array_merge($class::getInstance()->getById($foreignId, $cascade), $result);
            }
        }
        return $result;
    }
1134485
public function flattenIdentifier(ClassMetadata $class, array $id)
    {
        $flatId = array();

        foreach ($class->identifier as $field) {
            if (isset($class->associationMappings[$field]) && isset($id[$field]) && is_object($id[$field])) {
                /* @var $targetClassMetadata ClassMetadata */
                $targetClassMetadata = $this->metadataFactory->getMetadataFor(
                    $class->associationMappings[$field]['targetEntity']
                );

                if ($this->unitOfWork->isInIdentityMap($id[$field])) {
                    $associatedId = $this->flattenIdentifier($targetClassMetadata, $this->unitOfWork->getEntityIdentifier($id[$field]));
                } else {
                    $associatedId = $this->flattenIdentifier($targetClassMetadata, $targetClassMetadata->getIdentifierValues($id[$field]));
                }

                $flatId[$field] = implode(' ', $associatedId);
            } elseif (isset($class->associationMappings[$field])) {
                $associatedId = array();

                foreach ($class->associationMappings[$field]['joinColumns'] as $joinColumn) {
                    $associatedId[] = $id[$joinColumn['name']];
                }

                $flatId[$field] = implode(' ', $associatedId);
            } else {
                $flatId[$field] = $id[$field];
            }
        }

        return $flatId;
    }
363682
private static function key($class, array $id)
    {
        $class = strtolower(ltrim($class, '\\'));
        ksort($id);

        $key = '';
        foreach ($id as $prop => $val) {
            if ($key) {
                $key .= ';';
            }
            $key .= "{$prop}:{$val}";
        }

        return $class . '@' . $key;
    }
59296
public function getEntity($className, $id)
    {
        if (isset($this->entities[$className]) && isset($this->entities[$className][$id])) {
            return $this->entities[$className][$id];
        }

        if (isset($this->stashedEntities[$className]) && isset($this->stashedEntities[$className][$id])) {
            return $this->stashedEntities[$className][$id];
        }

        return null;
    }
682075
public function dsql($class = null)
    {
        $class = $class ?: $this->dsql_class;
        $obj = $this->add($class);
        if (!$obj instanceof DB_dsql) {
            throw $this->exception('Specified class must be descendant of DB_dsql')
                ->addMoreInfo('class', $class);
        }

        return $obj;
    }
811763
protected function _getPossibleIndirectDbIdShortcuts($class)
    {
        $cacheId = '-poss-dbid-sc-'.$this->_class.'-'.$this->getGeneratorKey().'-'.$class;
        $ret = Kwf_Cache_SimpleStatic::fetch($cacheId, $success);
        if (!$success) {
            $ret = $this->_getPossibleIndirectDbIdShortcutsImpl($class);
            $ret = array_unique($ret);
            Kwf_Cache_SimpleStatic::add($cacheId, $ret);
        }
        return $ret;
    }
280140
public function getModel($class, $id)
	{
		if ($id instanceof $class) {
			return $id;
		} elseif (ctype_digit(strval($id))) { // целое число в виде числа или текстовой строки
			return $class::findOrFail($id);
		} else {
			//TODO: Использовать свое исключение
			throw new \Exception("Can't get model.", 1);
		}
	}
1042485
public function getByModelClass($class)
    {
        $this->checkInitialization();

        if ( ! array_key_exists($class, $this->modelClassIndex)) {
            return false;
        }

        return $this->getByKey($this->modelClassIndex[$class]);
    }