Example #1
0
    /**
     * Statically creates a new MediaObject instance
     *
     * @param  string $content Its content
     * @param  string $media Its media
     * @param  array $attributes The media object's attributes
     * @return MediaObject
     */
    public static function create($content, $media = null, $attributes = array())
    {
        static::$object = new static($content);
        if ($media) {
            static::$object->with_image($media);
        }
        if ($attributes) static::$object->attributes = $attributes;

        return static::$object;
    }