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


PHP Collection::bindType方法代码示例

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


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

示例1: getActiveBots

 public function getActiveBots()
 {
     $sql = "SELECT id, queue_id, job_id\n\t\t\t\tFROM bots\n\t\t\t\tWHERE oauth_token_id = ?\n\t\t\t\tAND status != 'retired'\n\t\t\t\tORDER BY name";
     $bots = new Collection($sql, array($this->id));
     $bots->bindType('id', 'Bot');
     $bots->bindType('queue_id', 'Queue');
     $bots->bindType('job_id', 'Job');
     return $bots;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:9,代码来源:oauthtoken.php

示例2: pretty

 public function pretty()
 {
     $this->assertAdmin();
     $this->setTitle("Latest Completed Jobs");
     $sql = "SELECT id, webcam_image_id FROM jobs WHERE webcam_image_id != 0 AND status = 'complete' ORDER BY finished_time DESC";
     $available = new Collection($sql);
     $available->bindType('id', 'Job');
     $available->bindType('webcam_image_id', 'StorageInterface');
     $this->set('jobs', $available->getRange(0, 24));
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:10,代码来源:job.php

示例3: byContentAndType

 public static function byContentAndType($id, $type)
 {
     if (!array_key_exists($type, self::$types)) {
         $comments = Collection::none();
     } else {
         //look up the comments
         $sql = "SELECT id, user_id\n\t\t\t\tFROM comments\n\t\t\t\tWHERE content_id = ?\n\t\t\t\tAND content_type = ?\n\t\t\t\tORDER BY comment_date ASC\n\t\t\t";
         $comments = new Collection($sql, array($id, $type));
     }
     $comments->bindType('id', 'Comment');
     $comments->bindType('user_id', 'User');
     return $comments;
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:13,代码来源:comment.php

示例4: byContentAndType

 public static function byContentAndType($id, $type)
 {
     //some validation
     $id = (int) $id;
     if (!in_array($type, array('job', 'bot'))) {
         return new Comment();
     }
     //look up the comments
     $sql = "SELECT id, user_id\n\t\t\t\tFROM comments\n\t\t\t\tWHERE content_id = ?\n\t\t\t\tAND content_type = ?\n        \t\tORDER BY comment_date ASC\n\t\t\t";
     $comments = new Collection($sql, array($id, $type));
     $comments->bindType('id', 'Comment');
     $comments->bindType('user_id', 'User');
     return $comments;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:14,代码来源:comment.php

示例5: getChildren

 public function getChildren()
 {
     $sql = "SELECT id\n\t\t    \tFROM s3_files\n\t\t    \tWHERE parent_id = ?\n\t\t    \tORDER BY id DESC";
     $children = new Collection($sql, array($this->id));
     $children->bindType('id', get_class($this));
     return $children;
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:7,代码来源:StorageInterface.php

示例6: getStream

 public static function getStream(User $user)
 {
     $sql = "SELECT id\n\t\t\t\tFROM activities\n\t\t\t\tWHERE user_id = ?\n\t\t\t\tORDER BY id DESC\n\t\t\t";
     $stream = new Collection($sql, array($user->id));
     $stream->bindType('id', 'Activity');
     return $stream;
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:7,代码来源:activity.php

示例7: getSliceJobs

 public function getSliceJobs()
 {
     $sql = "SELECT id\n        \t\tFROM slice_jobs\n        \t\tWHERE slice_config_id = ?\n        \t\tORDER BY id DESC";
     $sliceJobs = new Collection($sql, array($this->id));
     $sliceJobs->bindType('id', 'SliceJob');
     return $sliceJobs;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:7,代码来源:sliceconfig.php

示例8: getStream

 public static function getStream(User $user)
 {
     $sql = "SELECT activity, action_date\n\t\t\t\tFROM activities\n\t\t\t\tWHERE user_id = ?\n\t\t\t\tORDER BY id DESC\n\t\t\t";
     $stream = new Collection($sql, array($user->id));
     $stream->bindValue('activity');
     $stream->bindType('action_date', 'DateTime');
     $stream->bindData('user_link', $user->getLink());
     return $stream;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:9,代码来源:activity.php

示例9: getMine

 public static function getMine($all = false)
 {
     if (User::isLoggedIn()) {
         $sql = "SELECT id FROM notifications WHERE id > ? AND (to_user_id = ? or to_user_id IS NULL)";
         $data = array();
         if ($all === false) {
             $data[] = User::$me->get('last_notification');
         } else {
             $data[] = 0;
             // Get all of them
         }
         $data[] = User::$me->id;
         $notifications = new Collection($sql, $data);
         $notifications->bindType('id', 'Notification');
         return $notifications;
     } else {
         // Return empty collection
         return Collection::none();
     }
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:20,代码来源:notification.php

示例10: live

 public function live()
 {
     $this->assertAdmin();
     $this->setTitle("Live Bots View");
     $sql = "SELECT id, queue_id, job_id FROM bots WHERE webcam_image_id != 0 AND last_seen > NOW() - 3600 ORDER BY last_seen DESC";
     $bots = new Collection($sql);
     $bots->bindType('id', 'Bot');
     $bots->bindType('queue_id', 'Queue');
     $bots->bindType('job_id', 'Job');
     $this->set('bots', $bots->getRange(0, 24));
     $this->set('dashboard_style', 'medium_thumbnails');
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:12,代码来源:bot.php

示例11: getErrorLog

 public function getErrorLog()
 {
     $sql = "SELECT id\n\t\t    \tFROM error_log\n\t\t    \tWHERE bot_id = ?\n\t\t    \tORDER BY error_date DESC";
     $logs = new Collection($sql, array($this->id));
     $logs->bindType('id', 'ErrorLog');
     return $logs;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:7,代码来源:bot.php

示例12: getMyConfigs

 public function getMyConfigs()
 {
     $sql = "SELECT id\n\t\t    \tFROM slice_configs\n\t\t    \tWHERE engine_id = ?\n\t\t      \tAND (user_id = ? OR id = ?)\n\t\t    \tORDER BY config_name";
     $configs = new Collection($sql, array($this->id, User::$me->id, $this->get('default_config_id')));
     $configs->bindType('id', 'SliceConfig');
     return $configs;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:7,代码来源:sliceengine.php

示例13: getJobsRequiringAction

 public static function getJobsRequiringAction()
 {
     $sql = "SELECT id, input_id, job_id\n\t\t    \tFROM slice_jobs\n\t\t    \tWHERE status = 'pending'\n\t\t    \tORDER BY finish_date ASC";
     $jobs = new Collection($sql);
     $jobs->bindType('id', 'SliceJob');
     $jobs->bindType('input_id', STORAGE_METHOD);
     $jobs->bindType('job_id', 'Job');
     return $jobs;
 }
开发者ID:JoonasMelin,项目名称:BotQueue,代码行数:9,代码来源:slicejob.php

示例14: getApps

 public function getApps()
 {
     $sql = "SELECT id\n\t\t\t\tFROM oauth_token\n\t\t\t\tWHERE consumer_id = ?\n\t\t\t\tAND user_id = ?";
     $apps = new Collection($sql, array($this->id, User::$me->id));
     $apps->bindType('id', 'OAuthToken');
     return $apps;
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:7,代码来源:oauthconsumer.php

示例15: getMySliceConfigs

 public function getMySliceConfigs()
 {
     $sql = "SELECT id, engine_id\n\t\t\t\tFROM slice_configs\n\t\t\t\tWHERE user_id = ?\n\t\t\t\tORDER BY engine_id DESC";
     $configs = new Collection($sql, array($this->id));
     $configs->bindType('id', 'SliceConfig');
     $configs->bindType('engine_id', 'SliceEngine');
     return $configs;
 }
开发者ID:eric116,项目名称:BotQueue,代码行数:8,代码来源:user.php


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