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


PHP JObject::getProperties方法代碼示例

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


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

示例1: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @since   1.6
  */
 public function display($tpl = null)
 {
     try {
         $this->item = $this->get('Item');
     } catch (Exception $e) {
         $app = JFactory::getApplication();
         $app->enqueueMessage($e->getMessage(), 'error');
         return false;
     }
     $paramsList = $this->item->getProperties();
     unset($paramsList['xml']);
     $paramsList = json_encode($paramsList);
     return $paramsList;
 }
開發者ID:deenison,項目名稱:joomla-cms,代碼行數:23,代碼來源:view.json.php

示例2: testGetProperties

	/**
	 * Tests getting the properties of the object.
	 *
	 * @group    JObject
	 * @covers    JObject::getProperties
	 * @return void
	 */
	public function testGetProperties()
	{
		$this->object = new JObject(
			array(
				'_privateproperty1' => 'valuep1',
				'property1' => 'value1',
				'property2' => 5
			)
		);
		$this->assertEquals(
			array(
				'_errors' => array(),
				'_privateproperty1' => 'valuep1',
				'property1' => 'value1',
				'property2' => 5
			),
			$this->object->getProperties(false),
			'Should get all properties, including private ones'
		);
		$this->assertEquals(
			array(
				'property1' => 'value1',
				'property2' => 5
			),
			$this->object->getProperties(),
			'Should get all public properties'
		);
	}
開發者ID:robschley,項目名稱:joomla-platform,代碼行數:35,代碼來源:JObjectTest.php

示例3: readXML

 public static function readXML($params)
 {
     $temppath = JPATH_BASE . DS . "cache/mod_bps_kiyoh/";
     if (!is_dir($temppath)) {
         mkdir($temppath);
     }
     $xmlUrl = $params->get('xmlUrl', '');
     $cacheTime = (int) $params->get('cacheTime', 480) * 60;
     $filename = md5($xmlUrl . $params->toString());
     $tempfile = $temppath . $filename;
     if (file_exists($tempfile)) {
         $mtime = filemtime($tempfile);
         if (time() - $mtime < $cacheTime) {
             $aXmlData = unserialize(file_get_contents($tempfile));
             return $aXmlData;
         }
     }
     if (!($oXml = simplexml_load_file($xmlUrl))) {
         echo 'Geen xml geladen';
         return false;
     }
     $oXmlInfo = new JObject();
     $oXmlInfo->set('naam', (string) $oXml->company->name);
     $oXmlInfo->set('kiyohLink', (string) $oXml->company->url);
     $oXmlInfo->set('total_score', (double) $oXml->company->total_score);
     $oXmlInfo->set('total_reviews', (int) $oXml->company->total_reviews);
     $oXmlInfo->set('total_views', (int) $oXml->company->total_views);
     $aReviews = array();
     $iReviewCount = 0;
     foreach ($oXml->review_list->review as $oReview) {
         $oReviewInfo = new JObject();
         $oReviewInfo->set('naam', (string) $oReview->customer->name);
         $oReviewInfo->set('place', (string) $oReview->customer->place);
         $oReviewInfo->set('date', JHtml::_('date', (string) $oReview->customer->date, '%d %b'));
         $oReviewInfo->set('dateRaw', JHtml::_('date', (string) $oReview->customer->date, '%Y-%m-%d'));
         $oReviewInfo->set('total_score', (int) $oReview->total_score);
         $oReviewInfo->set('recommendation', (string) $oReview->recommendation);
         $oReviewInfo->set('positive', (string) $oReview->positive);
         $oReviewInfo->set('negative', (string) $oReview->negative);
         $iReviewCount++;
         if ($params->get('reviewOnly', false) && ($oReviewInfo->positive == '' && $oReviewInfo->negative == '')) {
             continue;
         }
         $aReviews[] = $oReviewInfo->getProperties();
     }
     $oXmlInfo->set('reviewCount', $iReviewCount);
     $oXmlInfo->set('aReviews', $aReviews);
     $aXmlData = $oXmlInfo->getProperties();
     //in file zetten
     $file = fopen($tempfile, 'w');
     fwrite($file, serialize($aXmlData));
     fclose($file);
     // print_r_pre($aXmlData);
     // print_r_pre($oXml->review_list);
     return $aXmlData;
 }
開發者ID:nagyistoce,項目名稱:printshop-modules,代碼行數:56,代碼來源:helper.php

示例4: sanitizeConstructorData

 /**
  * Make sure that the data contains CamelCase properties
  *
  * @param   mixed $data Data to sanitize
  *
  * @return JObject
  */
 protected function sanitizeConstructorData($data)
 {
     $data = new JObject($data);
     $properties = $data->getProperties();
     $sanitizeData = new JObject();
     foreach ($properties as $property => $value) {
         $sanitizeData->set(NenoHelper::convertDatabaseColumnNameToPropertyName($property), $value);
     }
     return $sanitizeData;
 }
開發者ID:andresmaeso,項目名稱:neno,代碼行數:17,代碼來源:object.php

示例5: JObject

 /**
  * Gets the appropriate values from the request
  *
  * @return unknown_type
  */
 function _getState()
 {
     $state = new JObject();
     foreach ($state->getProperties() as $key => $value) {
         $new_value = JRequest::getVar($key);
         $value_exists = array_key_exists($key, JRequest::get('post'));
         if ($value_exists && !empty($key)) {
             $state->{$key} = $new_value;
         }
     }
     return $state;
 }
開發者ID:davetheapple,項目名稱:oakencraft,代碼行數:17,代碼來源:report.php

