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


PHP self::add方法代码示例

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


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

示例1: suite

 public static function suite()
 {
     $bus = new Sabel_Bus();
     Sabel::fileUsing(dirname(__FILE__) . DS . "paginators" . DS . "Base.php", true);
     $suite = new self();
     $suite->add("Paginators_Status");
     $suite->add("Paginators_Follower");
     return $suite;
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:9,代码来源:Paginators.php

示例2: suite

 public static function suite()
 {
     Sabel::fileUsing(dirname(__FILE__) . DS . "logics" . DS . "Base.php", true);
     $suite = new self();
     $suite->add("Logics_Register");
     $suite->add("Logics_Status");
     $suite->add("Logics_Follow");
     $suite->add("Logics_User");
     return $suite;
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:10,代码来源:Logics.php

示例3: getDefaultChain

 /**
  * Get the default chain to use with clients
  *
  * @return CompositeFactory
  */
 public static function getDefaultChain(ClientInterface $client)
 {
     $chain = new self();
     $description = $client->getDescription();
     if ($description instanceof ServiceDescription) {
         $chain->add(new ServiceDescriptionFactory($description));
     }
     $chain->add(new ConcreteClassFactory($client));
     return $chain;
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:15,代码来源:CompositeFactory.php

示例4: install

 public static function install(Migration $migration)
 {
     global $DB;
     $table = getTableForItemType(__CLASS__);
     if (!TableExists($table) && !TableExists("glpi_dropdown_plugin_order_taxes")) {
         $migration->displayMessage("Installing {$table}");
         //Install
         $query = "CREATE TABLE `glpi_plugin_order_ordertaxes` (\n                  `id` int(11) NOT NULL auto_increment,\n                  `name` varchar(255) collate utf8_unicode_ci default NULL,\n                  `comment` text collate utf8_unicode_ci,\n                  PRIMARY KEY  (`id`),\n                  KEY `name` (`name`)\n               ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
         $DB->query($query) or die($DB->error());
         $taxes = new self();
         foreach (array('20', '5.5', '19.6') as $tax) {
             $taxes->add(array('name' => $tax));
         }
     } else {
         //Update
         $migration->displayMessage("Migrating {$table}");
         //1.2.0
         $migration->renameTable("glpi_dropdown_plugin_order_taxes", $table);
         $migration->changeField($table, "ID", "id", "int(11) NOT NULL auto_increment");
         $migration->changeField($table, "name", "name", "varchar(255) collate utf8_unicode_ci default NULL");
         $migration->changeField($table, "comments", "comment", "text collate utf8_unicode_ci");
         $migration->migrationOneTable($table);
         //Remplace , by . in taxes
         foreach ($DB->request("SELECT `name` FROM `{$table}`") as $data) {
             if (strpos($data["name"], ',')) {
                 $name = str_replace(',', '.', $data["name"]);
                 $query = "UPDATE `{$table}`\n                         SET `name` = '" . $name . "'\n                         WHERE `name`= '" . $data["name"] . "'";
                 $DB->query($query) or die($DB->error());
             }
         }
     }
 }
开发者ID:equinoxefr,项目名称:order,代码行数:32,代码来源:ordertax.class.php

示例5: createFirstAccess

 static function createFirstAccess($ID)
 {
     $myProf = new self();
     if (!$myProf->getFromDBByProfile($ID)) {
         $myProf->add(array('profiles_id' => $ID, 'order' => 'w', 'reference' => 'w', 'validation' => 'w', 'cancel' => 'w', 'undo_validation' => 'w', 'bill' => 'w', 'delivery' => 'w', 'generate_order_odt' => 'w'));
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:7,代码来源:profile.class.php

示例6: log

 /**
  * Log an event.
  *
  * Log the event $event on the glpi_event table with all the others args, if
  * $level is above or equal to setting from configuration.
  *
  * @param $items_id
  * @param $type
  * @param $level
  * @param $service
  * @param $event
  **/
 static function log($items_id, $type, $level, $service, $event)
 {
     global $DB;
     $input = array('items_id' => intval($items_id), 'type' => $DB->escape($type), 'date' => $_SESSION["glpi_currenttime"], 'service' => $DB->escape($service), 'level' => intval($level), 'message' => $DB->escape($event));
     $tmp = new self();
     return $tmp->add($input);
 }
开发者ID:remicollet,项目名称:glpi,代码行数:19,代码来源:event.class.php

示例7: sortByDependencies

 /**
  * @return MoodlePluginCollection
  */
 public function sortByDependencies()
 {
     $elements = [];
     foreach ($this->items as $item) {
         $elements[$item->getComponent()] = [];
     }
     // Loop through a second time, only adding dependencies that exist in our list.
     foreach ($this->items as $item) {
         $dependencies = $item->getDependencies();
         foreach ($dependencies as $dependency) {
             if (array_key_exists($dependency, $elements)) {
                 $elements[$item->getComponent()][] = $dependency;
             }
         }
     }
     $sorter = new StringSort($elements);
     $results = $sorter->sort();
     $sorted = new self();
     foreach ($results as $result) {
         foreach ($this->items as $item) {
             if ($result === $item->getComponent()) {
                 $sorted->add($item);
                 break;
             }
         }
     }
     if ($this->count() !== $sorted->count()) {
         throw new \LogicException('The sorted list of plugins does not match the size of original list');
     }
     return $sorted;
 }
开发者ID:moodlerooms,项目名称:moodle-plugin-ci,代码行数:34,代码来源:MoodlePluginCollection.php

示例8: createAdminAccess

 static function createAdminAccess($ID)
 {
     $myProf = new self();
     if (!$myProf->getFromDB($ID)) {
         $myProf->add(array('id' => $ID, 'show_vip_tab' => '1'));
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:7,代码来源:profile.class.php

示例9: createFirstAccess

 static function createFirstAccess($ID)
 {
     $myProf = new self();
     if (!$myProf->getFromDBByProfile($ID)) {
         $myProf->add(array('profiles_id' => $ID, 'addressing' => 'w', 'use_ping_in_equipment' => 1));
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:7,代码来源:profile.class.php

示例10: createAdminAccess

 static function createAdminAccess($ID)
 {
     $myProfil = new self();
     if (!$myProfil->getFromDB($ID)) {
         $myProfil->add(array('id' => $ID, 'show_ticketmail_onglet' => '1'));
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:7,代码来源:profile.class.php

示例11: createFirstConfig

 static function createFirstConfig()
 {
     $conf = new self();
     if (!$conf->getFromDB(1)) {
         $conf->add(array('id' => 1, 'add_waiting' => 1));
     }
 }
开发者ID:pluginsGLPI,项目名称:timelineticket,代码行数:7,代码来源:config.class.php

示例12: init

 public static function init($run = true)
 {
     static $console;
     if (!$console) {
         // 实例化console
         $console = new self('Think Console', '0.1');
         // 读取指令集
         if (is_file(CONF_PATH . 'command' . EXT)) {
             $commands = (include CONF_PATH . 'command' . EXT);
             if (is_array($commands)) {
                 foreach ($commands as $command) {
                     if (class_exists($command) && is_subclass_of($command, "\\think\\console\\command\\Command")) {
                         // 注册指令
                         $console->add(new $command());
                     }
                 }
             }
         }
     }
     if ($run) {
         // 运行
         $console->run();
     } else {
         return $console;
     }
 }
开发者ID:GDdark,项目名称:cici,代码行数:26,代码来源:Console.php

示例13: createFirstAccess

 static function createFirstAccess($ID)
 {
     $myProf = new self();
     if (!$myProf->getFromDBByProfile($ID)) {
         $myProf->add(array('profiles_id' => $ID, 'mobile_user' => 'w'));
     }
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:7,代码来源:profile.class.php

示例14: toMapped

 /**
  * @return OrderChain
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     $chain = new self();
     foreach ($this->chain as $order) {
         $chain->add($order->toMapped($dao, $query));
     }
     return $chain;
 }
开发者ID:justthefish,项目名称:hesper,代码行数:11,代码来源:OrderChain.php

示例15: fromArray

 public static function fromArray($type, array $array)
 {
     $list = new self($type);
     foreach ($array as $element) {
         $list->add($element);
     }
     return $list;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:8,代码来源:ArrayList.php


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