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


PHP ipDb函数代码示例

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


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

示例1: searchQuery

 public function searchQuery($searchVariables)
 {
     if (isset($searchVariables[$this->field]) && $searchVariables[$this->field] !== '') {
         return ' `' . $this->field . '` = ' . ipDb()->getConnection()->quote($searchVariables[$this->field] * 100) . '';
     }
     return null;
 }
开发者ID:x33n,项目名称:ImpressPages,代码行数:7,代码来源:Currency.php

示例2: getError

 /**
  * Get error
  *
  * @param array $values
  * @param int $valueKey
  * @param $environment
  * @return string|bool
  */
 public function getError($values, $valueKey, $environment)
 {
     if (!array_key_exists($valueKey, $values)) {
         return false;
     }
     if ($values[$valueKey] == '' && empty($this->data['allowEmpty'])) {
         return false;
     }
     $table = $this->data['table'];
     $idField = empty($this->data['idField']) ? 'id' : $this->data['idField'];
     $row = ipDb()->selectRow($table, '*', array($valueKey => $values[$valueKey]));
     if (!$row) {
         return false;
     }
     if (isset($values[$idField]) && $values[$idField] == $row[$idField]) {
         return false;
     }
     if ($this->errorMessage !== null) {
         return $this->errorMessage;
     }
     if ($environment == \Ip\Form::ENVIRONMENT_ADMIN) {
         $errorText = __('The value should be unique', 'Ip-admin');
     } else {
         $errorText = __('The value should be unique', 'Ip');
     }
     return $errorText;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:35,代码来源:Unique.php

示例3: getList

 /**
  * @param string $languageCode
  * @param int $parentId
  * @return array
  */
 protected static function getList($languageCode, $parentId)
 {
     $pages = ipDb()->selectAll('page', '*', array('parentId' => $parentId, 'isDeleted' => 0), 'ORDER BY `pageOrder`');
     $answer = array();
     //generate jsTree response array
     foreach ($pages as $page) {
         $pageData = array();
         $pageData['state'] = 'closed';
         $jsTreeId = 'page_' . $page['id'];
         if (!empty($_SESSION['Pages.nodeOpen'][$jsTreeId])) {
             $pageData['state'] = 'open';
         }
         $children = self::getList($languageCode, $page['id']);
         if (count($children) === 0) {
             $pageData['children'] = false;
             $pageData['state'] = 'leaf';
         }
         $pageData['children'] = $children;
         if ($page['isVisible']) {
             $icon = '';
         } else {
             $icon = ipFileUrl('Ip/Internal/Pages/assets/img/file_hidden.png');
         }
         $pageData['li_attr'] = array('id' => $jsTreeId, 'rel' => 'page', 'languageId' => $languageCode, 'pageId' => $page['id']);
         $pageData['data'] = array('title' => $page['title'] . '', 'icon' => $icon);
         //transform null into empty string. Null break JStree into infinite loop
         $pageData['text'] = htmlspecialchars($page['title']);
         $answer[] = $pageData;
     }
     return $answer;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:36,代码来源:JsTreeHelper.php

示例4: generatePasswordResetSecret

 private static function generatePasswordResetSecret($userId)
 {
     $secret = md5(ipConfig()->get('sessionName') . uniqid());
     $data = array('resetSecret' => $secret, 'resetTime' => time());
     ipDb()->update('administrator', $data, array('id' => $userId));
     return $secret;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Model.php

示例5: searchQuery

 public function searchQuery($searchVariables)
 {
     if (isset($searchVariables[$this->field]) && $searchVariables[$this->field] !== '') {
         return ' `' . $this->field . '` like ' . ipDb()->getConnection()->quote('%' . json_encode($searchVariables[$this->field]) . '%') . '';
     }
     return null;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Checkboxes.php

示例6: checkIfChildren

 public static function checkIfChildren($parentIds, $id)
 {
     $parentIds = implode(',', $parentIds);
     if (empty($parentIds)) {
         return false;
     }
     $table = ipTable('page');
     $sql = "SELECT `id` FROM {$table} WHERE `parentId` IN ({$parentIds}) AND `isVisible` = 1 AND `isDeleted` = 0 ";
     $results = ipDb()->fetchAll($sql);
     $ids = array();
     $found = false;
     foreach ($results as $result) {
         $ids[] = $result['id'];
         if ($result['id'] == $id) {
             $found = true;
             break;
         }
     }
     if ($found) {
         return true;
     } elseif (!empty($ids)) {
         return self::checkIfChildren($ids, $id);
     } else {
         return false;
     }
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:26,代码来源:Model.php

示例7: removePermission

 public static function removePermission($permission, $administratorId = null)
 {
     if ($administratorId === null) {
         $administratorId = ipAdminId();
     }
     $condition = array('permission' => $permission, 'administratorId' => $administratorId);
     ipDb()->delete('permission', $condition);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:8,代码来源:AdminPermissionsModel.php

示例8: getByCode

 public static function getByCode($languageCode)
 {
     $row = ipDb()->selectRow('language', '*', array('code' => $languageCode));
     if (!$row) {
         return null;
     }
     return new self($row['id'], $row['code'], $row['url'], $row['title'], $row['abbreviation'], $row['isVisible'], $row['textDirection']);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:8,代码来源:Language.php

示例9: veryEmail_10

 public static function veryEmail_10($vcode)
 {
     $fcode = substr($vcode, 0, strpos($vcode, '-!'));
     $mail = substr($vcode, strpos($vcode, '-!') + 2, 250);
     ipDb()->update('comments', array('approved' => '1'), array('verification_code' => $fcode, 'email' => $mail));
     $data = array('message' => __('Your email address has been verified. Thank you.', 'Comments'));
     return ipView('view/mailVerified.php', $data)->render();
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:8,代码来源:Slot.php

示例10: findFiles

 /**
  * Find all files bind to particular module
  */
 public function findFiles($plugin, $instanceId = null)
 {
     $where = array('plugin' => $plugin);
     if ($instanceId !== null) {
         $where['instanceId'] = $instanceId;
     }
     return ipDb()->selectAll('repository_file', '*', $where);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:11,代码来源:Model.php

示例11: ipWidgetDuplicated

 public static function ipWidgetDuplicated($data)
 {
     $oldId = $data['oldWidgetId'];
     $newId = $data['newWidgetId'];
     $newRevisionId = ipDb()->selectValue('widget', 'revisionId', array('id' => $newId));
     $widgetTable = ipTable('widget');
     $sql = "\n            UPDATE\n                {$widgetTable}\n            SET\n                `blockName` = REPLACE(`blockName`, 'block_" . (int) $oldId . "', 'block_" . (int) $newId . "')\n            WHERE\n                `revisionId` = :newRevisionId\n            ";
     ipDb()->execute($sql, array('newRevisionId' => $newRevisionId));
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:9,代码来源:Event.php

示例12: getAll

 /**
  * Get all storage values
  *
  * @return array Key=>value array of all storage values
  */
 public function getAll()
 {
     $values = ipDb()->selectAll($this->tableName, array($this->keyColumn, $this->valueColumn), array($this->namespaceColumn => $this->namespace));
     $result = array();
     foreach ($values as $value) {
         $result[$value[$this->keyColumn]] = json_decode($value[$this->valueColumn], true);
     }
     return $result;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:14,代码来源:ValueStorage.php

示例13: dropDataTableRepository

 /**
  * Drops the datatable repository db table
  */
 private function dropDataTableRepository()
 {
     $ipTable = ipTable(TableRepository::DATA_TABLE_REPOSITORY);
     $sql = "\n            DROP TABLE {$ipTable}\n        ";
     try {
         ipDb()->execute($sql);
     } catch (\Ip\Exception\Db $e) {
         ipLog()->error("Could not drop repository table. Statement: {$sql}, Message: " . $e->getMessage());
     }
 }
开发者ID:hmuralt,项目名称:DataTableWidget,代码行数:13,代码来源:Worker.php

示例14: getPageByAlias

 /**
  * @param string $alias
  * @param string|null $languageCode
  * @return \Ip\Page
  */
 public function getPageByAlias($alias, $languageCode = null)
 {
     if ($languageCode === null) {
         $languageCode = ipContent()->getCurrentLanguage()->getCode();
     }
     $row = ipDb()->selectRow('page', '*', array('alias' => $alias, 'languageCode' => $languageCode, 'isDeleted' => 0));
     if (!$row) {
         return null;
     }
     return new \Ip\Page($row);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:16,代码来源:Content.php

示例15: emptyPageForm

 public static function emptyPageForm()
 {
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN);
     $pages = ipDb()->selectAll('page', 'id, title', array('isDeleted' => 1));
     foreach ($pages as $page) {
         $field = new \Ip\Form\Field\Checkbox(array('name' => 'page[]', 'label' => $page['title'], 'value' => true, 'postValue' => $page['id']));
         $form->addField($field);
     }
     return $form;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:11,代码来源:Helper.php


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