本文整理汇总了PHP中Reflector::getRows方法的典型用法代码示例。如果您正苦于以下问题:PHP Reflector::getRows方法的具体用法?PHP Reflector::getRows怎么用?PHP Reflector::getRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reflector
的用法示例。
在下文中一共展示了Reflector::getRows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTags
/**
* Compiles and returns the tags.
*
* @return array
*/
public function getTags()
{
// Get affected database and tables, add prefixes
$database = $this->prefix($this->reflector->getDatabase(), self::PREFIX_DATABASE);
// Get affected tables, don't add prefixes yes
$tables = $this->reflector->getTables();
// If rows should not be considered, we don't have to differ between specific and unspecific queries
// We can simply prefix all tables with the database and return them
if ($this->considerRows === false) {
return $this->prefix($tables, $database);
}
// Get affected rows as multidimensional array per table
$rows = $this->reflector->getRows();
// Create the table tags with corresponding prefix
// Depending on whether the queries are specific or not
$tags = $this->getTableTags($tables, $rows);
// Then we loop trough all these tags and add a tag for each row
// Consisting of the prefixed table and the row with prefix
foreach ($tables as $table) {
if (!isset($rows[$table])) {
continue;
}
$tablePrefix = $this->prefix($table, self::PREFIX_TABLE_SPECIFIC);
$rowPrefix = $this->prefix(self::PREFIX_ROW, $tablePrefix);
$tags = array_merge($tags, $this->prefix($rows[$table], $rowPrefix));
}
return $this->prefix($tags, $database);
}