ScalesCms.Cms.CmsPageLocaleLatestVariants (scales_cms v0.1.20)

The Cms context.

Summary

Functions

Returns an %Ecto.Changeset{} for tracking cms_page_locale_latest_variant changes.

Creates a cms_page_locale_latest_variant.

Gets a single cms_page_locale_latest_variant.

Gets a single cms_page_locale_latest_variant for a specific locale.

Gets a single get_cms_page_locale_latest_variant_for_page_and_locale_by_slug for a specific locale by slug.

Returns the list of cms_page_locale_latest_variants.

Returns the list of cms_page_locale_latest_variants for all pages and a specified locale.

Returns the list of cms_page_locale_latest_variants for a page and a specified locale.

Returns the list of cms_page_locale_latest_variants for all pages and a specified locale. Paginated.

Functions

change_cms_page_locale_latest_variant(cms_page_locale_latest_variant, attrs \\ %{})

Returns an %Ecto.Changeset{} for tracking cms_page_locale_latest_variant changes.

Examples

iex> change_cms_page_locale_latest_variant(cms_page_locale_latest_variant)
%Ecto.Changeset{data: %CmsPageVariant{}}

count_cms_page_locale_latest_variants_for_locale(locale)

create_cms_page_locale_latest_variant(attrs \\ %{})

Creates a cms_page_locale_latest_variant.

Examples

iex> create_cms_page_locale_latest_variant(%{field: value})
{:ok, %CmsPageVariant{}}

iex> create_cms_page_locale_latest_variant(%{field: bad_value})
{:error, %Ecto.Changeset{}}

delete_cms_page_locale_latest_variant(cms_page_locale_latest_variant)

Deletes a cms_page_locale_latest_variant.

Examples

iex> delete_cms_page_locale_latest_variant(cms_page_locale_latest_variant)
{:ok, %CmsPageVariant{}}

iex> delete_cms_page_locale_latest_variant(cms_page_locale_latest_variant)
{:error, %Ecto.Changeset{}}

delete_cms_page_locale_latest_variants_for_page(page_id)

get_cms_page_locale_latest_variant!(id)

Gets a single cms_page_locale_latest_variant.

Raises Ecto.NoResultsError if the Cms page variant does not exist.

Examples

iex> get_cms_page_locale_latest_variant!(123)
%CmsPageVariant{}

iex> get_cms_page_locale_latest_variant!(456)
** (Ecto.NoResultsError)

get_cms_page_locale_latest_variant_for_page_and_locale(page_id, locale)

Gets a single cms_page_locale_latest_variant for a specific locale.

Examples

iex> get_cms_page_locale_latest_variant_for_page_and_locale!(123, "nl-NL")
%CmsPageVariant{}

get_cms_page_locale_latest_variant_for_page_and_locale_by_slug(slug, locale)

Gets a single get_cms_page_locale_latest_variant_for_page_and_locale_by_slug for a specific locale by slug.

Examples

iex> get_cms_page_locale_latest_variant_for_page_and_locale_by_slug!("slug", "nl-NL")
%CmsPageVariant{}

list_cms_page_locale_latest_variants()

Returns the list of cms_page_locale_latest_variants.

Examples

iex> list_cms_page_locale_latest_variants()
[%CmsPageVariant{}, ...]

list_cms_page_locale_latest_variants_for_locale(locale)

Returns the list of cms_page_locale_latest_variants for all pages and a specified locale.

Examples

iex> list_cms_page_locale_latest_variants_for_locale("nl-NL")
[%CmsPageVariant{}, ...]

list_cms_page_locale_latest_variants_for_page_and_locale(page_id, locale)

Returns the list of cms_page_locale_latest_variants for a page and a specified locale.

Examples

iex> list_cms_page_locale_latest_variants_for_page_and_locale(232, "nl-NL")
[%CmsPageVariant{}, ...]

list_paginated_cms_page_locale_latest_variants_for_locale(locale, page, size \\ 30)

Returns the list of cms_page_locale_latest_variants for all pages and a specified locale. Paginated.

Examples

iex> list_paginated_cms_page_locale_latest_variants_for_locale("nl-NL", 1, 20)
[%CmsPageVariant{}, ...]

preload_page_variant(cms_page_locale_latest_variant)

preload_page_variants(variants)

update_cms_page_locale_latest_variant(cms_page_locale_latest_variant, attrs)

Updates a cms_page_locale_latest_variant.

Examples

iex> update_cms_page_locale_latest_variant(cms_page_locale_latest_variant, %{field: new_value})
{:ok, %CmsPageVariant{}}

iex> update_cms_page_locale_latest_variant(cms_page_locale_latest_variant, %{field: bad_value})
{:error, %Ecto.Changeset{}}