From fda7a6aafe4bb3ca81151a499a5c918f134a81c0 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 2 Mar 2012 15:22:11 +0100 Subject: [PATCH] API CHANGE Remove custom File::instance_get(), use a custom DataQuery in case you want to exclude large File.Content fields from the query results --- filesystem/File.php | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/filesystem/File.php b/filesystem/File.php index a23eea95c..f29973cf3 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -771,46 +771,6 @@ class File extends DataObject { return 0; } } - - /** - * We've overridden the DataObject::get function for File so that the very large content field - * is excluded! - * - * @todo Admittedly this is a bit of a hack; but we need a way of ensuring that large - * TEXT fields don't stuff things up for the rest of us. Perhaps a separate search table would - * be a better way of approaching this? - * @deprecated alternative_instance_get() - */ - public function instance_get($filter = "", $sort = "", $join = "", $limit="", $containerClass = "DataObjectSet", $having="") { - Deprecation::notice('2.5', 'Use alternative_instance_get() instead.'); - - $query = $this->extendedSQL($filter, $sort, $limit, $join, $having); - $baseTable = reset($query->from); - - $excludeDbColumns = array('Content'); - - // Work out which columns we're actually going to select - // In short, we select everything except File.Content - $dataobject_select = array(); - foreach($query->select as $item) { - /* - if($item == "\"File\".*") { - $fileColumns = DB::query("SHOW FIELDS IN \"File\"")->column(); - $columnsToAdd = array_diff($fileColumns, $excludeDbColumns); - foreach($columnsToAdd as $otherItem) $dataobject_select[] = '"File".' . $otherItem; - } else { - */ - $dataobject_select[] = $item; - //} - } - - $query->select = $dataobject_select; - - $records = $query->execute(); - $ret = $this->buildDataObjectSet($records, $containerClass); - - return $ret; - } public function flushCache() { parent::flushCache();