public static function findOne($condition=[])
    {
        $instance = (isset($this)) ? $this : new static;
        
        $record = $instance->_findByCondition($condition)
            ->limit(1)
            ->get()->row_array();
        
        // Record check
        if (!$record) {
            return $record;
        }

        return $instance->createActiveRecord($record, $record[$instance->primaryKey]);
    }
public static function findOne($condition=[])
    {
        $instance = (isset($this)) ? $this : new static;
        
        $record = $instance->_findByCondition($condition)
            ->limit(1)
            ->get()->row_array();
        
        // Record check
        if (!$record) {
            return $record;
        }

        return $instance->createActiveRecord($record, $record[$instance->primaryKey]);
    }
public static function findOne ( $ condition = [ ] ) { $ instance = ( isset ( $ this ) ) ? $ this : new static ; $ record = $ instance -> _findByCondition ( $ condition ) -> limit ( 1 ) -> get ( ) -> row_array ( ) ; // Record check if ( ! $ record ) { return $ record ; } return $ instance -> createActiveRecord ( $ record , $ record [ $ instance -> primaryKey ] ) ; }
Return a single active record model instance by a primary key or an array of column values.

@param mixed $condition Refer to _findByCondition() for the explanation of this parameter
@return object ActiveRecord(Model)
@example
$post = $this->Model->findOne(123);
@example
// Query builder ORM usage
$this->Model->find()->where('id', 123);
$this->Model->findOne();
Return a single active record model instance by a primary key or an array of column values .