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


PHP getId函数代码示例

本文整理汇总了PHP中getId函数的典型用法代码示例。如果您正苦于以下问题:PHP getId函数的具体用法?PHP getId怎么用?PHP getId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: edit

 public function edit()
 {
     if (getId() == '') {
         Router::redirect('/');
     }
     if ($_POST) {
         if (!isset($_POST['back'])) {
             $id = isset($_POST['id']) ? (int) $_POST['id'] : null;
             $res_post = $_POST;
             $result = $this->model->save($res_post, $id);
             if ($result) {
                 Session::setFlash(__('page_was_saved', 'Page was saved'));
             } else {
                 Session::setFlash(__('page_was_not_saved', 'Page was not saved'));
             }
         }
         Router::redirect('/pages/profileview/' . getId());
     }
     if (isset($this->params[0])) {
         $this->data['pages'] = $this->model->getById($this->params[0]);
     } else {
         Session::setFlash(__('Wrong_page_id', 'Wrong page id'));
         Router::redirect('/pages/');
     }
 }
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:25,代码来源:pages.controller.php

示例2: delete

function delete()
{
    $id = getId();
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        mysql_query("DELETE FROM list WHERE id='{$id}'") or mysql_error();
    }
}
开发者ID:jonycodes,项目名称:Blog,代码行数:7,代码来源:delete_post.php

示例3: convertStr

 public function convertStr($stringFrom)
 {
     if (preg_match("/[а-яА-Я]+/u", $stringFrom)) {
         $name = explode('.', $stringFrom);
         return getId() . '-' . time() . '.' . $name[1];
     }
     return $stringFrom;
 }
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:8,代码来源:model.class.php

示例4: funcTest

 public function funcTest()
 {
     function getId($self)
     {
         return $self->getPrivateId();
     }
     return getId($this);
 }
开发者ID:masa69,项目名称:php-sample,代码行数:8,代码来源:class.php

