\Google\Photos\Library\V1FiltersBuilder

Provides an easier interface for constructing {@link Filters} objects.

Usage: $filters = FiltersBuilder::new() ->addIncludedContentCategory(ContentCategory::LANDSCAPES) ->setIncludeArchivedMedia(true) ->build(); $searchMediaItemsRequest->setFilters($filters);

Summary

Methods
Properties
Constants
construct()
build()
setMediaTypeFromString()
setMediaType()
addIncludedCategory()
addIncludedCategoryFromString()
addIncludedFeature()
addIncludedFeatureFromString()
addExcludedCategory()
addExcludedCategoryFromString()
addDateRange()
addDateRangeFromDateTime()
addDate()
addDateFromDateTime()
setIncludeArchivedMedia()
setExcludeNonAppCreatedData()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
convertToGoogleDate()
$mediaType
$includedCategories
$includedFeatures
$excludedCategories
$ranges
$dates
$includeArchivedMedia
$excludeNonAppCreatedData
N/A

Properties

$mediaType

$mediaType

$includedCategories

$includedCategories

$includedFeatures

$includedFeatures

$excludedCategories

$excludedCategories

$ranges

$ranges

$dates

$dates

$includeArchivedMedia

$includeArchivedMedia

$excludeNonAppCreatedData

$excludeNonAppCreatedData

Methods

construct()

construct() : mixed

Returns

mixed

build()

build() : \Google\Photos\Library\V1\Filters

Builds a Filters object.

Returns

\Google\Photos\Library\V1\Filters —

The built Filters object.

setMediaTypeFromString()

setMediaTypeFromString(string  $mediaType) : $this

Sets the media type, from a string. Overwrites the existing media type.

Parameters

string $mediaType

The media type to set. Must be an element of {@link PhotosLibraryClient::mediaTypes()}

Returns

$this

setMediaType()

setMediaType(int  $mediaType) : $this

Sets the media type. Overwrites the existing media type.

Parameters

int $mediaType

The media type to set, a constant from MediaType.

Returns

$this

addIncludedCategory()

addIncludedCategory(int  $category) : $this

Adds a category to the list of included categories.

Parameters

int $category

The category to include; a constant from {@link ContentCategory}.

Returns

$this

addIncludedCategoryFromString()

addIncludedCategoryFromString(string  $category) : $this

Adds a category to the list of included categories.

Parameters

string $category

The category to include. Must be an element of {@link PhotosLibraryClient::contentCategories()}

Returns

$this

addIncludedFeature()

addIncludedFeature(int  $feature) : $this

Adds a feature to the list of included features.

Parameters

int $feature

The feature to include; a constant from {@link Feature}.

Returns

$this

addIncludedFeatureFromString()

addIncludedFeatureFromString(string  $feature) : $this

Adds a category to the list of included features.

Parameters

string $feature

The feature to include. Must be an element of {@link PhotosLibraryClient::features()}

Returns

$this

addExcludedCategory()

addExcludedCategory(int  $category) : $this

Adds a category to the list of of excluded categories.

Parameters

int $category

The category to exclude.

Returns

$this

addExcludedCategoryFromString()

addExcludedCategoryFromString(string  $category) : $this

Adds a category to the list of excluded categories.

Parameters

string $category

The category to exclude. Must be an element of {@link PhotosLibraryClient::contentCategories()}

Returns

$this

addDateRange()

addDateRange(\Google\Type\Date  $start, \Google\Type\Date  $end) : $this

Adds a date range to the list of included date ranges.

Parameters

\Google\Type\Date $start
\Google\Type\Date $end

Returns

$this

addDateRangeFromDateTime()

addDateRangeFromDateTime(\DateTime  $start, \DateTime  $end) : $this

Adds a date range to the list of included date ranges, from two DateTimes.

If you require dates with wildcards (e.g., a year-only date), you must use addDateRange.

Parameters

\DateTime $start
\DateTime $end

Returns

$this

addDate()

addDate(\Google\Type\Date  $date) : $this

Adds a date to the list of included dates.

Parameters

\Google\Type\Date $date

Returns

$this

addDateFromDateTime()

addDateFromDateTime(\DateTime  $date) : $this

Adds a date to the list of included dates, from a DateTime.

If you require a date with wildcards (e.g., a year-only date), you must use addDate.

Parameters

\DateTime $date

Returns

$this

setIncludeArchivedMedia()

setIncludeArchivedMedia(bool  $includeArchivedMedia) : $this

Sets the flag to include archived media. If false, archived media will not be returned.

Parameters

bool $includeArchivedMedia

Returns

$this

setExcludeNonAppCreatedData()

setExcludeNonAppCreatedData(bool  $excludeNonAppCreatedData) : $this

Sets the flag to exclude non-app created data. If true, media that was not created by this application will not be returned.

Parameters

bool $excludeNonAppCreatedData

Returns

$this

convertToGoogleDate()

convertToGoogleDate(\DateTime  $date) : \Google\Type\Date

Converts a DateTime object into a Google Date object.

Parameters

\DateTime $date

Returns

\Google\Type\Date