diff --git a/src/QueryBuilder/QueryBuilderFlex.php b/src/QueryBuilder/QueryBuilderFlex.php index ae4b8a70..0bdb0641 100644 --- a/src/QueryBuilder/QueryBuilderFlex.php +++ b/src/QueryBuilder/QueryBuilderFlex.php @@ -80,7 +80,6 @@ public function __construct(\Pixie\Connection $connection = null) $this->setFetchMode(PDO::FETCH_ASSOC); } - /** * {@inheritdoc} */ @@ -91,6 +90,18 @@ public function limit($limit) return parent::limit($limit); } + /** + * {@inheritdoc} + */ + protected function whereHandler($key, $operator = null, $value = null, $joiner = 'AND') + { + if ($value instanceof BaseModel) { + $value = $value->getId(); + } + + return parent::whereHandler($key, $operator, $value, $joiner); + } + // // QueryBuilderFlex unique functions //