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


PHP Company::insert方法代碼示例

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


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

示例1: testInsert

 public function testInsert()
 {
     $c = new Company();
     $c->name = 'Model Persister Company';
     $c->insert();
     $this->assertNotNull($c->id);
 }
開發者ID:scandio,項目名稱:troba,代碼行數:7,代碼來源:ModelPersistersTest.php

示例2: insert

 /**
  * @param : array $data
  * @return int $id
  */
 public static function insert($data)
 {
     if (!is_array($data) || !count($data)) {
         return;
     }
     $shipFromData = $data['shipFrom'];
     $shipToData = $data['shipTo'];
     $itemData = $data['item'];
     $companyData = $data['company'];
     $shipFromId = ShipFrom::insert($shipFromData);
     $shipToId = ShipTo::insert($shipToData);
     $itemId = Item::insert($itemData);
     $companyId = Company::insert($companyData);
     $orderData = array('reference_no' => 'SPR-' . rand(), 'created_on' => date('Y-m-d'), 'user_id' => User::getUserId(), 'ship_to' => $shipToId, 'ship_from' => $shipFromId, 'item_id' => $itemId, 'company_id' => $companyId);
     $id = DB::table('order')->insertGetId($orderData);
     return $id;
 }
開發者ID:yousafmalik786,項目名稱:shipping-crud,代碼行數:21,代碼來源:Order.php

示例3: Company

<?php

include_once $CFG->dirroot . "/lib/classes/" . "application/Company.Class.php5";
include_once $CFG->dirroot . "/lib/classes/" . "application/SubGroup.Class.php5";
$companyObj = new Company();
$dCreated = date('Y-m-d H:i:s');
$GeneralObj->getRequestVars();
$companyObj->setAllVar();
if ($mode == "Add") {
    # echo "<pre>";  print_r($_FILES) ; exit;
    $redirect_file = "index.php?file=m-companyadd";
    $GeneralObj->checkDuplicate('iCompanyId', 'Company', array('vCompanyCodeId'), $redirect_file, "Organization ID Already Exists ", $iCompanyId);
    $GeneralObj->checkDuplicate('iCompanyId', 'Company', array('vCompanyName'), $redirect_file, "Organization Name Already Exists ", $iCompanyId);
    $GeneralObj->checkDuplicate('iCompanyId', 'Company', array('vEmail'), $redirect_file, "Email Already Exists ", $iCompanyId);
    // $userObj->setdCreated($dCreated);
    $iCompanyId = $companyObj->insert();
    $group = new SubGroup();
    $group->createDefaultGroup($iCompanyId);
    $msg = MSG_ADD;
    $url = 'index.php?file=Company&AX=Yes&var_msg=' . $msg;
    header("Location:" . $url);
    exit;
} else {
    if ($mode == "Update") {
        $update_sql = "UPDATE SubGroup sg SET sg.eStatus = '" . $eStatus . "'\n\t\t\tWHERE sg.iCompanyId IN(" . $iCompanyId . ")";
        $obj->sql_query($update_sql);
        $redirect_file = "index.php?file=m-companyadd&mode=" . $mode . "&iCompanyId=" . $iCompanyId . "";
        $GeneralObj->checkDuplicate('iCompanyId', 'Company', array('vCompanyCodeId'), $redirect_file, "Organization ID Already Exists ", $iCompanyId);
        $GeneralObj->checkDuplicate('iCompanyId', 'Company', array('vCompanyName'), $redirect_file, "Organization Name Already Exists ", $iCompanyId);
        $GeneralObj->checkDuplicate('iCompanyId', 'Company', array('vEmail'), $redirect_file, "Email Already Exists ", $iCompanyId);
        $companyObj->update($iCompanyId);
開發者ID:redeyes1024,項目名稱:medlii_mlm_backend,代碼行數:31,代碼來源:companyadd_a.php

示例4: catch

        Flight::ok($array);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
Flight::route('GET /v1/main/company/@id', function ($id) {
    try {
        $object = Company::select($id);
        Flight::ok($object);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
Flight::route('POST /v1/main/company', function () {
    try {
        $object = Company::insert();
        Flight::ok($object);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
Flight::route('PUT /v1/main/company/@id', function ($id) {
    try {
        $object = Company::update($id);
        Flight::ok($object);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
Flight::route('DELETE /v1/main/company/@id', function ($id) {
    try {
開發者ID:rhalf,項目名稱:app_track,代碼行數:31,代碼來源:main.php

示例5: foreach

                 Company::insert($company);
             }
         } else {
             //分支將會被移出
             foreach ($_REQUEST as $key => $value) {
                 $key = strtolower($key);
                 $nokeys = array("type", "module", "action");
                 if (!in_array($key, $nokeys)) {
                     $company = new Company();
                     $company->content = empty($value) ? "" : $value;
                     $company->companyKey = $key;
                     if ($action == "update" && Company::exist($key)) {
                         //存在,並且需要更新
                         Company::update($company);
                     } else {
                         Company::insert($company);
                     }
                 }
             }
         }
     } else {
         if ($action == "del") {
             $id = isset($_REQUEST["companyId"]) ? $_REQUEST["companyId"] : 0;
             //是否允許重置添
             $company = new Company(_NONE);
             $company->id = $id;
             Company::delete($company);
         }
     }
 } catch (Exception $e) {
     $result = $e->getMessage();
開發者ID:BassYang1,項目名稱:YueXinChina,代碼行數:31,代碼來源:update.php


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