public function findBy(array $wheres, array $options = [])
    {
        $query = $this->getSqlObject()->select();

        $this->setColumns($query, $options);

        $wheres = $this->addJoins($query, $wheres, $options);

        $this->addWheres($query, $wheres, $options);

        if (Arr::get($options, 'order')) {
            $this->setOrder($query, $options['order']);
        }

        return $this->executeAndGetResultsAsEntity($query);
    }
public function findBy(array $wheres, array $options = [])
    {
        $query = $this->getSqlObject()->select();

        $this->setColumns($query, $options);

        $wheres = $this->addJoins($query, $wheres, $options);

        $this->addWheres($query, $wheres, $options);

        if (Arr::get($options, 'order')) {
            $this->setOrder($query, $options['order']);
        }

        return $this->executeAndGetResultsAsEntity($query);
    }
public function findBy ( array $ wheres , array $ options = [ ] ) { $ query = $ this -> getSqlObject ( ) -> select ( ) ; $ this -> setColumns ( $ query , $ options ) ; $ wheres = $ this -> addJoins ( $ query , $ wheres , $ options ) ; $ this -> addWheres ( $ query , $ wheres , $ options ) ; if ( Arr :: get ( $ options , 'order' ) ) { $ this -> setOrder ( $ query , $ options [ 'order' ] ) ; } return $ this -> executeAndGetResultsAsEntity ( $ query ) ; }
Find a single entity by specific field values

@param  array  $wheres An array of where conditions in the format:
['column' => 'value'] or
['column', 'operator', 'value']
@param  array  $options
@return AbstractEntity|bool
Find a single entity by specific field values