- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::db::Attribute
::xo::db::Attribute create ... \ORM class representing an acs_attribute from and acs_object.
[ -column_name column_name ] \
[ -constraint_values constraint_values ] \
[ -create_acs_attribute:substdefault (default "true") ] \
[ -create_table_attribute:substdefault (default "true") ] \
[ -datatype:substdefault (default "text") ] \
[ -help_text help_text ] \
[ -index index ] \
[ -max_n_values:substdefault (default "1") ] \
[ -min_n_values:substdefault (default "1") ] \
[ -multivalued multivalued ] \
[ -not_null not_null ] \
[ -pretty_name pretty_name ] \
[ -pretty_plural:substdefault (default "") ] \
[ -references:substdefault (default "") ] \
[ -required:substdefault (default "false") ] \
[ -spec spec ] \
[ -sqltype sqltype ] \
[ -substdefault substdefault ] \
[ -unique unique ] \
[ -validator validator ]
Defined in packages/xotcl-core/tcl/05-db-procs.tcl
Class Relations
Methods (to be applied on instances)
attribute_reference (scripted, public)
<instance of xo::db::Attribute> attribute_reference tn
- Parameters:
- tn (required)
- Returns:
- the name of a DB attribute, potentially with an alias name.
- Testcases:
- No testcase defined.
column_spec (scripted, public)
<instance of xo::db::Attribute> column_spec \ [ -id_column id_column ]
- Switches:
- -id_column (optional, defaults to
"false"
)- Returns:
- the full SQL spec for a DB attribute, potentially containing defaults, primary key, constraints, etc.
- Testcases:
- No testcase defined.
create_attribute (scripted, public)
<instance of xo::db::Attribute> create_attributeCreate an OpenACS attribute, if not already defined (or attribute creation is turned off for this xo::db::Attribute)
- Testcases:
- No testcase defined.
db_attribute_defined (scripted, public)
<instance of xo::db::Attribute> db_attribute_defined \ [ -object_type object_type ] [ -attribute_name attribute_name ]One could try caching this, but be aware that this also requires proper flushing, this value cannot be considered immutable, not even per request. ns_log notice "GN: db_attribute_defined name $attribute_name type $object_type" ::xo::dc 0or1row -prepare text,text check_att { select 1 from acs_attributes where attribute_name = :attribute_name and object_type = :object_type }
- Switches:
- -object_type (optional)
- -attribute_name (optional)
- Testcases:
- No testcase defined.
init (scripted, public)
<instance of xo::db::Attribute> initConstructor of ::xo::db::Attribute. It provides defaults and creates the ACS attribute if necessary.
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables