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


PHP TPropertyValue::ensureBoolean方法代码示例

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


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

示例1: 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

示例2: init

 /**
  * Initialize the TTranslate translation components
  */
 public static function init($catalogue = 'messages')
 {
     static $saveEventHandlerAttached = false;
     //initialized the default class wide formatter
     if (!isset(self::$formatters[$catalogue])) {
         $app = Prado::getApplication()->getGlobalization();
         $config = $app->getTranslationConfiguration();
         $source = MessageSource::factory($config['type'], $config['source'], $config['filename']);
         $source->setCulture($app->getCulture());
         if (TPropertyValue::ensureBoolean($config['cache'])) {
             $source->setCache(new MessageCache($config['cache']));
         }
         self::$formatters[$catalogue] = new MessageFormat($source, $app->getCharset());
         //mark untranslated text
         if ($ps = $config['marker']) {
             self::$formatters[$catalogue]->setUntranslatedPS(array($ps, $ps));
         }
         //save the message on end request
         // Do it only once !
         if (!$saveEventHandlerAttached && TPropertyValue::ensureBoolean($config['autosave'])) {
             Prado::getApplication()->attachEventHandler('OnEndRequest', array('Translation', 'saveMessages'));
             $saveEventHandlerAttached = true;
         }
     }
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:28,代码来源:Translation.php

示例3: createBooleanControl

 protected function createBooleanControl($container, $column, $record)
 {
     $value = $this->getRecordPropertyValue($column, $record);
     $control = new TCheckBox();
     $control->setChecked(TPropertyValue::ensureBoolean($value));
     $control->setCssClass('boolean-checkbox');
     $this->setDefaultProperty($container, $control, $column, $record);
     return $control;
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:9,代码来源:TScaffoldInputCommon.php

示例4: updateProduct

 protected function updateProduct($id, $name, $quantity, $price, $imported)
 {
     // In real applications, data should be saved to database using an SQL UPDATE statement
     if ($this->_data === null) {
         $this->loadData();
     }
     $updateRow = null;
     foreach ($this->_data as $index => $row) {
         if ($row['id'] === $id) {
             $updateRow =& $this->_data[$index];
         }
     }
     if ($updateRow !== null) {
         $updateRow['name'] = $name;
         $updateRow['quantity'] = TPropertyValue::ensureInteger($quantity);
         $updateRow['price'] = TPropertyValue::ensureFloat($price);
         $updateRow['imported'] = TPropertyValue::ensureBoolean($imported);
         $this->saveData();
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:20,代码来源:Home.php

示例5: onLoad

 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $parameters = $this->Application->Parameters;
         $this->SiteTitle->Text = $parameters['SiteTitle'];
         $this->SiteSubtitle->Text = $parameters['SiteSubtitle'];
         $this->SiteOwner->Text = $parameters['SiteOwner'];
         $this->AdminEmail->Text = $parameters['AdminEmail'];
         $this->MultipleUser->Checked = TPropertyValue::ensureBoolean($parameters['MultipleUser']);
         $this->AccountApproval->Checked = TPropertyValue::ensureBoolean($parameters['AccountApproval']);
         $this->PostPerPage->Text = $parameters['PostPerPage'];
         $this->RecentComments->Text = $parameters['RecentComments'];
         $this->PostApproval->Checked = TPropertyValue::ensureBoolean($parameters['PostApproval']);
         $themes = $this->Service->ThemeManager->AvailableThemes;
         $this->ThemeName->DataSource = $themes;
         $this->ThemeName->dataBind();
         $this->ThemeName->SelectedValue = array_search($parameters['ThemeName'], $themes);
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:20,代码来源:ConfigMan.php

示例6: updateBook

 protected function updateBook($isbn, $title, $publisher, $price, $instock, $rating)
 {
     // In real applications, data should be saved to database using an SQL UPDATE statement
     if ($this->_data === null) {
         $this->loadData();
     }
     $updateRow = null;
     foreach ($this->_data as $index => $row) {
         if ($row['ISBN'] === $isbn) {
             $updateRow =& $this->_data[$index];
         }
     }
     if ($updateRow !== null) {
         $updateRow['title'] = $title;
         $updateRow['publisher'] = $publisher;
         $updateRow['price'] = TPropertyValue::ensureFloat(ltrim($price, '$'));
         $updateRow['instock'] = TPropertyValue::ensureBoolean($instock);
         $updateRow['rating'] = TPropertyValue::ensureInteger($rating);
         $this->saveData();
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:21,代码来源:Sample3.php

示例7: createUser

 public function createUser($sender, $param)
 {
     if ($this->IsValid) {
         $userRecord = new UserRecord();
         $userRecord->Name = strtolower($this->Username->Text);
         $userRecord->FullName = $this->FullName->Text;
         $userRecord->Role = 0;
         $userRecord->Password = md5($this->Password->Text);
         $userRecord->Email = $this->Email->Text;
         $userRecord->CreateTime = time();
         $userRecord->Website = $this->Website->Text;
         if (TPropertyValue::ensureBoolean($this->Application->Parameters['AccountApproval'])) {
             $userRecord->Status = UserRecord::STATUS_PENDING;
         } else {
             $userRecord->Status = UserRecord::STATUS_NORMAL;
         }
         $this->DataAccess->insertUser($userRecord);
         $authManager = $this->Application->getModule('auth');
         $authManager->login($this->Username->Text, $this->Password->Text);
         $this->gotoDefaultPage();
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:22,代码来源:NewUser.php

示例8: setTrim

 /**
  * Set the option to trim the contents.
  * @param boolean trim or not.
  */
 public function setTrim($value)
 {
     $this->setViewState('Trim', TPropertyValue::ensureBoolean($value), true);
 }
开发者ID:jetbill,项目名称:hospital-universitario,代码行数:8,代码来源:TTranslate.php

示例9: setActive

 /**
  * @param boolean whether this accordion view is active.
  */
 public function setActive($value)
 {
     $this->_active = TPropertyValue::ensureBoolean($value);
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:7,代码来源:TAccordion.php

示例10: setEnablePageStateUpdate

 /**
  * Set to true to enable the callback response to enable the viewstate
  * update. This will automatically set HasPrority to true.
  * @param boolean true enables the callback response to update the
  * viewstate.
  */
 public function setEnablePageStateUpdate($value)
 {
     $enabled = TPropertyValue::ensureBoolean($value);
     $this->setOption('EnablePageStateUpdate', $enabled);
     if ($enabled) {
         $this->setHasPriority(true);
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:14,代码来源:TCallbackClientSide.php

示例11: setRecursiveCheck

 /**
  * @param boolean whether the subdirectories of the directory will also be checked.
  */
 public function setRecursiveCheck($value)
 {
     $this->_recursiveCheck = TPropertyValue::ensureBoolean($value);
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:7,代码来源:TCache.php

示例12: setCustomPaging

 /**
  * @param boolean whether to allow custom paging
  */
 public function setCustomPaging($value)
 {
     $this->_customPaging = TPropertyValue::ensureBoolean($value);
 }
开发者ID:quantrocket,项目名称:planlogiq,代码行数:7,代码来源:TPagedList.php

示例13: setTranslateDefaultCulture

 public function setTranslateDefaultCulture($value)
 {
     $this->_translateDefaultCulture = TPropertyValue::ensureBoolean($value);
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:4,代码来源:pradolite.php

示例14: setAutoCreateCacheTable

 /**
  * @param boolean whether the cache DB table should be automatically created if not exists.
  * @see setCacheTableName
  */
 public function setAutoCreateCacheTable($value)
 {
     $this->_autoCreate = TPropertyValue::ensureBoolean($value);
 }
开发者ID:jetbill,项目名称:hospital-universitario,代码行数:8,代码来源:TDbCache.php

示例15: setEnableStateCompression

 /**
  * @param boolean whether page state should be compressed.
  * @since 3.1.6
  */
 public function setEnableStateCompression($value)
 {
     $this->_enableStateCompression = TPropertyValue::ensureBoolean($value);
 }
开发者ID:jetbill,项目名称:hospital-universitario,代码行数:8,代码来源:TPage.php


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