public function getId()
    {
        $class = get_called_class();

        if (isset($this->cleanData['_id'])) {
            if($class::$customIdType === true) return $this->cleanData['_id'];

            return new \MongoId($this->cleanData['_id']);
        } elseif (isset($this->_tempId)) {
            return $this->_tempId;
        }

        return null;
    }
public function getId()
    {
        $class = get_called_class();

        if (isset($this->cleanData['_id'])) {
            if($class::$customIdType === true) return $this->cleanData['_id'];

            return new \MongoId($this->cleanData['_id']);
        } elseif (isset($this->_tempId)) {
            return $this->_tempId;
        }

        return null;
    }
public function getId ( ) { $ class = get_called_class ( ) ; if ( isset ( $ this -> cleanData [ '_id' ] ) ) { if ( $ class :: $ customIdType === true ) return $ this -> cleanData [ '_id' ] ; return new \ MongoId ( $ this -> cleanData [ '_id' ] ) ; } elseif ( isset ( $ this -> _tempId ) ) { return $ this -> _tempId ; } return null ; }
get MongoId of this record

@return \MongoId Object
get MongoId of this record