當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。