本文整理汇总了PHP中CMS::user方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::user方法的具体用法?PHP CMS::user怎么用?PHP CMS::user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::user方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
/**
* @param string $key
* @param mixed $value
*
* @return mixed
*/
public function getOptions($key, $value)
{
return \CMS::user()->lists($this->valueField, $this->keyField)->all();
}
示例2: getUpdatedBy
/**
* @return User
*/
public function getUpdatedBy()
{
if (is_null($this->updated_by)) {
$this->updated_by = \CMS::user()->findOrNew($this->created_by);
}
return $this->updated_by;
}
示例3: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
foreach (\CMS::user()->all() as $user) {
DB::table('user_meta')->insert([['user_id' => $user->id, 'key' => WidgetManagerDashboard::WIDGET_SETTINGS_KEY, 'value' => '{"5756f21098fd0":{"id":"5756f21098fd0","type":"profiler","settings":[],"parameters":[],"size":{"x":5,"y":2,"max_size":[6,2],"min_size":[3,2]},"multiple":false,"packages":[],"updateSettingsPage":false},"5756f21263692":{"id":"5756f21263692","type":"kodicms_rss","settings":[],"parameters":[],"size":{"x":5,"y":2,"max_size":[5,10],"min_size":[3,2]},"multiple":false,"packages":[],"updateSettingsPage":false},"5756f218acc7f":{"id":"5756f218acc7f","type":"mini_calendar","settings":[],"parameters":[],"size":{"x":3,"y":1,"max_size":[5,1],"min_size":[3,1]},"multiple":false,"packages":[],"updateSettingsPage":false},"5756f21be3040":{"id":"5756f21be3040","type":"cache_button","settings":[],"parameters":[],"size":{"x":2,"y":1,"max_size":[2,1],"min_size":[2,1]},"multiple":false,"packages":[],"updateSettingsPage":false}}'], ['user_id' => $user->id, 'key' => WidgetManagerDashboard::WIDGET_BLOCKS_KEY, 'value' => '[{"col":1,"row":2,"x":5,"y":2,"max-size":[6,2],"min-size":[3,2],"id":"5756f21098fd0"},{"col":1,"row":4,"x":5,"y":2,"max-size":[5,10],"min-size":[3,2],"id":"5756f21263692"},{"col":1,"row":1,"x":3,"y":1,"max-size":[5,1],"min-size":[3,1],"id":"5756f218acc7f"},{"col":4,"row":1,"x":2,"y":1,"max-size":[2,1],"min-size":[2,1],"id":"5756f21be3040"}]']]);
}
}