示例5: BxWallPage

 function BxWallPage($sOwner, &$oWall)
 {
     $this->_sOwner = $sOwner;
     $this->_oWall =& $oWall;
     $this->oProfileGen = new BxBaseProfileGenerator(getId($sOwner, 0));
     $this->aConfSite = $GLOBALS['site'];
     $this->aConfDir = $GLOBALS['dir'];
     parent::BxDolPageView('wall');
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:9,代码来源:index.php

示例6: getIdByNameArr

 public function getIdByNameArr($_arrName)
 {
     $retArr = [];
     foreach ($_arrName as $item) {
         $id = getId($item);
         array_push($retArr, $id);
     }
     return $retArr;
 }
开发者ID:okagen,项目名称:fjn,代码行数:9,代码来源:Owner.php

示例7: admin_back

 public function admin_back()
 {
     if (getId() == null) {
         Router::redirect('/');
     }
     if ($_POST['back']) {
         Router::redirect('/admin/contacts/');
     }
 }
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:9,代码来源:contacts.controller.php

示例8: __construct

 function __construct($sOwner, &$oWall)
 {
     $this->_sOwner = $sOwner;
     $this->_oWall =& $oWall;
     $this->oProfileGen = new BxBaseProfileGenerator(getId($sOwner, 0));
     $this->aConfSite = $GLOBALS['site'];
     $this->aConfDir = $GLOBALS['dir'];
     parent::__construct('wall');
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:9,代码来源:index.php

示例9: getRecentProducts

 public function getRecentProducts()
 {
     // call model to fetch data
     $arr_products = array();
     $products = Mage::getModel("orderedproducts/orderedproducts")->getOrderedProducts();
     foreach ($products as $product) {
         $arr_products[] = array('id' => $product - ­ > getId(), 'name' => $product->getName(), 'url' => $product->getProductUrl());
     }
     return $arr_products;
 }
开发者ID:prancius,项目名称:customer-products,代码行数:10,代码来源:OrderedProducts.php

示例10: getRecord

 function getRecord($id, $useUuid = false)
 {
     $therecord = parent::getRecord($id, $useUuid);
     /**
      *   If type is credit, get the receipt id
      *   else get the invoice id
      */
     if ($therecord["type"] == "credit") {
         $therecord["editrelatedid"] = getId($this->db, "tbld:43678406-be25-909b-c715-7e2afc7db601", $therecord["relatedid"]);
     } else {
         $therecord["editrelatedid"] = getId($this->db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883", $therecord["relatedid"]);
     }
     return $therecord;
 }
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:14,代码来源:aritems.php

示例11: __construct

 public function __construct($rows, $cols = null, $opts = array())
 {
     // Make sure rows are all arrays
     foreach ($rows as $k => $row) {
         if (!is_array($row)) {
             $rows[$k] = (array) $rows[$k];
         }
     }
     if (!isset($cols)) {
         $cols = array();
         if (count($rows) > 0) {
             $row = $rows[0];
             foreach ($row as $k => $v) {
                 if ($k === '__meta__') {
                     continue;
                 }
                 $cols[] = array('label' => $k, 'name' => $k);
             }
         }
     }
     $flds = array('table', 'cssClass', 'canEdit', 'canAdd', 'canDelete', 'rowActions', 'newParams', 'params', 'addButtonLabel');
     foreach ($flds as $fld) {
         if (isset($opts[$fld])) {
             $this->{$fld} = $opts[$fld];
         }
     }
     $this->cssClass .= ' xf-portlet';
     $decorateRow = null;
     if (isset($opts['decorateRow']) and is_callable($opts['decorateRow'])) {
         $decorateRow = $opts['decorateRow'];
     }
     foreach ($rows as $k => $row) {
         if (!isset($rows[$k]['__meta__'])) {
             $rows[$k]['__meta__'] = array();
         }
         $dfRec = new \Dataface_Record($this->table, array());
         if (!@$rows[$k]['__meta__']['recordId']) {
             $dfRec->setValues($row);
             $rows[$k]['__meta__']['recordId'] = $dfRec - getId();
         }
         $rows[$k]['__meta__']['record'] = $dfRec;
         if (isset($decorateRow)) {
             $decorateRow($rows[$k]);
         }
     }
     $this->cols = $cols;
     $this->rows = $rows;
     $this->opts = $opts;
 }
开发者ID:Zunair,项目名称:xataface,代码行数:49,代码来源:Portlet.php

示例12: display_posts

function display_posts($name)
{
    include 'html/showposts.php';
    $conn = connect();
    $id = getId($name);
    mysql_select_db("unihub", $conn);
    $query = "SELECT * FROM posts WHERE `id` = '{$id}'";
    $result = mysql_query($query, $conn) or die(mysql_error());
    if (mysql_num_rows($result) > 0) {
        // output data of each row
        while ($row = mysql_fetch_array($result)) {
            show_posts($row['title'], $row['thumb-desc'], $row['published'], $row['avatar'], $row['feature'], $row['main-desc'], $row['likes'], $row['comments']);
        }
    }
}
开发者ID:SignalFire123,项目名称:PHP-Site,代码行数:15,代码来源:main.php

示例13: CreateOperator

 function CreateOperator($_loginId, $_fullName, $_email, $_permissions, $_webspace, $_passwordMD5, $_administrator, $_groups, $_language)
 {
     $operator = new Operator(getId(USER_ID_LENGTH), $_loginId);
     $operator->Load();
     $operator->Fullname = $_fullName;
     $operator->Email = $_email;
     $operator->PermissionSet = $_permissions;
     $operator->Webspace = $_webspace;
     $operator->Password = $_passwordMD5;
     $operator->Level = $_administrator ? 1 : 0;
     $operator->Groups = $_groups;
     $operator->Language = $_language;
     $operator->Save(true);
     return $operator;
 }
开发者ID:bgabor,项目名称:RenaniaOpencart,代码行数:15,代码来源:api.php

示例14: _t_err

            }
            if (!$sMessageBody) {
                $sErrorMessage = '_Mailbox description empty';
            }
            if (!$vRecipientID) {
                $sErrorMessage = '_Mailbox recipient empty';
            }
            $sOutputHtml = !$sErrorMessage ? $oMailBox->sendMessage($sMessageSubject, $sMessageBody, $vRecipientID, $aComposeSettings) : _t_err($sErrorMessage);
            break;
        case 'auto_complete':
            if ($sAutoCompleteQ) {
                $sOutputHtml = $oMailBox->getAutoCompleteList($sAutoCompleteQ);
            }
            break;
        case 'get_thumbnail':
            $iRecipientID = getId($vRecipientID);
            if ($iRecipientID) {
                $sOutputHtml = get_member_thumbnail($iRecipientID, 'none');
            }
            break;
    }
    // try to define the callback function name ;
    if (isset($_GET['callback_function']) and in_array($_GET['callback_function'], $aCallbackFunctions)) {
        if (method_exists($oMailBox, $_GET['callback_function'])) {
            $sOutputHtml = $oMailBox->{$_GET['callback_function']}();
        }
    }
    header('Content-Type: text/html; charset=utf-8');
    echo $sOutputHtml;
    exit;
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:31,代码来源:mail.php

示例15: selectCommenti

function selectCommenti($scout_idscout)
{
    $database = connect();
    $res = $database->select("commenti", ['[>]utenti' => ['idutenti' => 'id']], ['commenti.id', 'commenti.idutenti', 'utenti.utente(username)', 'utenti.photo', 'commenti.data', 'commenti.titolo', 'commenti.testo'], ['commenti.scout_idscout[=]' => $scout_idscout]);
    $id = getId();
    foreach ($res as &$r) {
        if ($r['idutenti'] == $id) {
            $r['owner'] = True;
        } else {
            $r['owner'] = False;
        }
    }
    return $res;
}
开发者ID:edotassi,项目名称:advanced-ppu,代码行数:14,代码来源:query.php


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