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


PHP Prado\TPropertyValue类代码示例

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


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

示例1: setTotalRowCount

 public function setTotalRowCount($value)
 {
     if (($value = TPropertyValue::ensureInteger($value)) < 0) {
         $value = 0;
     }
     $this->_totalRowCount = $value;
 }
开发者ID:pradosoft,项目名称:prado,代码行数:7,代码来源:TDataSourceSelectParameters.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 (isset($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:pradosoft,项目名称:prado,代码行数:28,代码来源:Translation.php

示例3: 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:pradosoft,项目名称:prado,代码行数:12,代码来源:TSessionPageStatePersister.php

示例4: setDecayRate

 /**
  * Sets the decay rate between callback. Default is 0;
  * @param float decay rate between callbacks.
  */
 public function setDecayRate($value)
 {
     $decay = TPropertyValue::ensureFloat($value);
     if ($decay < 0) {
         throw new TConfigurationException('callback_decay_be_not_negative', $this->getID());
     }
     $this->setViewState('Decay', $decay);
 }
开发者ID:pradosoft,项目名称:prado,代码行数:12,代码来源:TValueTriggeredCallback.php

示例5: updateJuiOptions

 /**
  * Updates the options of the jQueryUI widget.
  * @param array list of widget options to change.
  */
 protected function updateJuiOptions($options)
 {
     foreach ($options as $key => $value) {
         $options[$key] = $key . ': ' . (is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value));
     }
     $code = "jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { " . implode(', ', $options) . " });";
     $this->_control->getPage()->getClientScript()->registerEndScript(sprintf('%08X', crc32($code)), $code);
 }
开发者ID:pradosoft,项目名称:prado,代码行数:12,代码来源:TJuiCallbackPageStateTracker.php

示例6: 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:pradosoft,项目名称:prado,代码行数:9,代码来源:TScaffoldInputCommon.php

示例7: __construct

 public function __construct($dropParams)
 {
     $this->_dragElementId = $dropParams->DragElementID;
     $this->_screenX = $dropParams->ScreenX;
     $this->_screenY = $dropParams->ScreenY;
     $this->_offsetX = isset($dropParams->OffsetX) ? $dropParams->OffsetX : false;
     $this->_offsetY = isset($dropParams->OffsetY) ? $dropParams->OffsetY : false;
     $this->_clientX = $dropParams->ClientX;
     $this->_clientY = $dropParams->ClientY;
     $this->_shiftKey = TPropertyValue::ensureBoolean($dropParams->ShiftKey);
     $this->_ctrlKey = TPropertyValue::ensureBoolean($dropParams->CtrlKey);
     $this->_altKey = TPropertyValue::ensureBoolean($dropParams->AltKey);
 }
开发者ID:pradosoft,项目名称:prado,代码行数:13,代码来源:TDropContainerEventParameter.php

示例8: __construct

 /**
  * Constructor.
  * @param string error message. This can be a string that is listed
  * in the message file. If so, the message in the preferred language
  * will be used as the error message. Any rest parameters will be used
  * to replace placeholders ({0}, {1}, {2}, etc.) in the message.
  */
 public function __construct($errorMessage)
 {
     $this->_errorCode = $errorMessage;
     $errorMessage = $this->translateErrorMessage($errorMessage);
     $args = func_get_args();
     array_shift($args);
     $n = count($args);
     $tokens = array();
     for ($i = 0; $i < $n; ++$i) {
         $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]);
     }
     parent::__construct(strtr($errorMessage, $tokens));
 }
开发者ID:pradosoft,项目名称:prado,代码行数:20,代码来源:TException.php

示例9: __construct

 /**
  * Constructor, similar to the parent constructor. For parameters that
  * are of SimpleXmlElement, the tag name and its attribute names and values
  * are expanded into a string.
  */
 public function __construct($errorMessage)
 {
     $this->setErrorCode($errorMessage);
     $errorMessage = $this->translateErrorMessage($errorMessage);
     $args = func_get_args();
     array_shift($args);
     $n = count($args);
     $tokens = array();
     for ($i = 0; $i < $n; ++$i) {
         if ($args[$i] instanceof SimpleXMLElement) {
             $tokens['{' . $i . '}'] = $this->implodeNode($args[$i]);
         } else {
             $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]);
         }
     }
     parent::__construct(strtr($errorMessage, $tokens));
 }
