Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing deprecated DataObject::buildDataObjectSet()

Use DataList API instead
  • Loading branch information...
commit a8d779b4dec33788e3d72437e06a4c46e18b895d 1 parent dde820d
@halkyon halkyon authored
Showing with 0 additions and 36 deletions.
  1. +0 −36 model/DataObject.php
View
36 model/DataObject.php
@@ -2739,42 +2739,6 @@ public function instance_get($filter = "", $sort = "", $join = "", $limit="", $c
}
/**
- * Take a database {@link SS_Query} and instanciate an object for each record.
- *
- * @deprecated 3.0 Replaced by DataList
- *
- * @param SS_Query|array $records The database records, a {@link SS_Query} object or an array of maps.
- * @param string $containerClass The class to place all of the objects into.
- *
- * @return mixed The new objects in an object of type $containerClass
- */
- public function buildDataObjectSet($records, $containerClass = "DataObjectSet", $query = null, $baseClass = null) {
- Deprecation::notice('3.0', 'Use DataList instead.');
-
- foreach($records as $record) {
- if(empty($record['RecordClassName'])) {
- $record['RecordClassName'] = $record['ClassName'];
- }
- if(class_exists($record['RecordClassName'])) {
- $results[] = new $record['RecordClassName']($record);
- } else {
- if(!$baseClass) {
- user_error("Bad RecordClassName '{$record['RecordClassName']}' and "
- . "\$baseClass not set", E_USER_ERROR);
- } else if(!is_string($baseClass) || !class_exists($baseClass)) {
- user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad "
- . "\$baseClass '$baseClass not set", E_USER_ERROR);
- }
- $results[] = new $baseClass($record);
- }
- }
-
- if(isset($results)) {
- return new $containerClass($results);
- }
- }
-
- /**
* Return the first item matching the given query.
* All calls to get_one() are cached.
*
Please sign in to comment.
Something went wrong with that request. Please try again.