public static function ref($ref)
    {
        if (isset($ref['$id'])) {
            if ($ref['$ref'] == self::collectionName()) {
                return self::id($ref['$id']);
            }
        }

        return null;
    }
public static function ref($ref)
    {
        if (isset($ref['$id'])) {
            if ($ref['$ref'] == self::collectionName()) {
                return self::id($ref['$id']);
            }
        }

        return null;
    }
public static function ref ( $ ref ) { if ( isset ( $ ref [ '$id' ] ) ) { if ( $ ref [ '$ref' ] == self :: collectionName ( ) ) { return self :: id ( $ ref [ '$id' ] ) ; } } return null ; }
Retrieve a record by MongoRef

@param mixed $ref ref

@return Model
Retrieve a record by MongoRef