eZ\Publish\Core\Persistence\Cache\ContentTypeHandler::load PHP Method

load() public method

See also: eZ\Publish\SPI\Persistence\Content\Type\Handler::load
public load ( $typeId, $status = Type::STATUS_DEFINED )
    public function load($typeId, $status = Type::STATUS_DEFINED)
    {
        if ($status !== Type::STATUS_DEFINED) {
            $this->logger->logCall(__METHOD__, array('type' => $typeId, 'status' => $status));
            return $this->persistenceHandler->contentTypeHandler()->load($typeId, $status);
        }
        // Get cache for published content types
        $cache = $this->cache->getItem('contentType', $typeId);
        $type = $cache->get();
        if ($cache->isMiss()) {
            $this->logger->logCall(__METHOD__, array('type' => $typeId, 'status' => $status));
            $cache->set($type = $this->persistenceHandler->contentTypeHandler()->load($typeId, $status))->save();
        }
        return $type;
    }