本文整理汇总了PHP中FilesModel::getTable方法的典型用法代码示例。如果您正苦于以下问题:PHP FilesModel::getTable方法的具体用法?PHP FilesModel::getTable怎么用?PHP FilesModel::getTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilesModel
的用法示例。
在下文中一共展示了FilesModel::getTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchFor
/**
* {@inheritdoc}
*/
public function searchFor($strPattern)
{
// Base implementation, do a simple search on given column.
$objQuery = \Database::getInstance()->prepare(sprintf('SELECT id
FROM %s
WHERE %s IN
(SELECT uuid FROM
%s
WHERE path
LIKE
?)', $this->getMetaModel()->getTableName(), $this->getColName(), \FilesModel::getTable()))->execute(str_replace(array('*', '?'), array('%', '_'), $strPattern));
$arrIds = $objQuery->fetchEach('id');
return $arrIds;
}
示例2: collectFiles
/**
* Walks the list of pending folders via ToolboxFile::addPath().
*
* @return void
*/
protected function collectFiles()
{
$table = \FilesModel::getTable();
$conditions = array();
$parameters = array();
if (count($this->pendingIds)) {
$conditions[] = $table . '.uuid IN(' . implode(',', array_fill(0, count($this->pendingIds), 'UNHEX(?)')) . ')';
$parameters = array_map('bin2hex', $this->pendingIds);
$this->pendingIds = array();
}
if (count($this->pendingPaths)) {
$slug = $table . '.path LIKE ?';
foreach ($this->pendingPaths as $pendingPath) {
$conditions[] = $slug;
$parameters[] = $pendingPath . '%';
}
$this->pendingPaths = array();
}
if (!count($conditions)) {
return;
}
if ($files = \FilesModel::findBy(array(implode(' OR ', $conditions)), $parameters)) {
$this->addFileModels($files);
}
if (count($this->pendingPaths)) {
// Run again.
$this->collectFiles();
}
}