当前位置: 首页>>代码示例>>PHP>>正文


PHP JTable::getFields方法代码示例

本文整理汇总了PHP中JTable::getFields方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::getFields方法的具体用法?PHP JTable::getFields怎么用?PHP JTable::getFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JTable的用法示例。


在下文中一共展示了JTable::getFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRowData

 /**
  * Gets a row of data from a table
  *
  * @param   JTable  $table  JTable instance for a row.
  *
  * @return  array  Associative array of all columns and values for a row in a table.
  *
  * @since   3.1
  */
 public function getRowData($table)
 {
     $fields = $table->getFields();
     $data = array();
     foreach ($fields as &$field) {
         $columnName = $field->Field;
         $value = $table->{$columnName};
         $data[$columnName] = $value;
     }
     return $data;
 }
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:20,代码来源:content.php

示例2: testGetFields

 /**
  * Test for getFields method.
  *
  * @return  void
  *
  * @since   12.3
  */
 public function testGetFields()
 {
     $this->assertEquals(array('id1' => (object) array('Field' => 'id1', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => 'PRI'), 'id2' => (object) array('Field' => 'id2', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => 'PRI'), 'title' => (object) array('Field' => 'title', 'Type' => 'TEXT', 'Null' => 'NO', 'Default' => '\'\'', 'Key' => ''), 'asset_id' => (object) array('Field' => 'asset_id', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => ''), 'hits' => (object) array('Field' => 'hits', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => ''), 'checked_out' => (object) array('Field' => 'checked_out', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => ''), 'checked_out_time' => (object) array('Field' => 'checked_out_time', 'Type' => 'TEXT', 'Null' => 'NO', 'Default' => '\'0000-00-00 00:00:00\'', 'Key' => ''), 'published' => (object) array('Field' => 'published', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => ''), 'publish_up' => (object) array('Field' => 'publish_up', 'Type' => 'TEXT', 'Null' => 'NO', 'Default' => '\'0000-00-00 00:00:00\'', 'Key' => ''), 'publish_down' => (object) array('Field' => 'publish_down', 'Type' => 'TEXT', 'Null' => 'NO', 'Default' => '\'0000-00-00 00:00:00\'', 'Key' => ''), 'ordering' => (object) array('Field' => 'ordering', 'Type' => 'INTEGER', 'Null' => 'NO', 'Default' => '\'0\'', 'Key' => ''), 'params' => (object) array('Field' => 'params', 'Type' => 'TEXT', 'Null' => 'NO', 'Default' => '\'\'', 'Key' => '')), $this->object->getFields());
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:11,代码来源:JTableTest.php

示例3: getDataObject

 /**
  * Method to get an object containing all of the table columns and values.
  *
  * @param   JTable  $table  JTable object.
  *
  * @return  object Contains all of the columns and values.
  *
  * @since   3.2
  */
 public function getDataObject(JTable $table)
 {
     $fields = $table->getFields();
     $dataObject = new stdClass();
     foreach ($fields as $field) {
         $fieldName = $field->Field;
         $dataObject->{$fieldName} = $table->get($fieldName);
     }
     return $dataObject;
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:19,代码来源:helper.php


注:本文中的JTable::getFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。