public function handle(ReadQuery $query)
    {
        $this->validateQuery($query);

        // Get all the records matching the given query conditions
        $records = $this->getAllRecordsMatchingQueryConditions($query);

        // Sort them
        $this->sortRecords($records, $query);
        
        // Limit them
        $this->limitRecords($records, $query);

        // Return them as a Collection
        return new Collection($records);
    }
public function handle(ReadQuery $query)
    {
        $this->validateQuery($query);

        // Get all the records matching the given query conditions
        $records = $this->getAllRecordsMatchingQueryConditions($query);

        // Sort them
        $this->sortRecords($records, $query);
        
        // Limit them
        $this->limitRecords($records, $query);

        // Return them as a Collection
        return new Collection($records);
    }
public function handle ( ReadQuery $ query ) { $ this -> validateQuery ( $ query ) ; // Get all the records matching the given query conditions $ records = $ this -> getAllRecordsMatchingQueryConditions ( $ query ) ; // Sort them $ this -> sortRecords ( $ records , $ query ) ; // Limit them $ this -> limitRecords ( $ records , $ query ) ; // Return them as a Collection return new Collection ( $ records ) ; }
Handle a ReadQuery and return the records in a \Flatbase\Collection

@param ReadQuery $query
@return Collection
@throws \Exception
Handle a ReadQuery and return the records in a \ Flatbase \ Collection