diff --git a/src/ORM/DataObject.php b/src/ORM/DataObject.php index 65b00fe9ed9..eac7c2f93b0 100644 --- a/src/ORM/DataObject.php +++ b/src/ORM/DataObject.php @@ -3419,7 +3419,6 @@ public function getReverseAssociation($className) * Supports parameterised queries. See SQLSelect::addWhere() for syntax examples. * @param string|array|null $sort Passed to DataList::sort() * BY clause. If omitted, DataObject::$default_sort will be used. - * @param string $join Deprecated 3.0 Join clause. Use leftJoin($table, $joinClause) instead. * @param string|array $limit A limit expression to be inserted into the LIMIT clause. * @param string $containerClass The container class to return the results in. * @@ -3429,7 +3428,6 @@ public static function get( $callerClass = null, $filter = "", $sort = "", - $join = "", $limit = null, $containerClass = DataList::class ) { @@ -3439,18 +3437,13 @@ public static function get( if ($callerClass === DataObject::class) { throw new InvalidArgumentException('Call ::get() instead of DataObject::get()'); } - if ($filter || $sort || $join || $limit || ($containerClass !== DataList::class)) { + if ($filter || $sort || $limit || ($containerClass !== DataList::class)) { throw new InvalidArgumentException('If calling ::get() then you shouldn\'t pass any other' . ' arguments'); } } elseif ($callerClass === DataObject::class) { throw new InvalidArgumentException('DataObject::get() cannot query non-subclass DataObject directly'); } - if ($join) { - throw new InvalidArgumentException( - 'The $join argument has been removed. Use leftJoin($table, $joinClause) instead.' - ); - } // Build and decorate with args $result = DataList::create($callerClass); diff --git a/tests/php/ORM/DataObjectTest.php b/tests/php/ORM/DataObjectTest.php index a5996a5aa24..92add5bfec8 100644 --- a/tests/php/ORM/DataObjectTest.php +++ b/tests/php/ORM/DataObjectTest.php @@ -377,7 +377,7 @@ public function testGet() $this->assertEquals('Phil', $comments->first()->Name); // Test limit - $comments = DataObject::get(DataObjectTest\TeamComment::class, '', "\"Name\" ASC", '', '1,2'); + $comments = DataObject::get(DataObjectTest\TeamComment::class, '', "\"Name\" ASC", '1,2'); $this->assertEquals(2, $comments->count()); $this->assertEquals('Joe', $comments->first()->Name); $this->assertEquals('Phil', $comments->last()->Name);