src/ORM/DataObject.php
public static function get(
        $callerClass = null,
        $filter = "",
        $sort = "",
        $join = "",
        $limit = null,
        $containerClass = DataList::class
    ) {
        // Validate arguments
        if ($callerClass == null) {
            $callerClass = get_called_class();
            if ($callerClass === self::class) {
                throw new InvalidArgumentException('Call <classname>::get() instead of DataObject::get()');
            }
            if ($filter || $sort || $join || $limit || ($containerClass !== DataList::class)) {
                throw new InvalidArgumentException('If calling <classname>::get() then you shouldn\'t pass any other'
                    . ' arguments');
            }
        } elseif ($callerClass === self::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);
        if ($filter) {
            $result = $result->where($filter);
        }
        if ($sort) {
            $result = $result->sort($sort);
        }
        if ($limit && strpos($limit, ',') !== false) {
            $limitArguments = explode(',', $limit);
            $result = $result->limit($limitArguments[1], $limitArguments[0]);
        } elseif ($limit) {
            $result = $result->limit($limit);
        }

        return $result;
    }
public static function get(
        $callerClass = null,
        $filter = "",
        $sort = "",
        $join = "",
        $limit = null,
        $containerClass = DataList::class
    ) {
        // Validate arguments
        if ($callerClass == null) {
            $callerClass = get_called_class();
            if ($callerClass === self::class) {
                throw new InvalidArgumentException('Call <classname>::get() instead of DataObject::get()');
            }
            if ($filter || $sort || $join || $limit || ($containerClass !== DataList::class)) {
                throw new InvalidArgumentException('If calling <classname>::get() then you shouldn\'t pass any other'
                    . ' arguments');
            }
        } elseif ($callerClass === self::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);
        if ($filter) {
            $result = $result->where($filter);
        }
        if ($sort) {
            $result = $result->sort($sort);
        }
        if ($limit && strpos($limit, ',') !== false) {
            $limitArguments = explode(',', $limit);
            $result = $result->limit($limitArguments[1], $limitArguments[0]);
        } elseif ($limit) {
            $result = $result->limit($limit);
        }

        return $result;
    }
public static function get ( $ callerClass = null , $ filter = "" , $ sort = "" , $ join = "" , $ limit = null , $ containerClass = DataList :: class ) { // Validate arguments if ( $ callerClass == null ) { $ callerClass = get_called_class ( ) ; if ( $ callerClass === self :: class ) { throw new InvalidArgumentException ( 'Call <classname>::get() instead of DataObject::get()' ) ; } if ( $ filter || $ sort || $ join || $ limit || ( $ containerClass !== DataList :: class ) ) { throw new InvalidArgumentException ( 'If calling <classname>::get() then you shouldn\'t pass any other' . ' arguments' ) ; } } elseif ( $ callerClass === self :: 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 ) ; if ( $ filter ) { $ result = $ result -> where ( $ filter ) ; } if ( $ sort ) { $ result = $ result -> sort ( $ sort ) ; } if ( $ limit && strpos ( $ limit , ',' ) !== false ) { $ limitArguments = explode ( ',' , $ limit ) ; $ result = $ result -> limit ( $ limitArguments [ 1 ] , $ limitArguments [ 0 ] ) ; } elseif ( $ limit ) { $ result = $ result -> limit ( $ limit ) ; } return $ result ; }
Return all objects matching the filter
sub-classes are automatically selected and included

@param string $callerClass The class of objects to be returned
@param string|array $filter A filter to be inserted into the WHERE clause.
Supports parameterised queries. See SQLSelect::addWhere() for syntax examples.
@param string|array $sort A sort expression to be inserted into the ORDER
BY clause.  If omitted, self::$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.

@todo $containerClass is Ignored, why?

@return DataList The objects matching the filter, in the class specified by $containerClass
Return all objects matching the filter sub - classes are automatically selected and included