本文整理汇总了PHP中TPropertyValue::ensureString方法的典型用法代码示例。如果您正苦于以下问题:PHP TPropertyValue::ensureString方法的具体用法?PHP TPropertyValue::ensureString怎么用?PHP TPropertyValue::ensureString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPropertyValue
的用法示例。
在下文中一共展示了TPropertyValue::ensureString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$rows = new nNewsletterRecord();
$rows->Name = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->Status = 0;
$rows->save();
$lay = new nLayoutRecord();
//$lay->PlaneText = TPropertyValue::ensureString ( $this->PlaneText->getText () );
$lay->HtmlText = TPropertyValue::ensureString($this->HtmlText->getText());
$lay->nNewsletterID = $rows->ID;
$lay->save();
$mailList = explode(";", $this->SendDescription->getText());
foreach ($mailList as $email) {
if (filter_var(trim($email), FILTER_VALIDATE_EMAIL)) {
if (!nSenderRecord::finder()->findBy_nLayoutID_AND_Email($lay->ID, trim($email))) {
$send = new nSenderRecord();
$send->Email = trim($email);
$send->Status = 0;
$send->nLayoutID = $lay->ID;
$send->save();
}
}
}
$this->Response->redirect($this->Service->constructUrl("Newsletter.Data"));
}
}
示例2: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$finder = CatalogueRecord::finder();
$finder->DbConnection->Active = true;
$transaction = $finder->DbConnection->beginTransaction();
try {
$rows = $finder->findBycat_id($this->getRequest()->itemAt("id"));
$rows->MasterName = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->ShortName = TPropertyValue::ensureString($this->ShortName->getSafeText());
$baseMethod = new BaseFunction();
$d = dir($baseMethod->UploadFilePath);
while ($entry = $d->read()) {
if (strlen($entry) > 2 && is_file($d->path . '/' . $entry) && $entry != '.htaccess') {
copy($baseMethod->UploadFilePath . $entry, Prado::getPathOfAlias('UserFiles') . '/Language/' . $this->getRequest()->itemAt("id") . '/' . $entry) or die("Błąd przy kopiowaniu");
$rows->Photo = $entry;
}
}
$d->close();
$rows->save();
$transaction->commit();
$this->Response->redirect($this->Service->constructUrl("Language.Index", array("id" => $this->getRequest()->itemAt("id"))));
} catch (Exception $e) {
$transaction->rollBack();
}
}
}
示例3: createParameter
private function createParameter($id, $value)
{
$element = new TXmlElement('parameter');
$element->Attributes['id'] = $id;
$element->Attributes['value'] = TPropertyValue::ensureString($value);
return $element;
}
示例4: __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));
}
示例5: init
public function init($config)
{
$request = Prado::getApplication()->getRequest();
if ($request->contains('graph')) {
$this->type = TPropertyValue::ensureString($request['graph']);
} else {
throw new TConfigurationException('You must specify the type of the graph');
}
if ($request->contains('width')) {
$temp = explode(',', TPropertyValue::ensureInteger($request['width']));
$this->width = $temp[0];
}
if ($request->contains('height')) {
$temp = explode(',', TPropertyValue::ensureInteger($request['height']));
$this->height = $temp[0];
}
if ($request->contains('title')) {
//$temp = explode( ',', );
$this->title = TPropertyValue::ensureString($request['title']);
}
if ($request->contains('legend')) {
$this->legend = explode(',', TPropertyValue::ensureString($request['legend']));
}
if ($request->contains('xdata')) {
$this->xdata = explode(',', TPropertyValue::ensureString($request['xdata']));
} else {
throw new TConfigurationException('You must specify the x data for the graph');
}
if ($request->contains('ydata1')) {
$this->ydata1 = explode(',', TPropertyValue::ensureString($request['ydata1']));
} else {
throw new TConfigurationException('You must specify the y data for the graph');
}
if ($request->contains('ydata2')) {
$this->ydata2 = explode(',', TPropertyValue::ensureString($request['ydata2']));
}
if ($request->contains('ytitle')) {
$this->ytitle = TPropertyValue::ensureString($request['ytitle']);
} else {
throw new TConfigurationException('You must specify the y title for the graph.');
}
}
示例6: changePassword2
public function changePassword2($sender, $param)
{
$finder = UserRecord::finder();
$finder->DbConnection->Active = true;
$transaction = $finder->DbConnection->beginTransaction();
try {
$baseMethod = new BaseFunction();
$hash = $this->getRequest()->itemAt("amp;hash");
if ($this->getRequest()->contains("amp;hash") == false) {
$hash = $this->getRequest()->itemAt("hash");
}
$rows = $finder->findByUsername($hash);
$rows->Password = TPropertyValue::ensureString($baseMethod->cryptString($this->ConfirmPassword->getSafeText()));
$rows->save();
$transaction->commit();
} catch (Exception $e) {
print_R($e->getMessage());
$transaction->rollBack();
}
$this->Response->redirect($this->Service->constructUrl("Login"));
}
示例7: setForControl
/**
* Sets the ID path of the {@link TTextBox} control.
* The ID path is the dot-connected IDs of the controls reaching from
* the keyboard's naming container to the target control.
* @param string the ID path
*/
public function setForControl($value)
{
$this->setViewState('ForControl', TPropertyValue::ensureString($value));
}
示例8: formatDataValue
/**
* Formats the text value according to a format string.
* If the format string is empty, the original value is converted into
* a string and returned.
* If the format string starts with '#', the string is treated as a PHP expression
* within which the token '{0}' is translated with the data value to be formated.
* Otherwise, the format string and the data value are passed
* as the first and second parameters in {@link sprintf}.
* @param string format string
* @param mixed the data to be formatted
* @return string the formatted result
*/
protected function formatDataValue($formatString, $value)
{
if ($formatString === '') {
return TPropertyValue::ensureString($value);
} else {
if ($formatString[0] === '#') {
$expression = strtr(substr($formatString, 1), array('{0}' => '$value'));
try {
if (eval("\$result={$expression};") === false) {
throw new Exception('');
}
return $result;
} catch (Exception $e) {
throw new TInvalidDataValueException('datagridcolumn_expression_invalid', get_class($this), $expression, $e->getMessage());
}
} else {
return sprintf($formatString, $value);
}
}
}
示例9: setDescription
/**
* @param string
*/
public function setDescription($value)
{
$this->setViewState('Description', TPropertyValue::ensureString($value), '');
}
示例10: setGatewayClass
/**
* Set implementation class of ActiveRecordGateway
* @param string $value
*/
public function setGatewayClass($value)
{
$this->_gatewayClass = TPropertyValue::ensureString($value);
}
示例11: setStatusCode
/**
* Set the HTTP status code for the response.
* The code and its reason will be sent to client using the currently requested http protocol version (see {@link THttpRequest::getHttpProtocolVersion})
* Keep in mind that HTTP/1.0 clients might not understand all status codes from HTTP/1.1
*
* @param integer HTTP status code
* @param string HTTP status reason, defaults to standard HTTP reasons
*/
public function setStatusCode($status, $reason = null)
{
if ($this->_httpHeaderSent) {
throw new Exception('Unable to alter response as HTTP header already sent');
}
$status = TPropertyValue::ensureInteger($status);
if (isset(self::$HTTP_STATUS_CODES[$status])) {
$this->_reason = self::$HTTP_STATUS_CODES[$status];
} else {
if ($reason === null || $reason === '') {
throw new TInvalidDataValueException("response_status_reason_missing");
}
$reason = TPropertyValue::ensureString($reason);
if (strpos($reason, "\r") != false || strpos($reason, "\n") != false) {
throw new TInvalidDataValueException("response_status_reason_barchars");
}
$this->_reason = $reason;
}
$this->_status = $status;
}
示例12: setFinishDestinationUrl
/**
* @param string the URL that the browser will be redirected to if the wizard finishes.
*/
public function setFinishDestinationUrl($value)
{
$this->setViewState('FinishDestinationUrl', TPropertyValue::ensureString($value), '');
}
示例13: setHashAlgorithm
/**
* @param string hashing algorithm used to generate HMAC.
*/
public function setHashAlgorithm($value)
{
$this->_hashAlgorithm = TPropertyValue::ensureString($value);
}
示例14: setApiKey
/**
* @param string Google Maps API Key.
* Visit http://www.google.com/apis/maps/signup.html to get an API Key for your domain.
*/
public function setApiKey($value)
{
$this->_apiKey = TPropertyValue::ensureString($value);
}
示例15: setSeparator
/**
* @return string word or token separators (delimiters).
*/
public function setSeparator($value)
{
$this->setViewState('tokens', TPropertyValue::ensureString($value), '');
}