Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Use parent newQuery to get a Builder object. #245

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/LaravelBook/Ardent/Ardent.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,19 +885,14 @@ public static function find($id, $columns = array('*')) {
* @return \Illuminate\Database\Eloquent\Builder
*/
public function newQuery($excludeDeleted = true) {
$builder = new Builder($this->newBaseQueryBuilder());
$builder = parent::newQuery();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would stop the library of using it's own Builder. Maybe newEloquentBuilder should be overridden?

$builder->throwOnFind = static::$throwOnFind;

// Once we have the query builders, we will set the model instances so the
// builder can easily access any information it may need from the model
// while it is constructing and executing various queries against it.
$builder->setModel($this)->with($this->with);

if ($excludeDeleted and $this->softDelete)
{
$builder->whereNull($this->getQualifiedDeletedAtColumn());
}

return $builder;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to #227?

}

Expand Down