oc-social-plugin/models/Setting.php

32 lines
645 B
PHP
Raw Normal View History

2021-10-28 22:35:15 +02:00
<?php namespace Zoomyboy\Social\Models;
use Model;
/**
* Setting Model
*/
class Setting extends Model
{
public $implement = ['System.Behaviors.SettingsModel'];
public $settingsCode = 'zoomyboy_social';
public $settingsFields = 'fields.yaml';
public function getSynchedPagesOptions(): array
{
return Page::get()->pluck('name', 'id')->toArray();
}
public static function synchedPages(): array
{
return (new static([]))->getSynchedPagesOptions();
}
public function getInstagramUsersOptions(): array
{
return InstagramUser::get()->pluck('name', 'id')->toArray();
}
}