當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。