示例6: JObject

 /**
  * Gets the appropriate values from the request
  * 
  * @return JObject
  */
 function _getState()
 {
     $state = new JObject();
     $state->file = '';
     $state->uploaded_file = '';
     $state->uploaded_images_zip_file = '';
     $state->uploaded_files_zip_file = '';
     foreach ($state->getProperties() as $key => $value) {
         $new_value = JRequest::getVar($key);
         $value_exists = array_key_exists($key, $_POST);
         if ($value_exists && !empty($key)) {
             $state->{$key} = $new_value;
         }
     }
     return $state;
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:21,代碼來源:tool_xmlimporter.php

示例7: JObject

 /**
  * Gets the appropriate values from the request
  *
  * return JObject
  */
 function _getState()
 {
     $input = JFactory::getApplication()->input;
     $state = new JObject();
     $state->file = '';
     $state->uploaded_file = '';
     $state->uploaded_images_zip_file = '';
     $state->uploaded_files_zip_file = '';
     foreach ($state->getProperties() as $key => $value) {
         $new_value = $input->get($key);
         $value_exists = array_key_exists($key, $_POST);
         if ($value_exists && !empty($key)) {
             $state->{$key} = $new_value;
         }
     }
     return $state;
 }
開發者ID:joomlacorner,項目名稱:citruscart,代碼行數:22,代碼來源:tool_xmlimporter.php

示例8: JObject

 /**
  * Gets the appropriate values from the request
  * 
  * @return unknown_type
  */
 function _getState()
 {
     $state = new JObject();
     $state->host = '';
     $state->user = '';
     $state->password = '';
     $state->database = '';
     $state->prefix = 'jos_';
     $state->vm_prefix = 'vm_';
     $state->driver = 'mysql';
     $state->port = '3306';
     $state->external_site_url = '';
     foreach ($state->getProperties() as $key => $value) {
         $new_value = JRequest::getVar($key);
         $value_exists = array_key_exists($key, $_POST);
         if ($value_exists && !empty($key)) {
             $state->{$key} = $new_value;
         }
     }
     return $state;
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:26,代碼來源:tool_virtuemartmigration.php

示例9: register

 public function register(InputInterface $input, OutputInterface $output)
 {
     $app = Bootstrapper::getApplication($this->target_dir);
     ob_start();
     // build the record.
     $data = new \JObject();
     $data->name = $this->extension;
     $data->type = $this->type;
     $data->element = $this->extension;
     $data->client_id = $input->getOption('client_id');
     $data->enabled = $input->getOption('enabled');
     $data->position = $input->getOption('position');
     $element = $input->getOption('element');
     if (strlen($element)) {
         $data->element = $element;
     }
     // special case for plugin, naming and folder.
     if ($this->type == 'plugin') {
         // set the default folder for plugins only.
         $data->folder = $input->getOption('folder') ? $input->getOption('folder') : 'system';
         // special case for the plugins only.
         if (substr($data->element, 0, 4) == 'plg_') {
             $data->element = substr($data->element, 4);
         }
     }
     if ($this->type == 'template') {
         if (substr($data->name, 0, 4) == 'tpl_') {
             $data->name = substr($data->name, 4);
             $data->element = substr($data->element, 4);
         }
     }
     //need to be sure that a prefix is provided for components and modules
     if (($this->type == "component" || $this->type == "module") && strpos($data->element, '_') === false) {
         $prefix = array_search($this->type, $this->typeMap);
         $data->element = $prefix . $this->extension;
     }
     // get the #__extensions model and table
     require_once JPATH_ADMINISTRATOR . '/components/com_installer/models/extension.php';
     $model = new \InstallerModel();
     $table = $model->getTable('extension', 'JTable');
     // restrict on same name and type
     $unique = array('name' => $data->name, 'type' => $data->type);
     // does the extension exist?
     if (!$table->load($unique)) {
         if ($table->save($data->getProperties())) {
             if (array_key_exists($this->type, $this->exceptions)) {
                 $this->handleExceptions($output, $app, $data, $this->type);
             }
             $output->writeln("<info>Your extension registered as a '{$this->type}', with extension_id: {$table->extension_id}</info>");
         } else {
             $output->writeln("<info>" . $table->getError() . "</info>");
         }
     } else {
         $output->writeln("<error>{$this->extension} {$this->type}: That extension already exists.</error>");
     }
     ob_end_clean();
 }
開發者ID:eitamar,項目名稱:joomlatools-console,代碼行數:57,代碼來源:Register.php

示例10: JObject

 /**
  * Gets the appropriate values from the request
  *
  * @return unknown_type
  */
 function _getState()
 {
     $app = JFactory::getApplication();
     $state = new JObject();
     $state->host = '';
     $state->user = '';
     $state->password = '';
     $state->database = '';
     $state->prefix = '';
     $state->driver = 'mysql';
     $state->port = '3306';
     foreach ($state->getProperties() as $key => $value) {
         $new_value = $app->input->get($key);
         $value_exists = array_key_exists($key, $_POST);
         if ($value_exists && !empty($key)) {
             $state->{$key} = $new_value;
         }
     }
     return $state;
 }
開發者ID:joomlacorner,項目名稱:citruscart,代碼行數:25,代碼來源:tool_xcartmigration.php

示例11: JObject

 /**
  * Gets the appropriate values from the request
  *
  * @return unknown_type
  */
 function _getState()
 {
     $app = JFactory::getApplication();
     $state = new JObject();
     foreach ($state->getProperties() as $key => $value) {
         //$new_value = JRequest::getVar( $key );
         $new_value = $app->input->get($key);
         $post = $app->input->get($_POST);
         $value_exists = array_key_exists($key, $post);
         if ($value_exists && !empty($key)) {
             $state->{$key} = $new_value;
         }
     }
     return $state;
 }
開發者ID:joomlacorner,項目名稱:citruscart,代碼行數:20,代碼來源:shipping.php


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