當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Network::from_array方法代碼示例

本文整理匯總了PHP中Network::from_array方法的典型用法代碼示例。如果您正苦於以下問題:PHP Network::from_array方法的具體用法?PHP Network::from_array怎麽用?PHP Network::from_array使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Network的用法示例。


在下文中一共展示了Network::from_array方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save($id = null)
 {
     if ($this->perm->can_create == 'y') {
         if ($_POST) {
             $save = new Network();
             if ($_POST['id'] == '') {
                 $show_no = $this->db->query("SELECT MAX(show_no)show_no FROM acm_network")->result();
                 $_POST['show_no'] = @$show_no[0]->show_no < 1 ? 1 : $show_no[0]->show_no + 1;
                 $_POST['created_by'] = $this->user->id;
             } else {
                 $_POST['updated_by'] = $this->user->id;
             }
             $save->from_array($_POST);
             $save->save();
             $action = $_POST['id'] > 0 ? 'UPDATE' : 'CREATE';
             save_logs($this->menu_id, $action, @$save->id, $action . ' ' . $save->title . ' Network');
         }
     }
     redirect("admin/networks");
 }
開發者ID:ultraauchz,項目名稱:asean_cultural_mapping,代碼行數:20,代碼來源:networks.php

示例2: get_mothership_info

 /**
  * get the details of mother network
  * @access public.
  * @param array of parameters 
  * format of $params
  * @return mother network details
  */
 public static function get_mothership_info()
 {
     Logger::log("[ Enter: function Network::get_mothership_info] \n");
     $sql = " SELECT * FROM {networks} WHERE is_active = 1 AND type = " . MOTHER_NETWORK_TYPE;
     $network = Dal::query_one_assoc($sql);
     if (empty($network)) {
         throw new PAException(MOTHER_NETWORK_NOT_DEFINED, "Configuration error: Mother network not configured.");
     }
     // we ned to set the network owner proprly
     // as it is set to 0 by default, which is not actually true
     if ($network['owner_id'] < 1) {
         // we use id = 1 for now as it seems there is no way to set it
         $network['owner_id'] = 1;
     }
     return Network::from_array($network);
     Logger::log("[ Exit: function Network::get_mothership_info] \n");
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:24,代碼來源:Network.php


注:本文中的Network::from_array方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。