method getCachedModel documentation in bbn\Mvc\Controller
This will get the cached model. There is no order for the arguments.
function()
{
$args = \func_get_args();
$die = false;
$ttl = 0;
foreach ($args as $a) {
if (\is_string($a) && \strlen($a)) {
$path = $a;
}
elseif (\is_array($a)) {
$data = $a;
}
elseif (\is_int($a)) {
$ttl = $a;
}
elseif (\is_bool($a)) {
$die = $a;
}
}
if (!isset($path)) {
$path = $this->_path;
}
elseif (strpos($path, './') === 0) {
$path = $this->getCurrentDir() . substr($path, 1);
}
if (!isset($data)) {
$data = $this->data;
}
$m = $this->_mvc->getCachedModel($path, $data, $this, $ttl);
if (\is_object($m)) {
$m = X::toArray($m);
}
if (!\is_array($m)) {
if ($die) {
throw new \Exception(X::_("$path is an invalid model"));
}
return [];
}
return $m;
}
This will get the cached model. There is no order for the arguments. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions