View Source Bonfire.Classify.Tree (Bonfire v0.9.11-social-beta.6)

A mixin used to record parent/child relationships between categories (eg. a topic that belongs to a group) and between objects and categories (eg. a post was published in a topic)

Summary

Types

t()

@type t() :: %Bonfire.Classify.Tree{
  __meta__: Ecto.Schema.Metadata.t(),
  custodian: term(),
  custodian_id: term(),
  direct_children_count: term(),
  id: Needle.UID.t() | nil,
  nested_children_count: term(),
  parent: term(),
  parent_id: term(),
  path: term(),
  pointer: Ecto.Schema.belongs_to(Needle.Pointer.t()) | nil
}

Functions

ancestor_ids(schema)

ancestors(schema)

arrange(structs_list, opts \\ [])

build_child(schema)

changeset(tree \\ %Tree{}, attrs)

children(schema)

delete(struct, key)

depth(schema)

descendants(schema)

get(struct, key, default \\ nil)

make_child_of(changeset, parent)

parent(schema)

parent_id(schema)

path(schema)

path_ids(schema)

put(struct, key, val)

put_tree(changeset, custodian, parent)

root(schema)

root?(schema)

root_id(schema)

siblings(schema)

subtree(schema)

where_depth(query \\ __MODULE__, depth_params)