当前位置: 首页>>代码示例>>PHP>>正文


PHP Channel::create方法代码示例

本文整理汇总了PHP中Channel::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Channel::create方法的具体用法?PHP Channel::create怎么用?PHP Channel::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Channel的用法示例。


在下文中一共展示了Channel::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     //
     $interactor = new CurlInteractor();
     $interactor->setResponseFactory(new SlackResponseFactory());
     $commander = new Commander($_ENV['SLACK_KEY'], $interactor);
     $response = $commander->execute('channels.list');
     $responseBody = $response->getBody();
     if (!$responseBody or !$responseBody['ok']) {
         throw new Exception('Sth Error Happened!');
     }
     foreach ($responseBody['channels'] as $chan) {
         if (!$chan['is_channel']) {
             continue;
         }
         $chanData = ['sid' => $chan['id'], 'name' => $chan['name'], 'created' => $chan['created'], 'creator' => $chan['creator'], 'purpose' => (object) $chan['purpose'], 'is_archived' => $chan['is_archived'], 'is_member' => $chan['is_member'], 'num_members' => $chan['num_members'], 'members' => $chan['members'], 'topic' => (object) $chan['topic']];
         if ($channel = Channel::where('sid', $chan['id'])->first()) {
             foreach ($chanData as $k => $v) {
                 $channel->{$k} = $v;
             }
             $channel->save();
         } else {
             $chanData['latest'] = 0;
             Channel::create($chanData);
         }
     }
 }
开发者ID:kenyiu,项目名称:slacklogs,代码行数:32,代码来源:LoadChannelsCommand.php

示例2: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Channel::create([]);
     }
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:7,代码来源:ChannelsTableSeeder.php

示例3: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('channels', function (Blueprint $table) {
         $table->integer('id');
         $table->string('name');
         $table->timestamps();
     });
     Channel::create(['id' => '1', 'name' => 'Booking.com']);
     Channel::create(['id' => '2', 'name' => 'Wotif.com']);
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:15,代码来源:2014_10_09_115110_create_channels_table.php

示例4:

             $object->format();
             require_once AmpConfig::get('prefix') . UI::find_template('show_add_channel.inc.php');
         }
     }
     UI::show_footer();
     exit;
 case 'create':
     if (AmpConfig::get('demo_mode')) {
         UI::access_denied();
         exit;
     }
     if (!Core::form_verify('add_channel', 'post')) {
         UI::access_denied();
         exit;
     }
     $created = Channel::create($_REQUEST['name'], $_REQUEST['description'], $_REQUEST['url'], $_REQUEST['type'], $_REQUEST['id'], $_REQUEST['interface'], $_REQUEST['port'], $_REQUEST['admin_password'], $_REQUEST['private'] ?: 0, $_REQUEST['max_listeners'], $_REQUEST['random'] ?: 0, $_REQUEST['loop'] ?: 0, $_REQUEST['stream_type'], $_REQUEST['bitrate']);
     if (!$created) {
         require_once AmpConfig::get('prefix') . UI::find_template('show_add_channel.inc.php');
     } else {
         $title = T_('Channel Created');
         show_confirmation($title, $body, AmpConfig::get('web_path') . '/browse.php?action=channel');
     }
     UI::show_footer();
     exit;
 case 'show_delete':
     $id = $_REQUEST['id'];
     $next_url = AmpConfig::get('web_path') . '/channel.php?action=delete&id=' . scrub_out($id);
     show_confirmation(T_('Channel Delete'), T_('Confirm Deletion Request'), $next_url, 1, 'delete_channel');
     UI::show_footer();
     exit;
 case 'delete':
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:channel.php


注:本文中的Channel::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。