Skip to content

Commit

Permalink
return record if itself it attempted to be looked up
Browse files Browse the repository at this point in the history
  • Loading branch information
nateiler committed Jan 11, 2019
1 parent a85e3f6 commit a0e230d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/records/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ protected static function findByCondition($condition)
return $query->andWhere($condition);
}


/*******************************************
* FIND
*******************************************/

/**
* @inheritdoc
*/
public static function findOne($condition)
{
if ($condition instanceof self) {
return $condition;
}

return parent::findOne($condition);
}


/*******************************************
* GET
*******************************************/
Expand Down

0 comments on commit a0e230d

Please sign in to comment.