Copyright © 2009 Marc Worrell Date: 2009-04-09
Behaviours: gen_model.
Authors: Marc Worrell (marc@worrell.nl).
all/1 | Return the list of all predicates. |
flush/1 | Flush all cached data about predicates. |
for_subject/2 | Return the list of predicates that are valid for the given resource id. |
get/2 | Return the definition of the predicate. |
id_to_name/2 | Lookup the name of a predicate with an id. |
insert/2 | Insert a new predicate, sets some defaults. |
is_predicate/2 | Test if the property is the name of a predicate. |
m_find_value/3 | Fetch the value for the key from a model source. |
m_to_list/2 | Transform a model value to a list, used for template loops. |
m_value/2 | Transform a model value so that it can be formatted or piped through filters. |
name_to_id/2 | Return the id of the predicate. |
name_to_id_check/2 | |
object_category/2 | Return all the valid categories for objects. |
objects/2 | Return the category ids that are valid as objects. |
subject_category/2 | Return all the valid categories for subjects. |
subjects/2 | Return the category ids that are valid as subjects. |
update_noflush/4 | Update a predicate, save the reversed flag, reset the list of valid subjects and objects. |
all(Context) -> PropList
Return the list of all predicates
flush(Context) -> any()
Flush all cached data about predicates.
for_subject(Id, Context) -> any()
Return the list of predicates that are valid for the given resource id. Append all predicates that have no restrictions.
get(PredId, Context) -> PredicatePropList | undefined
Return the definition of the predicate
id_to_name(Id, Context) -> {ok, atom()} | {error, Reason}
Lookup the name of a predicate with an id
insert(Title, Context) -> {ok, Id} | {error, Reason}
Insert a new predicate, sets some defaults.
is_predicate(Id::Pred, Context) -> bool()
Test if the property is the name of a predicate
m_find_value(Key, M::Source, Context) -> term()
Fetch the value for the key from a model source
m_to_list(M::Source, Context) -> List
Transform a model value to a list, used for template loops
m_value(M::Source, Context) -> term()
Transform a model value so that it can be formatted or piped through filters
name_to_id(Name::Pred, Context) -> {ok, int()} | {error, Reason}
Return the id of the predicate
name_to_id_check(Name, Context) -> any()
object_category(Id, Context) -> List
Return all the valid categories for objects. Return the empty list when there is no constraint. Note that the resulting array is a bit strangely formatted [{id}, {id2}, ...], this is compatible with the category name lookup and prevents mixups with strings (lists of integers).
objects(Id, Context) -> any()
Return the category ids that are valid as objects
subject_category(Id, Context) -> List
Return all the valid categories for subjects. Return the empty list when there is no constraint. Note that the resulting array is a bit strangely formatted [{id}, {id2}, ...], this is compatible with the category name lookup and prevents mixups with strings (lists of integers).
subjects(Id, Context) -> any()
Return the category ids that are valid as subjects
update_noflush(Id, Subjects, Objects, Context) -> void()
Update a predicate, save the reversed flag, reset the list of valid subjects and objects.
Generated by EDoc, Feb 25 2011, 21:14:42.