本文整理汇总了PHP中OOMedia::_getTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP OOMedia::_getTableName方法的具体用法?PHP OOMedia::_getTableName怎么用?PHP OOMedia::_getTableName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OOMedia
的用法示例。
在下文中一共展示了OOMedia::_getTableName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFiles
/**
* @access public
*/
function getFiles()
{
if ($this->_files === null) {
$this->_files = array();
$qry = 'SELECT file_id FROM ' . OOMedia::_getTableName() . ' WHERE category_id = ' . $this->getId();
$sql = new rex_sql();
$sql->setQuery($qry);
$result = $sql->getArray();
if (is_array($result)) {
foreach ($result as $line) {
$this->_files[] =& OOMedia::getMediaById($line['file_id']);
}
}
}
return $this->_files;
}
示例2: getMediaByFileName
/**
* @access public
*/
function getMediaByFileName($name)
{
$query = 'SELECT file_id FROM ' . OOMedia::_getTableName() . ' WHERE filename = "' . $name . '"';
$sql = new rex_sql();
$result = $sql->getArray($query);
if (is_array($result)) {
foreach ($result as $line) {
return OOMedia::getMediaById($line['file_id']);
}
}
return null;
}
示例3: searchMediaByFileName
/**
* @access public
*/
function searchMediaByFileName($name)
{
$query = 'SELECT file_id FROM ' . OOMedia::_getTableName() . ' WHERE filename = "' . addslashes($name) . '"';
$sql = new sql();
$result = $sql->get_array($query);
$media = array();
foreach ($result as $line) {
$media[] = OOMedia::getMediaById($line['file_id']);
}
return $media;
}
示例4: rex_generateMediaExtensionList
/**
* Generiert eine Liste mit allen Media einer Dateiendung
*
* @param $extension Dateiendung der zu generierenden Liste
*
* @return TRUE bei Erfolg, sonst FALSE
*/
function rex_generateMediaExtensionList($extension)
{
global $REX;
$query = 'SELECT filename FROM ' . OOMedia::_getTableName() . ' WHERE SUBSTRING(filename,LOCATE( ".",filename)+1) = "' . $extension . '"';
$sql = rex_sql::factory();
$sql->setQuery($query);
$content = '<?php' . "\n";
for ($i = 0; $i < $sql->getRows(); $i++) {
$content .= '$REX[\'MEDIA\'][\'EXTENSION\'][\'' . $extension . '\'][' . $i . '] = \'' . $sql->getValue('filename') . '\';' . "\n";
$sql->next();
}
$content .= '?>';
$list_file = $REX['GENERATED_PATH'] . "/files/{$extension}.mextlist";
if (rex_file::put($list_file, $content)) {
return true;
}
return false;
}
示例5: getMediaById
/**
* @access public
* @deprecated 20.02.2010
* Stattdessen getMediaByFileName() nutzen
*/
function getMediaById($id)
{
global $REX;
$id = (int) $id;
if ($id == 0) {
return null;
}
$sql = rex_sql::factory();
// $sql->debugsql = true;
$sql->setQuery('SELECT filename FROM ' . OOMedia::_getTableName() . ' WHERE file_id=' . $id);
if ($sql->getRows() == 1) {
return OOMedia::getMediaByFileName($sql->getValue('filename'));
}
return NULL;
}