Bring Asset in line with inTheme

This commit is contained in:
Samuel Georges 2016-03-17 19:28:29 +11:00
parent 045d186960
commit 7f209d2df9
1 changed files with 14 additions and 0 deletions

View File

@ -92,6 +92,20 @@ class Asset extends Extendable
return (new static($theme))->find($fileName); return (new static($theme))->find($fileName);
} }
/**
* Prepares the theme datasource for the model.
* @param \Cms\Classes\Theme $theme Specifies a parent theme.
* @return $this
*/
public static function inTheme($theme)
{
if (is_string($theme)) {
$theme = Theme::load($theme);
}
return new static($theme);
}
/** /**
* Find a single template by its file name. * Find a single template by its file name.
* *