source/Spiral/ORM/Entities/RecordSelector.php
public function findOne(array $query = null)
    {
        $data = (clone $this)->where($query)->fetchData();

        if (empty($data[0])) {
            return null;
        }

        return $this->orm->make($this->class, $data[0], ORMInterface::STATE_LOADED, true);
    }
public function findOne(array $query = null)
    {
        $data = (clone $this)->where($query)->fetchData();

        if (empty($data[0])) {
            return null;
        }

        return $this->orm->make($this->class, $data[0], ORMInterface::STATE_LOADED, true);
    }
public function findOne ( array $ query = null ) { $ data = ( clone $ this ) -> where ( $ query ) -> fetchData ( ) ; if ( empty ( $ data [ 0 ] ) ) { return null ; } return $ this -> orm -> make ( $ this -> class , $ data [ 0 ] , ORMInterface :: STATE_LOADED , true ) ; }
Find one entity or return null.

@param array|null $query

@return EntityInterface|null
Find one entity or return null .