public static function getTemplatesById()
{
if (null === self::$_templatesById) {
- self::$_templatesById = DB::table(self::$_table)->get()->pluck('template', 'id');
+ try {
+ self::$_templatesById = DB::table(self::$_table)->get()->pluck('template', 'id');
+ } catch (\Exception $e) {
+ self::$_templatesById = [];
+ }
}
return self::$_templatesById;
}
public static function getPagesList()
{
if (null === static::$_pagesList) {
- static::$_pagesList = DB::table(self::$_table)->orderBy('lft')->get()->pluck('name', 'id');
+ try {
+ static::$_pagesList = DB::table(self::$_table)->orderBy('lft')->get()->pluck('name', 'id');
+ } catch (Exception $e) {
+ static::$_pagesList = [];
+ }
}
return static::$_pagesList;
}
use CrudTrait;
use Sluggable;
use SluggableScopeHelpers;
+ use HasMediaTrait;
use HasTranslations {
update as protected updateTranslations;
create as protected createTranslations;
}
use RevisionableTrait;
- use HasMediaTrait;
use BunchOfFields {
addField as protected bunchAddField;
}
return $res;
}
+ public function getMediaInField($c){
+ if(null===$c || !$c){
+ return [];
+ }
+ return $this->getMedia($c);
+ }
+
}