开发者ID:pradosoft,项目名称:prado,代码行数:22,代码来源:TSqlMapException.php

示例10: remove

 /**
  * Removes an item from the map by its key. If no priority, or false, is specified
  * then priority is irrelevant. If null is used as a parameter for priority, then
  * the priority will be the default priority.  If a priority is specified, or
  * the default priority is specified, only key-value pairs in that priority
  * will be affected.
  * @param mixed the key of the item to be removed
  * @param numeric|false|null priority.  False is any priority, null is the
  * default priority, and numeric is a specific priority
  * @return mixed the removed value, null if no such key exists.
  * @throws TInvalidOperationException if the map is read-only
  */
 public function remove($key, $priority = false)
 {
     if (!$this->_r) {
         if ($priority === null) {
             $priority = $this->getDefaultPriority();
         }
         if ($priority === false) {
             $this->sortPriorities();
             foreach ($this->_d as $priority => $items) {
                 if (array_key_exists($key, $items)) {
                     $value = $this->_d[$priority][$key];
                     unset($this->_d[$priority][$key]);
                     $this->_c--;
                     if (count($this->_d[$priority]) === 0) {
                         unset($this->_d[$priority]);
                         $this->_o = false;
                     }
                     $this->_fd = null;
                     return $value;
                 }
             }
             return null;
         } else {
             $priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p);
             if (isset($this->_d[$priority]) && (isset($this->_d[$priority][$key]) || array_key_exists($key, $this->_d[$priority]))) {
                 $value = $this->_d[$priority][$key];
                 unset($this->_d[$priority][$key]);
                 $this->_c--;
                 if (count($this->_d[$priority]) === 0) {
                     unset($this->_d[$priority]);
                     $this->_o = false;
                 }
                 $this->_fd = null;
                 return $value;
             } else {
                 return null;
             }
         }
     } else {
         throw new TInvalidOperationException('map_readonly', get_class($this));
     }
 }
开发者ID:pradosoft,项目名称:prado,代码行数:54,代码来源:TPriorityMap.php

示例11: setPersistent

 /**
  * @param boolean whether the connection is persistent or not
  * Some DBMS (such as sqlite) may not support this feature.
  */
 public function setPersistent($value)
 {
     return $this->setAttribute(PDO::ATTR_PERSISTENT, TPropertyValue::ensureBoolean($value));
 }
开发者ID:pradosoft,项目名称:prado,代码行数:8,代码来源:TDbConnection.php

示例12: setValue

 /**
  * @param string value of the item
  */
 public function setValue($value)
 {
     $this->_value = TPropertyValue::ensureString($value);
 }
开发者ID:pradosoft,项目名称:prado,代码行数:7,代码来源:TListItem.php

示例13: setButtonType

 /**
  * @param TWizardNavigationButtonType button type.
  */
 public function setButtonType($value)
 {
     $this->_buttonType = TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TWizardNavigationButtonType');
 }
开发者ID:pradosoft,项目名称:prado,代码行数:7,代码来源:TWizardNavigationButtonStyle.php

示例14: setFlushScriptFiles

 /**
  * @param bool whether to flush script files using TClientScriptManager::flushScriptFiles() before rendering the script block
  */
 public function setFlushScriptFiles($value)
 {
     $this->setViewState('FlushScriptFiles', TPropertyValue::ensureBoolean($value));
 }
开发者ID:pradosoft,项目名称:prado,代码行数:7,代码来源:TClientScript.php

示例15: setLineNumber

 /**
  * @param integer the line number at which the template has error
  */
 public function setLineNumber($value)
 {
     $this->_lineNumber = TPropertyValue::ensureInteger($value);
 }
开发者ID:pradosoft,项目名称:prado,代码行数:7,代码来源:TTemplateException.php


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