public static function create($collection, $id, $database = null)
    {
        $ref = [
            static::$refKey => $collection,
            static::$idKey => $id
        ];

        if ($database !== null) {
            $ref['$db'] = $database;
        }

        return $ref;
    }
public static function create($collection, $id, $database = null)
    {
        $ref = [
            static::$refKey => $collection,
            static::$idKey => $id
        ];

        if ($database !== null) {
            $ref['$db'] = $database;
        }

        return $ref;
    }
public static function create ( $ collection , $ id , $ database = null ) { $ ref = [ static :: $ refKey => $ collection , static :: $ idKey => $ id ] ; if ( $ database !== null ) { $ ref [ '$db' ] = $ database ; } return $ ref ; }
If no database is given, the current database is used.

@link http://php.net/manual/en/mongodbref.create.php
@static
@param string $collection Collection name (without the database name)
@param mixed $id The _id field of the object to which to link
@param string $database Database name
@return array Returns the reference
If no database is given the current database is used .