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


PHP JTable::getTableName方法代码示例

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


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

示例1: testGetTableName

	/**
	 * Test for getTableName
	 *
	 * @covers JTable::getTableName
	 *
	 * @return  void
	 *
	 * @since   12.3
	 */
	public function testGetTableName()
	{
		$this->assertEquals(
			'#__dbtest_composite',
			$this->object->getTableName()
		);
	}
开发者ID:robschley,项目名称:joomla-platform,代码行数:16,代码来源:JTableTest.php

示例2: buildMapQuery

 /**
  * Build query for load operation.
  *
  * @param   \JDatabaseQuery  $query  The query object to handle.
  *
  * @return  \JDatabaseQuery  Return handled query object.
  */
 public function buildMapQuery(\JDatabaseQuery $query = null)
 {
     $conditions = array();
     foreach ($this->mapFks as $field => $foreign) {
         $conditions[$foreign] = $this->parent->{$field};
     }
     $query = $query ?: $this->db->getQuery(true);
     QueryHelper::buildWheres($query, $conditions);
     $query->select('*')->from($this->map->getTableName());
     return $query;
 }
开发者ID:Biromain,项目名称:windwalker-joomla-rad,代码行数:18,代码来源:ManyToManyRelation.php

示例3: targetTable

 /**
  * Method to set property table
  *
  * @param   \JTable $table
  * @param   array   $fks
  *
  * @return  static  Return self to support chaining.
  */
 public function targetTable($table, $fks)
 {
     if (!$table) {
         return $this;
     }
     if (!$table instanceof \JTable) {
         $table = $this->getTable($table, $this->prefix);
     }
     $this->table = $table;
     $this->foreignKeys($fks);
     $this->tableName = $this->table->getTableName();
     $this->db = $table->getDbo();
     return $this;
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:22,代码来源:AbstractRelationHandler.php

示例4: onContentAfterSave

 /**
  * This method will be executed once the content is save
  *
  * @param   string $context Save context
  * @param   JTable $content JTable class of the content
  * @param   bool   $isNew   If the record is new or not
  *
  * @return void
  */
 public function onContentAfterSave($context, $content, $isNew)
 {
     //  If the user has create a new menu item, let's create it.
     if ($context == 'com_menus.item' && $isNew) {
         NenoHelper::createMenuStructure();
     } elseif ($content instanceof JTable) {
         /* @var $db NenoDatabaseDriverMysqlx */
         $db = JFactory::getDbo();
         $tableName = $content->getTableName();
         /* @var $table NenoContentElementTable */
         $table = NenoContentElementTable::load(array('table_name' => $tableName), false);
         if (!empty($table)) {
             // If the record has changed the state to 'Trashed'
             if (isset($content->state) && $content->state == -2) {
                 $primaryKeys = $content->getPrimaryKey();
                 $this->trashTranslations($table, array($content->{$primaryKeys[0]}));
             } else {
                 $fields = $table->getFields(false, true);
                 /* @var $field NenoContentElementField */
                 foreach ($fields as $field) {
                     if ($field->isTranslatable()) {
                         $primaryKeyData = array();
                         foreach ($content->getPrimaryKey() as $primaryKeyName => $primaryKeyValue) {
                             $primaryKeyData[$primaryKeyName] = $primaryKeyValue;
                         }
                         $field->persistTranslations($primaryKeyData);
                     }
                 }
                 $languages = NenoHelper::getLanguages(false);
                 $defaultLanguage = NenoSettings::get('source_language');
                 foreach ($languages as $language) {
                     if ($language->lang_code != $defaultLanguage) {
                         $shadowTable = $db->generateShadowTableName($tableName, $language->lang_code);
                         $properties = $content->getProperties();
                         $query = 'REPLACE INTO ' . $db->quoteName($shadowTable) . ' (' . implode(',', $db->quoteName(array_keys($properties))) . ') VALUES(' . implode(',', $db->quote($properties)) . ')';
                         $db->setQuery($query);
                         $db->execute();
                     }
                 }
             }
         }
     }
 }
开发者ID:andresmaeso,项目名称:neno,代码行数:52,代码来源:neno.php

示例5: getFields

 /**
  * Get Fields.
  *
  * @param  \JTable  $table
  *
  * @return  array
  */
 public static function getFields(\JTable $table)
 {
     if (empty(static::$fields[$table->getTableName()])) {
         // Lookup the fields for this table only once.
         $name = $table->getTableName();
         $fields = $table->getDbo()->getTableColumns($name, false);
         if (empty($fields)) {
             throw new \UnexpectedValueException(sprintf('No columns found for %s table', $name));
         }
         static::$fields[$table->getTableName()] = $fields;
     }
     return static::$fields[$table->getTableName()];
 }
开发者ID:Biromain,项目名称:windwalker-joomla-rad,代码行数:20,代码来源:TableHelper.php

示例6: checkTable

 /**
  * Check is Table exists needed columns?
  *
  * If not, will throw error.
  * 
  * @param    JTable    $table      The item table to detect column exists or not.
  * @param    string    $context    Context for plugin.
  */
 public static function checkTable($table, $context)
 {
     // Needed columns
     $needed = array('title', 'name', 'label', 'field_type', 'element', 'attrs');
     JFactory::getApplication()->triggerEvent('onCCKEngineCheckTable', array($context, $table->getTableName(), &$needed));
     // Check columns
     // ==================================================================
     $lack = array();
     foreach ($needed as $needed) {
         if (!property_exists($table, $needed)) {
             $lack[] = $needed;
         }
     }
     // Raise Error
     if (count($lack) > 0) {
         $message = "Table {$table->getTableName()} need columns: " . implode(', ', $lack);
         JError::raiseError(500, $message);
     }
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:27,代码来源:fields.php


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