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


PHP TPropertyValue::ensureInteger方法代码示例

本文整理汇总了PHP中TPropertyValue::ensureInteger方法的典型用法代码示例。如果您正苦于以下问题:PHP TPropertyValue::ensureInteger方法的具体用法?PHP TPropertyValue::ensureInteger怎么用?PHP TPropertyValue::ensureInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPropertyValue的用法示例。


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

示例1: getPageSize

 private function getPageSize()
 {
     if (($limit = TPropertyValue::ensureInteger($this->Request['limit'])) <= 0) {
         $limit = TPropertyValue::ensureInteger($this->Application->Parameters['PostPerPage']);
     }
     return $limit;
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:SearchPost.php

示例2: setTimeStamp

 public function setTimeStamp($value)
 {
     $ts = TPropertyValue::ensureInteger($value);
     $this->DatePicker->TimeStamp = $ts;
     $this->HourPicker->SelectedValue = date('H', $ts);
     $this->MinutePicker->SelectedValue = date('i', $ts);
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:Ticket284Component.php

示例3: setTotalRowCount

 public function setTotalRowCount($value)
 {
     if (($value = TPropertyValue::ensureInteger($value)) < 0) {
         $value = 0;
     }
     $this->_totalRowCount = $value;
 }
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:7,代码来源:TDataSourceView.php

示例4: saveButtonClicked

 public function saveButtonClicked($sender, $param)
 {
     if ($this->IsValid) {
         $postRecord = new PostRecord();
         $postRecord->Title = $this->Title->SafeText;
         $postRecord->Content = $this->Content->SafeText;
         if ($this->DraftMode->Checked) {
             $postRecord->Status = PostRecord::STATUS_DRAFT;
         } else {
             if (!$this->User->IsAdmin && TPropertyValue::ensureBoolean($this->Application->Parameters['PostApproval'])) {
                 $postRecord->Status = PostRecord::STATUS_PENDING;
             } else {
                 $postRecord->Status = PostRecord::STATUS_PUBLISHED;
             }
         }
         $postRecord->CreateTime = time();
         $postRecord->ModifyTime = $postRecord->CreateTime;
         $postRecord->AuthorID = $this->User->ID;
         $cats = array();
         foreach ($this->Categories->SelectedValues as $value) {
             $cats[] = TPropertyValue::ensureInteger($value);
         }
         $this->DataAccess->insertPost($postRecord, $cats);
         $this->gotoPage('Posts.ViewPost', array('id' => $postRecord->ID));
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:26,代码来源:NewPost.php

示例5: getValueAsString

 private function getValueAsString($value, $type)
 {
     switch ($type) {
         case 'integer':
             $value = TPropertyValue::ensureInteger($value);
             break;
         case 'float':
             $value = TPropertyValue::ensureFloat($value);
             break;
         case 'boolean':
             if (TPropertyValue::ensureBoolean($value)) {
                 $value = 'true';
             } else {
                 $value = 'false';
             }
             break;
         case 'enumerable':
             $value = "'{$value}'";
             break;
         case 'mixed':
             $value = 'null';
             break;
         case 'string':
             $value = "'{$value}'";
             break;
     }
     return "{$value}";
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:28,代码来源:ClassDefinition.php

示例6: changePageSize

 public function changePageSize($sender, $param)
 {
     $this->DataGrid->PageSize = TPropertyValue::ensureInteger($this->PageSize->Text);
     $this->DataGrid->CurrentPageIndex = 0;
     $this->DataGrid->DataSource = $this->Data;
     $this->DataGrid->dataBind();
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:Sample5.php

示例7: setHistorySize

 /**
  * @param integer maximum number of page states that should be kept in session
  * @throws TInvalidDataValueException if the number is smaller than 1.
  */
 public function setHistorySize($value)
 {
     if (($value = TPropertyValue::ensureInteger($value)) > 0) {
         $this->_historySize = $value;
     } else {
         throw new TInvalidDataValueException('sessionpagestatepersister_historysize_invalid');
     }
 }
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:12,代码来源:TSessionPageStatePersister.php

示例8: getCategoryFilter

 private function getCategoryFilter()
 {
     if (($catID = $this->Request['cat']) !== null) {
         $catID = TPropertyValue::ensureInteger($catID);
         return "category_id={$catID}";
     } else {
         return '';
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:9,代码来源:ListPost.php

示例9: onInit

 public function onInit($param)
 {
     parent::onInit($param);
     $id = TPropertyValue::ensureInteger($this->Request['id']);
     $this->_category = $this->DataAccess->queryCategoryByID($id);
     if ($this->_category === null) {
         throw new BlogException(500, 'category_id_invalid', $id);
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:9,代码来源:EditCategory.php

示例10: saveItem

 public function saveItem($sender, $param)
 {
     $item = $param->Item;
     $postID = $this->PostGrid->DataKeys[$item->ItemIndex];
     $postRecord = $this->DataAccess->queryPostByID($postID);
     $postRecord->Status = TPropertyValue::ensureInteger($item->Cells[2]->PostStatus->SelectedValue);
     $this->DataAccess->updatePost($postRecord);
     $this->PostGrid->EditItemIndex = -1;
     $this->bindData();
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:10,代码来源:PostMan.php

示例11: saveItem

 public function saveItem($sender, $param)
 {
     $item = $param->Item;
     $userID = $this->UserGrid->DataKeys[$item->ItemIndex];
     $userRecord = $this->DataAccess->queryUserByID($userID);
     $userRecord->Role = TPropertyValue::ensureInteger($item->Cells[1]->UserRole->SelectedValue);
     $userRecord->Status = TPropertyValue::ensureInteger($item->Cells[2]->UserStatus->SelectedValue);
     $this->DataAccess->updateUser($userRecord);
     $this->UserGrid->EditItemIndex = -1;
     $this->bindData();
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:11,代码来源:UserMan.php

示例12: selectLevel

 public function selectLevel($sender, $param)
 {
     if (($selection = $this->LevelSelection->SelectedValue) === '') {
         $this->LevelError->Visible = true;
         return;
     } else {
         $this->Level = TPropertyValue::ensureInteger($selection);
     }
     $this->Word = $this->generateWord();
     $this->GuessWord = str_repeat('_', strlen($this->Word));
     $this->Misses = 0;
     $this->GameMultiView->ActiveView = $this->GuessView;
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:13,代码来源:Home.php

示例13: onInit

 public function onInit($param)
 {
     parent::onInit($param);
     if (($id = $this->Request['id']) !== null) {
         $id = TPropertyValue::ensureInteger($id);
     } else {
         $id = $this->User->ID;
     }
     if (($this->_userRecord = $this->DataAccess->queryUserByID($id)) === null) {
         throw new BlogException(500, 'profile_id_invalid', $id);
     }
     $this->_userRecord->Email = strtr(strtoupper($this->_userRecord->Email), array('@' => ' at ', '.' => ' dot '));
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:13,代码来源:ViewUser.php

示例14: onLoad

 public function onLoad($param)
 {
     parent::onLoad($param);
     $commentLimit = TPropertyValue::ensureInteger($this->Application->Parameters['RecentComments']);
     $comments = $this->Application->getModule('data')->queryComments('', 'ORDER BY create_time DESC', "LIMIT {$commentLimit}");
     foreach ($comments as $comment) {
         $comment->ID = $this->Service->constructUrl('Posts.ViewPost', array('id' => $comment->PostID)) . '#c' . $comment->ID;
         if (strlen($comment->Content) > 40) {
             $comment->Content = substr($comment->Content, 0, 40) . ' ...';
         }
     }
     $this->CommentList->DataSource = $comments;
     $this->CommentList->dataBind();
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:14,代码来源:CommentPortlet.php

示例15: onInit

 public function onInit($param)
 {
     parent::onInit($param);
     if (($id = $this->Request['id']) !== null) {
         $id = TPropertyValue::ensureInteger($id);
         if (!$this->User->IsAdmin && $this->User->ID !== $id) {
             throw new BlogException(500, 'profile_edit_disallowed', $id);
         }
     } else {
         $id = $this->User->ID;
     }
     if (($this->_userRecord = $this->DataAccess->queryUserByID($id)) === null) {
         throw new BlogException(500, 'profile_id_invalid', $id);
     }
 }
开发者ID:bklein01,项目名称:prado,代码行数:15,代码来源:EditUser.php


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