Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Refreshing model metadata during development

Is there a way to reset the model metadata on every request?

This is possible for the views but I can't find in the docs to setup up the same thing for the model metadata.



81.2k
Accepted
answer

You can use the Memory adapter for meta-data:

<?php

$di['modelsMetadata'] = function() {
    $metaData = new \Phalcon\Mvc\Model\MetaData\Memory();
    return $metaData;
};

http://docs.phalconphp.com/en/latest/reference/models.html#caching-meta-data

I think if you don't set up any modelsMetadata, then the metaData gets refreshed every request.