本文整理汇总了PHP中TPropertyValue类的典型用法代码示例。如果您正苦于以下问题:PHP TPropertyValue类的具体用法?PHP TPropertyValue怎么用?PHP TPropertyValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TPropertyValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changePageSize
public function changePageSize($sender, $param)
{
$this->DataGrid->PageSize = TPropertyValue::ensureInteger($this->PageSize->Text);
$this->DataGrid->CurrentPageIndex = 0;
$this->DataGrid->DataSource = $this->Data;
$this->DataGrid->dataBind();
}
示例2: setTotalRowCount
public function setTotalRowCount($value)
{
if (($value = TPropertyValue::ensureInteger($value)) < 0) {
$value = 0;
}
$this->_totalRowCount = $value;
}
示例3: createParameter
private function createParameter($id, $value)
{
$element = new TXmlElement('parameter');
$element->Attributes['id'] = $id;
$element->Attributes['value'] = TPropertyValue::ensureString($value);
return $element;
}
示例4: 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"));
}
}
示例5: getPageSize
private function getPageSize()
{
if (($limit = TPropertyValue::ensureInteger($this->Request['limit'])) <= 0) {
$limit = TPropertyValue::ensureInteger($this->Application->Parameters['PostPerPage']);
}
return $limit;
}
示例6: 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;
}
}
}
示例7: 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));
}
}
示例8: 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();
}
}
}
示例9: 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);
}
示例10: 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');
}
}
示例11: getCategoryFilter
private function getCategoryFilter()
{
if (($catID = $this->Request['cat']) !== null) {
$catID = TPropertyValue::ensureInteger($catID);
return "category_id={$catID}";
} else {
return '';
}
}
示例12: onInit
public function onInit($param)
{
parent::onInit($param);
$id = TPropertyValue::ensureInteger($this->Request['id']);
$this->_category = $this->DataAccess->queryCategoryByID($id);
if ($this->_category === null) {
throw new BlogException(500, 'category_id_invalid', $id);
}
}
示例13: 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;
}
示例14: saveItem
public function saveItem($sender, $param)
{
$item = $param->Item;
$postID = $this->PostGrid->DataKeys[$item->ItemIndex];
$postRecord = $this->DataAccess->queryPostByID($postID);
$postRecord->Status = TPropertyValue::ensureInteger($item->Cells[2]->PostStatus->SelectedValue);
$this->DataAccess->updatePost($postRecord);
$this->PostGrid->EditItemIndex = -1;
$this->bindData();
}
示例15: loadTestTemplate
public function loadTestTemplate($sender, $param)
{
$c = new TestTemplate();
$this->Content->Controls[] = $c;
$c->dataBind();
$this->Content->render($param->newWriter);
$value = $this->Page->getControlState('WebgisDynamicControls');
$value[] = array('classname' => get_class($c), 'args' => null);
$this->Page->setControlState('WebgisDynamicControls', TPropertyValue::ensureArray($value), 0);
}