本文整理汇总了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/');
}
}
示例2: delete
function delete()
{
$id = getId();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
mysql_query("DELETE FROM list WHERE id='{$id}'") or mysql_error();
}
}
示例3: convertStr
public function convertStr($stringFrom)
{
if (preg_match("/[а-яА-Я]+/u", $stringFrom)) {
$name = explode('.', $stringFrom);
return getId() . '-' . time() . '.' . $name[1];
}
return $stringFrom;
}
示例4: funcTest
public function funcTest()
{
function getId($self)
{
return $self->getPrivateId();
}
return getId($this);
}
示例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');
}
示例6: getIdByNameArr
public function getIdByNameArr($_arrName)
{
$retArr = [];
foreach ($_arrName as $item) {
$id = getId($item);
array_push($retArr, $id);
}
return $retArr;
}
示例7: admin_back
public function admin_back()
{
if (getId() == null) {
Router::redirect('/');
}
if ($_POST['back']) {
Router::redirect('/admin/contacts/');
}
}
示例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');
}
示例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;
}
示例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;
}
示例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;
}
示例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']);
}
}
}
示例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;
}
示例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;
}
示例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;
}