Merged unused search service method

This commit is contained in:
Marcin Kurczewski 2014-06-10 21:32:18 +02:00
parent 0f112adb05
commit 37fdc3057f

View file

@ -36,7 +36,7 @@ abstract class AbstractSearchService
new Sql\Binding(($page - 1) * $perPage)); new Sql\Binding(($page - 1) * $perPage));
} }
public static function getEntitiesRows($searchQuery, $perPage = null, $page = 1) public static function getEntities($searchQuery, $perPage = null, $page = 1)
{ {
$modelClassName = self::getModelClassName(); $modelClassName = self::getModelClassName();
$table = $modelClassName::getTableName(); $table = $modelClassName::getTableName();
@ -48,13 +48,8 @@ abstract class AbstractSearchService
static::decorateCustom($stmt); static::decorateCustom($stmt);
static::decoratePager($stmt, $perPage, $page); static::decoratePager($stmt, $perPage, $page);
return Core::getDatabase()->fetchAll($stmt); $rows = Core::getDatabase()->fetchAll($stmt);
}
public static function getEntities($searchQuery, $perPage = null, $page = 1)
{
$modelClassName = self::getModelClassName(); $modelClassName = self::getModelClassName();
$rows = static::getEntitiesRows($searchQuery, $perPage, $page);
return $modelClassName::spawnFromDatabaseRows($rows); return $modelClassName::spawnFromDatabaseRows($rows);
} }