Noizu.Entity.Store.Ecto.EntityProtocol.Behaviour behaviour (NoizuLabs Entities v0.2.1)

Support for Ecto backed Entities.

Summary

Callbacks

as_entity(entity, record, settings, context, options)

@callback as_entity(
  entity :: any(),
  record :: any(),
  settings :: Tuple,
  context :: any(),
  options :: any()
) :: {:ok, any()} | {:error, details :: any()}

as_record(entity, settings, context, options)

@callback as_record(
  entity :: any(),
  settings :: Tuple,
  context :: any(),
  options :: any()
) ::
  {:ok, any()} | {:error, details :: any()}

delete_record(entity, settings, context, options)

@callback delete_record(
  entity :: any(),
  settings :: Tuple,
  context :: any(),
  options :: any()
) ::
  {:ok, any()} | {:error, details :: any()}

fetch_as_entity(entity, settings, context, options)

@callback fetch_as_entity(
  entity :: any(),
  settings :: Tuple,
  context :: any(),
  options :: any()
) ::
  {:ok, any()} | {:error, details :: any()}

from_record(entity, settings, context, options)

@callback from_record(
  entity :: any(),
  settings :: Tuple,
  context :: any(),
  options :: any()
) ::
  {:ok, any()} | {:error, details :: any()}

merge_from_record(entity, record, settings, context, options)

@callback merge_from_record(
  entity :: any(),
  record :: any(),
  settings :: Tuple,
  context :: any(),
  options :: any()
) :: {:ok, any()} | {:error, details :: any()}

persist(record, type, settings, context, options)

@callback persist(
  record :: any(),
  type :: :create | :update,
  settings :: Tuple,
  context :: any(),
  options :: any()
) :: {:ok, any()} | {:error, details :: any()}

Functions

as_entity(_, record, settings, context, options)

as_record(entity, settings, context, options)

delete_record(entity, arg, context, options)

fetch_as_entity(entity, settings, context, options)

from_record(record, settings, context, options)

merge_from_record(entity, record, settings, context, options)

persist(record, arg2, arg3, arg4, arg5)