當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TPropertyValue::ensureArray方法代碼示例

本文整理匯總了PHP中TPropertyValue::ensureArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP TPropertyValue::ensureArray方法的具體用法?PHP TPropertyValue::ensureArray怎麽用?PHP TPropertyValue::ensureArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TPropertyValue的用法示例。


在下文中一共展示了TPropertyValue::ensureArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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);
 }
開發者ID:quantrocket,項目名稱:planlogiq,代碼行數:10,代碼來源:TestLayout.php

示例2: onLoad

 public function onLoad($param)
 {
     parent::onLoad($param);
     $url = $this->Request->RequestUri;
     if (strpos($url, '?') === false) {
         $url .= '?notheme=true';
     } else {
         $url .= '&notheme=true';
     }
     $this->PrinterLink->NavigateUrl = $url;
     if (isset($this->Request['notheme'])) {
         $this->MainMenu->Visible = false;
         $this->TopicPanel->Visible = false;
     }
     $this->languages->DataSource = TPropertyValue::ensureArray($this->Application->Parameters['languages']);
     $this->languages->dataBind();
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:17,代碼來源:Layout.php

示例3: validateDataSource

 /**
  * Validates if the parameter is a valid data source.
  * If it is a string or an array, it will be converted as a TList object.
  * @return Traversable the data that is traversable
  * @throws TInvalidDataTypeException if the data is neither null nor Traversable
  */
 protected function validateDataSource($value)
 {
     if (is_string($value)) {
         $list = new TList();
         foreach (TPropertyValue::ensureArray($value) as $key => $value) {
             if (is_array($value)) {
                 $list->add($value);
             } else {
                 $list->add(array($value, is_string($key) ? $key : $value));
             }
         }
         return $list;
     } else {
         if (is_array($value)) {
             return new TMap($value);
         } else {
             if ($value instanceof Traversable || $value === null) {
                 return $value;
             } else {
                 throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this));
             }
         }
     }
 }
開發者ID:BackupTheBerlios,項目名稱:horux-svn,代碼行數:30,代碼來源:XWeekPlanner.php

示例4: setPagePath

 public function setPagePath($value)
 {
     $this->setViewState('PagePath', TPropertyValue::ensureArray($value), array());
 }
開發者ID:quantrocket,項目名稱:planlogiq,代碼行數:4,代碼來源:AxListMenu.php

示例5: setPoint

 public function setPoint($value)
 {
     $value = TPropertyValue::ensureArray($value);
     if (count($value) == 2) {
         $this->setViewState('Point', $value, array(0, 0));
     } else {
         throw new TInvalidDataValueException('bactivegooglemapmarker_point_invalid', get_class($this));
     }
 }
開發者ID:quantrocket,項目名稱:planlogiq,代碼行數:9,代碼來源:BActiveGoogleMap.php

示例6: setSearchParameters

 /**
  * @param array search parameters
  */
 public function setSearchParameters($value)
 {
     $this->setViewState('SearchParameters', TPropertyValue::ensureArray($value), array());
 }
開發者ID:BackupTheBerlios,項目名稱:horux-svn,代碼行數:7,代碼來源:TScaffoldListView.php

示例7: setHalfRatingInterval

 /**
  * Sets the interval such that those rating values within the interval
  * will be considered as a half star rating.
  * @param array rating display half value interval, default is array(0.3, 0.7);
  */
 public function setHalfRatingInterval($value)
 {
     $this->setViewState('HalfRating', TPropertyValue::ensureArray($value), array(0.3, 0.7));
 }
開發者ID:BackupTheBerlios,項目名稱:horux-svn,代碼行數:9,代碼來源:TRatingList.php

示例8: validateDataSource

 /**
  * Validates if the parameter is a valid data source.
  * If it is a string or an array, it will be converted as a TList object.
  * @param Traversable|array|string data source to be validated
  * @return Traversable the data that is traversable
  * @throws TInvalidDataTypeException if the data is neither null nor Traversable
  */
 protected function validateDataSource($value)
 {
     if (is_string($value)) {
         $list = new TList();
         foreach (TPropertyValue::ensureArray($value) as $key => $value) {
             if (is_array($value)) {
                 $list->add($value);
             } else {
                 $list->add(array($value, is_string($key) ? $key : $value));
             }
         }
         return $list;
     } else {
         if (is_array($value)) {
             return new TMap($value);
         } else {
             if ($value instanceof TDbDataReader) {
                 // read array from TDbDataReader since it's forward-only stream and can only be traversed once
                 return $value->readAll();
             } else {
                 if ($value instanceof Traversable || $value === null) {
                     return $value;
                 } else {
                     throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this));
                 }
             }
         }
     }
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:36,代碼來源:TDataBoundControl.php

示例9: setAcceptCssClass

 /**
  * Sets the Css class name that this container can accept.
  * @param string comma delimited css class names.
  */
 public function setAcceptCssClass($value)
 {
     $this->setViewState('Accepts', TPropertyValue::ensureArray($value), '');
 }
開發者ID:Nurudeen,項目名稱:prado,代碼行數:8,代碼來源:TDropContainer.php

示例10: setValues

 /**
  * Sets the possible values that the slider can take.
  * If this is set, {@link setStepSize StepSize} will be ignored. The latter
  * generates a set of evenly distributed candidate values.
  * @param array list of allowed values the slider can take
  */
 public function setValues($value)
 {
     $this->setViewState('Values', TPropertyValue::ensureArray($value), array());
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:10,代碼來源:TSlider.php

示例11: setShoppingListData

 public function setShoppingListData($value)
 {
     var_export($value);
     $this->setViewState('ShoppingList', TPropertyValue::ensureArray($value), array());
 }
開發者ID:Nurudeen,項目名稱:prado,代碼行數:5,代碼來源:Home.php

示例12: setCustomTranslations

 public function setCustomTranslations($value)
 {
     return $this->setViewState('CustomTranslations', TPropertyValue::ensureArray($value));
 }
開發者ID:ullasnaidu,項目名稱:epro,代碼行數:4,代碼來源:TReCaptcha.php

示例13: setRecordPk

 /**
  * @param array Active Record primary key value to be edited.
  */
 public function setRecordPk($value)
 {
     $this->clearRecordObject();
     $val = TPropertyValue::ensureArray($value);
     $this->setViewState('PK', count($val) > 0 ? $val : null);
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:9,代碼來源:TScaffoldEditView.php

示例14: setSchemaCachingExclude

 public function setSchemaCachingExclude($value)
 {
     $this->username = TPropertyValue::ensureArray($value);
 }
開發者ID:quantrocket,項目名稱:planlogiq,代碼行數:4,代碼來源:TDbConnection.php

示例15: setSeriesGap

 public function setSeriesGap($value)
 {
     $this->setViewState('SeriesGap', TPropertyValue::ensureArray($value), array());
 }
開發者ID:quantrocket,項目名稱:planlogiq,代碼行數:4,代碼來源:SWFChart.php


注:本文中的TPropertyValue::ensureArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。