本文整理汇总了PHP中Prado\TPropertyValue::ensureEnum方法的典型用法代码示例。如果您正苦于以下问题:PHP TPropertyValue::ensureEnum方法的具体用法?PHP TPropertyValue::ensureEnum怎么用?PHP TPropertyValue::ensureEnum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prado\TPropertyValue
的用法示例。
在下文中一共展示了TPropertyValue::ensureEnum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPasswordMode
/**
* @param TUserManagerPasswordMode how password is stored, clear text, or MD5 or SHA1 hashed.
*/
public function setPasswordMode($value)
{
$this->_passwordMode = TPropertyValue::ensureEnum($value, 'Prado\\Security\\TUserManagerPasswordMode');
}
示例2: setNullConversion
/**
* @param TDbNullConversionMode how the null and empty strings are converted
*/
public function setNullConversion($value)
{
switch (TPropertyValue::ensureEnum($value, 'Prado\\Data\\TDbNullConversionMode')) {
case TDbNullConversionMode::Preserved:
$value = PDO::NULL_NATURAL;
break;
case TDbNullConversionMode::EmptyStringToNull:
$value = PDO::NULL_EMPTY_STRING;
break;
case TDbNullConversionMode::NullToEmptyString:
$value = PDO::NULL_TO_STRING;
break;
}
$this->setAttribute(PDO::ATTR_ORACLE_NULLS, $value);
}
示例3: setConstraint
/**
* Set wether the element should be constrainted in one direction
* @param CDraggableConstraint
*/
public function setConstraint($value)
{
$this->setViewState('Constraint', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\ActiveControls\\DraggableConstraint'), TDraggableConstraint::None);
}
示例4: select
/**
* Client script to select/clear/check a drop down list, check box list,
* or radio button list.
* The second parameter determines the selection method. Valid methods are
* - <b>Value</b>, select or check by value
* - <b>Values</b>, select or check by a list of values
* - <b>Index</b>, select or check by index (zero based index)
* - <b>Indices</b>, select or check by a list of index (zero based index)
* - <b>Clear</b>, clears or selections or checks in the list
* - <b>All</b>, select all
* - <b>Invert</b>, invert the selection.
* @param TControl list control
* @param string selection method
* @param string|int the value or index to select/check.
* @param string selection control type, either 'check' or 'select'
*/
public function select($control, $method = 'Value', $value = null, $type = null)
{
$method = TPropertyValue::ensureEnum($method, 'Value', 'Index', 'Clear', 'Indices', 'Values', 'All', 'Invert');
$type = $type === null ? $this->getSelectionControlType($control) : $type;
$total = $this->getSelectionControlIsListType($control) ? $control->getItemCount() : 1;
// pass the ID to avoid getting the surrounding elements (ISurroundable)
if ($control instanceof TControl) {
$control = $control->getClientID();
}
$this->callClientFunction('Prado.Element.select', array($control, $type . $method, $value, $total));
}
示例5: setOperator
/**
* Sets the comparison operation to perform
* @param TValidationCompareOperator the comparison operation
*/
public function setOperator($value)
{
$this->setViewState('Operator', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TValidationCompareOperator'), TValidationCompareOperator::Equal);
}
示例6: setValidation
/**
* This method has been deprecated since version 3.2.1.
* Please use {@link setHashAlgorithm()} instead.
* @param TSecurityManagerValidationMode hashing algorithm used to generate HMAC.
*/
public function setValidation($value)
{
$this->_hashAlgorithm = TPropertyValue::ensureEnum($value, 'Prado\\Security\\TSecurityManagerValidationMode');
}
示例7: setTableSection
/**
* @param TTableRowSection location of a row in a table.
*/
public function setTableSection($value)
{
$this->setViewState('TableSection', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTableRowSection'), TTableRowSection::Body);
}
示例8: setDisplay
/**
* @param TValidatorDisplayStyle the style of displaying the error message
*/
public function setDisplay($value)
{
$this->setViewState('Display', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TValidatorDisplayStyle'), TValidatorDisplayStyle::Fixed);
}
示例9: setCaptionAlign
/**
* @param TTableCaptionAlign table caption alignment.
*/
public function setCaptionAlign($value)
{
$this->setViewState('CaptionAlign', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTableCaptionAlign'), TTableCaptionAlign::NotSet);
}
示例10: setScrollBars
/**
* @param TScrollBars the visibility and position of scroll bars in a panel control.
*/
public function setScrollBars($value)
{
$this->_scrollBars = TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TScrollBars');
}
示例11: setCookieMode
/**
* @param THttpSessionCookieMode how to use cookie to store session ID
* @throws TInvalidOperationException if session is started already
*/
public function setCookieMode($value)
{
if ($this->_started) {
throw new TInvalidOperationException('httpsession_cookiemode_unchangeable');
} else {
$value = TPropertyValue::ensureEnum($value, 'Prado\\Web\\THttpSessionCookieMode');
if ($value === THttpSessionCookieMode::None) {
ini_set('session.use_cookies', '0');
ini_set('session.use_only_cookies', '0');
} else {
if ($value === THttpSessionCookieMode::Allow) {
ini_set('session.use_cookies', '1');
ini_set('session.use_only_cookies', '0');
} else {
ini_set('session.use_cookies', '1');
ini_set('session.use_only_cookies', '1');
ini_set('session.use_trans_sid', 0);
}
}
}
}
示例12: setInvalidFinderResult
/**
* Define the way an active record finder react if an invalid magic-finder invoked
* @param TActiveRecordInvalidFinderResult
* @since 3.1.5
* @see getInvalidFinderResult
*/
public function setInvalidFinderResult($value)
{
$this->_invalidFinderResult = TPropertyValue::ensureEnum($value, 'Prado\\Data\\ActiveRecord\\TActiveRecordInvalidFinderResult');
}
示例13: setGridLines
/**
* Sets the grid line style of the table.
* @param TTableGridLines the grid line setting of the table
*/
public function setGridLines($value)
{
$this->_gridLines = TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTableGridLines');
}
示例14: setDisplayMode
/**
* @return TBulletedListDisplayMode display mode of the list.
*/
public function setDisplayMode($value)
{
$this->setViewState('DisplayMode', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TBulletedListDisplayMode'), TBulletedListDisplayMode::Text);
}
示例15: setMode
/**
* @param TColorPickerMode color picker UI mode
*/
public function setMode($value)
{
$this->setViewState('Mode', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TColorPickerMode'), TColorPickerMode::Basic);
}