YouTubePHP Documentation

ActivitySnippet extends Part
in package

This file is generated from spec/discovery.json (YouTube Data API v3, revision 20260924) by tools/generate.php. Do not edit it by hand - run `composer spec:build` instead.

Basic details about an activity, including title, description, thumbnails, activity type and group. Next ID: 12

Tags
since
1.0.0

Table of Contents

Constants

TYPE_BULLETIN  : mixed = 'bulletin'
A `type` of `bulletin`.
TYPE_CHANNEL_ITEM  : mixed = 'channelItem'
A `type` of `channelItem`.
TYPE_COMMENT  : mixed = 'comment'
A `type` of `comment`.
TYPE_PLAYLIST_ITEM  : mixed = 'playlistItem'
A `type` of `playlistItem`.
TYPE_PROMOTED_ITEM  : mixed = 'promotedItem'
A `type` of `promotedItem`.
TYPE_RECOMMENDATION  : mixed = 'recommendation'
A `type` of `recommendation`.
TYPE_SOCIAL  : mixed = 'social'
A `type` of `social`.
TYPE_SUBSCRIPTION  : mixed = 'subscription'
A `type` of `subscription`.
TYPE_TYPE_UNSPECIFIED  : mixed = 'typeUnspecified'
A `type` of `typeUnspecified`.
TYPE_UPLOAD  : mixed = 'upload'
A `type` of `upload`.

Properties

$channelId  : string|null
$channelTitle  : string|null
$description  : string|null
$groupId  : string|null
$publishedAt  : CarbonImmutable|null
$thumbnails  : ThumbnailDetails|null
$title  : string|null
$type  : string|null
$casts  : array<string, string>
Attribute name => type token (`"LiveChatMessageSnippet"`, `"Array of Thumbnail"`, `"Map of VideoLocalization"`), used to hydrate nested objects into parts.
$dates  : array<int, string>
Attribute names holding RFC 3339 timestamps, read back as {@see CarbonImmutable}. They are stored and serialised as the strings YouTube sent.
$youtube  : ?YouTube

Methods

__construct()  : mixed
__debugInfo()  : array<string, mixed>
__get()  : mixed
__isset()  : bool
__set()  : void
__toString()  : string
__unset()  : void
attributeExists()  : bool
fill()  : void
getAttribute()  : mixed
getCasts()  : array<string, string>
getDates()  : array<int, string>
getRawAttribute()  : mixed
Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
getRawAttributes()  : array<string, mixed>
getYouTube()  : YouTube
The client this part came from.
jsonSerialize()  : array<string, mixed>
The payload this part would be sent back to YouTube as: nested parts and collections flattened, timestamps as RFC 3339 strings.
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
setAttribute()  : void
factory()  : Factory
Builds another part from the same client - for nested objects.
setRawAttribute()  : void
Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.

Constants

TYPE_BULLETIN

A `type` of `bulletin`.

public mixed TYPE_BULLETIN = 'bulletin'

TYPE_CHANNEL_ITEM

A `type` of `channelItem`.

public mixed TYPE_CHANNEL_ITEM = 'channelItem'

TYPE_COMMENT

A `type` of `comment`.

public mixed TYPE_COMMENT = 'comment'

TYPE_PLAYLIST_ITEM

A `type` of `playlistItem`.

public mixed TYPE_PLAYLIST_ITEM = 'playlistItem'

TYPE_PROMOTED_ITEM

A `type` of `promotedItem`.

public mixed TYPE_PROMOTED_ITEM = 'promotedItem'

TYPE_RECOMMENDATION

A `type` of `recommendation`.

public mixed TYPE_RECOMMENDATION = 'recommendation'

TYPE_SOCIAL

A `type` of `social`.

public mixed TYPE_SOCIAL = 'social'

TYPE_SUBSCRIPTION

A `type` of `subscription`.

public mixed TYPE_SUBSCRIPTION = 'subscription'

TYPE_TYPE_UNSPECIFIED

A `type` of `typeUnspecified`.

public mixed TYPE_TYPE_UNSPECIFIED = 'typeUnspecified'

TYPE_UPLOAD

A `type` of `upload`.

public mixed TYPE_UPLOAD = 'upload'

Properties

$channelId

public string|null $channelId

The ID that YouTube uses to uniquely identify the channel associated with the activity.

$channelTitle

public string|null $channelTitle

Channel title for the channel responsible for this activity

$description

public string|null $description

The description of the resource primarily associated with the activity. @mutable youtube.activities.insert

$groupId

public string|null $groupId

The group ID associated with the activity. A group ID identifies user events that are associated with the same user and resource. For example, if a user uploads a video and watches the same video, the entries for those events would have the same group ID in the user's activity feed. In your user interface, you can avoid repetition by grouping events with the same groupId value.

$publishedAt

public CarbonImmutable|null $publishedAt

The date and time that the video was uploaded.

$thumbnails

public ThumbnailDetails|null $thumbnails

A map of thumbnail images associated with the resource that is primarily associated with the activity. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.

$title

public string|null $title

The title of the resource primarily associated with the activity.

$type

public string|null $type

The type of activity that the resource describes. One of the TYPE_* constants.

$casts

Attribute name => type token (`"LiveChatMessageSnippet"`, `"Array of Thumbnail"`, `"Map of VideoLocalization"`), used to hydrate nested objects into parts.

protected array<string, string> $casts = ['thumbnails' => 'ThumbnailDetails']

$dates

Attribute names holding RFC 3339 timestamps, read back as {@see CarbonImmutable}. They are stored and serialised as the strings YouTube sent.

protected array<int, string> $dates = ['publishedAt']

Methods

__construct()

public __construct([YouTube|null $youtube = null ][, array<string, mixed>|object $attributes = [] ]) : mixed
Parameters
$youtube : YouTube|null = null

The client, for behaviour that calls the API.

$attributes : array<string, mixed>|object = []

__debugInfo()

public __debugInfo() : array<string, mixed>
Return values
array<string, mixed>

__get()

public __get(string $name) : mixed
Parameters
$name : string

__isset()

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__toString()

public __toString() : string
Return values
string

__unset()

public __unset(string $name) : void
Parameters
$name : string

attributeExists()

public attributeExists(string $key) : bool
Parameters
$key : string
Return values
bool

fill()

public fill(array<string, mixed> $attributes) : void
Parameters
$attributes : array<string, mixed>

getAttribute()

public getAttribute(string $key) : mixed
Parameters
$key : string

getCasts()

public getCasts() : array<string, string>
Return values
array<string, string>

getDates()

public getDates() : array<int, string>
Return values
array<int, string>

getRawAttribute()

Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.

public getRawAttribute(string $key) : mixed
Parameters
$key : string

getRawAttributes()

public getRawAttributes() : array<string, mixed>
Return values
array<string, mixed>

getYouTube()

The client this part came from.

public getYouTube() : YouTube
Tags
throws
LogicException

When the part was built without one.

Return values
YouTube

jsonSerialize()

The payload this part would be sent back to YouTube as: nested parts and collections flattened, timestamps as RFC 3339 strings.

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

setAttribute()

public setAttribute(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed

factory()

Builds another part from the same client - for nested objects.

protected factory() : Factory
Return values
Factory

setRawAttribute()

Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.

protected setRawAttribute(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
On this page

Search results