protected function fetchRows($arrIds, $arrAttrOnly = array())
{
$parameters = array_merge($arrIds, $arrIds);
$objRow = $this->getDatabase()->prepare(sprintf('SELECT * FROM %s WHERE id IN (%s) ORDER BY FIELD(id,%s)', $this->getTableName(), $this->buildDatabaseParameterList($arrIds), $this->buildDatabaseParameterList($arrIds)))->execute($parameters);
/** @noinspection PhpUndefinedFieldInspection */
if ($objRow->numRows == 0) {
return array();
}
// If we have an attribute restriction, make sure we keep the system columns. See #196.
if ($arrAttrOnly) {
$arrAttrOnly = array_merge($GLOBALS['METAMODELS_SYSTEM_COLUMNS'], $arrAttrOnly);
}
return $this->convertRowsToResult($objRow, $arrAttrOnly);
}