当前位置: 首页>>代码示例>>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;未经允许,请勿转载。