Checks if there is a metadata object to handle the given class/resource id
@param string $id
@param int    $type

@return bool
773476
public function has(VariableWrapper $data)
    {
        foreach ($this->metadatas as $metadata) {
            if ($metadata->supports($data)) {
                return true;
            }
        }

        return false;
    }
39704
public function supports($resource, $type = null)
    {
        if (!is_string($resource) || 'xml' !== pathinfo($resource, PATHINFO_EXTENSION)) {
            return false;
        }

        $file = $this->getLocator()->locate($resource);
        $document = XmlUtils::loadFile($file);
        $namespaces = $document->documentElement->attributes->getNamedItem('schemaLocation')->nodeValue;

        $start = strpos($namespaces, static::XML_NAMESPACE_URI) + strlen(static::XML_NAMESPACE_URI) + 1;
        $namespace = substr($namespaces, $start);

        $end = strpos($namespace, ' ');
        if (false !== $end) {
            $namespace = substr($namespace, 0, $end);
        }

        return $namespace === static::SCHEMA_URI;
    }
282908
public function supports($resource, $type = null): bool
    {
        return is_string($resource) &&
            in_array(pathinfo($resource, PATHINFO_EXTENSION), ['yml', 'yaml']);
    }
281599
public function delete($type = null, $id = null)
    {
        $this->_validateActionIsEnabled('delete');

        $this->_event('beforeDelete', [
            'id' => $id
        ]);

        $entity = $this->Model->get($id);

        $this->request->allowMethod(['post', 'delete']);

        if ($this->Model->delete($entity)) {
            $this->Flash->success(__d('CakeAdmin', 'The {0} has been deleted.', [$this->type['singularAliasLc']]));
        } else {
            $this->Flash->error(__d('CakeAdmin', 'The {0} could not be deleted. Please, try again.', [$this->type['singularAliasLc']]));
        }

        $this->_event('afterDelete', [
            'id' => $id
        ]);

        return $this->redirect(['action' => 'index', 'type' => $this->type['name']]);
    }
703112
protected function __delete($index, $type, $id, array $parameters = []) {
        $result = $this->client->delete([
            'index' => $index,
            'type' => $type,
            'id' => $id] + $parameters);
        return $result;
    }
1365799
public function add(string $id_option, string $type = 'page'): ?int
  {
    if ( $id_option = $this->_get_id_option($id_option, $type) ){
      return $this->pref->set_by_option($id_option, []);
    }
    return null;
  }
1184379
protected function __find($index, $type, $id) {
        try {
            $result = $this->client->get([
                'index' => $index,
                'type' => $type,
                'id' => $id
            ]);
            if ($result['found']) {
                return $this->_makeModel($result);
            } else {
                return null;
            }
        } catch (\Exception $e) {
            trigger_error($e->getMessage(), E_USER_WARNING);
            return null;
        }
    }
108092
public function actionIndex($id, $type = 'notes')
    {
        $model = $this->findModel($id);
        if (!isset($this->collectionClassMaps[$type])) {
            throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist.'));
        }
        $query = $model->getCollections()->andWhere(['model' => $this->collectionClassMaps[$type]])->orderBy(['created_at' => SORT_DESC]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        return $this->render('index', [
            'model' => $model,
            'type' => $type,
            'dataProvider' => $dataProvider
        ]);
    }
626956
public function isDefined($id)
    {
        return isset($this->typemap[$id]) ? $this->typemap[$id] : false;
    }
218667
public function themeHasActivated($type, $id)
    {
        $message = \trans('orchestra/control::response.themes.update', [
            'type' => Str::title($type),
        ]);

        return $this->redirectWithMessage(
            \handles("orchestra::control/themes/{$type}"), $message
        );
    }
874779
function GetCache($type, $id) {
		if (!isset($this->cache[$type]) || !$this->cache[$type]) // Dont cache this type of call
			return FALSE;
		if (isset($this->_cache[$type][$id]))
			return $this->_cache[$type][$id];
		return FALSE;
	}
73642
protected function _loadMetadatas($id)
    {
        $file = $this->_metadatasFile($id);
        $result = $this->_fileGetContents($file);
        if (!$result) {
            return false;
        }
        $tmp = @unserialize($result);
        return $tmp;
    }
177186
function GetById($type, $id){
        $newClass = NAMESPACE_ENTITIES . $type;
        if(class_exists ($newClass)) {
            $class = new $newClass();
            $primaryKey = ModelState::GetPrimary($class);
            if ($primaryKey != null)
                return $this->Get($type, $primaryKey . '=' . $id)->FirstOrDefault();

            return null;
        }

        throw new OwlException("Classe {$newClass} não encontrada", 1);
    }
934094
public static function isValidImage($id, $type, $className)
    {
        $isValid = Kwf_Media_Output_Component::isValid($id);
        if ($isValid == Kwf_Media_Output_IsValidInterface::VALID
            || $isValid == Kwf_Media_Output_IsValidInterface::VALID_DONT_CACHE
        ) {
            // Can be searched with ignore-visible because if it is invisble and
            // not allowed to show Kwf_Media_Output_Component::isValid would return
            // invalid or access_denied
            $c = Kwf_Component_Data_Root::getInstance()->getComponentById($id, array('ignoreVisible' => true));
            if (!$c) return Kwf_Media_Output_IsValidInterface::INVALID;
            if ($c->componentClass != $className) return Kwf_Media_Output_IsValidInterface::INVALID;
            $baseType = $c->getComponent()->getBaseType();
            $dim = $c->getComponent()->getImageDimensions();
            $imageData = $c->getComponent()->getImageDataOrEmptyImageData();
            $widths = Kwf_Media_Image::getResponsiveWidthSteps($dim, $imageData['dimensions']);
            $ok = false;
            foreach ($widths as $w) {
                if (str_replace('{width}', $w, $baseType) == $type) {
                    $ok = true;
                    break;
                }
            }
            if (!$ok) {
                $isValid = Kwf_Media_Output_IsValidInterface::INVALID;
            }
        }
        return $isValid;
    }
1080052
private function doLoadMetadata($type)
    {
        if (null !== $meta = $this->getFromMemory($type)) {
            // Found in memory.
            return $meta;
        }

        if (null !== $meta = $this->getFromCache($type)) {
            // Found in cache.
            $this->setToMemory($meta);
            return $meta;
        }
        return null;
    }
688187
public static function resource($value, $type = null): bool
    {
        if ($type !== null) {
            return is_resource($value) && $type === get_resource_type($value);
        }

        return is_resource($value);
    }
340953
public function isSatisfiedBy(ReturnType\TypeInterface $type)
    {
        if (true == $type->isRealType()) {
            return false;
        }

        return Types::T_OBJECT == $type->getDataType() && false === $type->isCollection();
    }