Packageindex Classtrees Modulegroups Elementlist Report XML Files

pxdb.metadata

pxdb_typesfield

pxdb_basis
   |
  +-- pxdb_typesfield

public class pxdb_typesfield extends pxdb_basis

AuthorsHans Lellelid <hans@velum.net>
Version$Revision: 1.13 $

 

Methods inherited from pxdb_basis

pxdb_basis, import, &fetch_datatype, &fetch_relationship, &fetch_dbfield, &fetch_typesfield, &fetch_view, &fetch_viewfield, arr_dbfields, arr_datatypes, arr_parent_datatypes, arr_child_datatypes, arr_relationships, arr_typesfields, arr_views, arr_viewfields, get_groups, get_users

Public Method Summary

void pxdb_typesfield([ integer $id ])
Constructor: call super constructor and read in vars from db.
void read()
Updates class vars from the database.
void load()
Load subclass: loads values from global scope into the class.Warning: documentation is missing.
void get_id()
Gets ID of this typesfield
void set_id(integer $id)
Sets ID of this typesfield
integer get_typeid()
Gets the content type (datatype) ID this typesfield is for
void set_typeid(integer $typeid)
Sets the content type (datatype) ID this typesfield is for
integer get_relid()
Get the ID of the relationship this typesfield manages
void set_relid(integer $relid)
Set the ID of the relationship this typesfield manages
string get_otype()
Gets the content types (datatypes) this relationship handles.
void set_otype(string $otype)
Sets the content types (datatypes) this relationship handles.
integer get_fieldid()
Gets the ID of the dbfield this typesfield uses
void set_fieldid(integer $fieldid)
Sets the ID of the dbfield this typesfield uses
string get_displayname()
Get the default name to use in forms and the general module's detail page.
void set_displayname(string $displayname)
Set the default name to use in forms and the general module's detail page.
string get_description()
Get an optional default description of the field to use in forms.
void set_description(string $description)
Set an optional default description of the field to use in forms.
string get_identifier()
Get the unique text string that identifies this property of the content type (datatype).
void set_identifier(string $identifier)
Set the unique text string that identifies this property of the content type (datatype).
string get_autogen()
Gets the autogenerator, if any, this property uses, as well as any params the autogenerator may have.
void set_autogen(string $autogen)
Sets the autogenerator, if any, this property uses, as well as any params the autogenerator may have.
string get_validator()
Gets the validator, if any, this property uses, as well as any params the validator may have.
void set_validator(string $validator)
Sets the validator, if any, this property uses, as well as any params the validator may have.
string get_processor()
Gets the processor, if any, this property uses, as well as any params the processor may have.
void set_processor(string $processor)
Sets the processor, if any, this property uses, as well as any params the processor may have.
string get_widget()
Gets the widget, if any, this property uses, as well as any params the widget may have.
void set_widget(string $widget)
Sets the widget, if any, this property uses, as well as any params the widget may have.
string get_mul()
Returns whether or not (via string 'Y' or 'N') this property can have multiple values.
void set_mul(string $mul)
Sets whether or not (via string 'Y' or 'N') this property can have multiple values.
string get_req()
Returns whether or not (via string 'Y' or 'N') this property is required.
void set_req(string $req)
Sets whether or not (via string 'Y' or 'N') this property is required.
string get_unique()
Returns whether or not (via string 'Y' or 'N') this property must be unique.
void set_unique(string $unique)
Sets whether or not (via string 'Y' or 'N') this property must be unique.
string get_is_unique()
This alias is needed because DBasis depends on function names being passed as args.
void set_is_unique(string $unique)
This alias is needed because DBasis depends on function names being passed as args.
boolean is_multiple()
Returns whether or not this property can have multiple values.
boolean is_required()
Returns whether or not this property is required.
boolean is_unique()
Returns whether or not this property must be unique.
string get_field_type()
Get the general type of field ('relationship' or 'simple')
string get_field_metatype()
Gets the specific metatype of this field
array arr_available_dbfields([ string $mask, string $constraint_sql ])
Finds available (not used by this object) dbfields.
array get_related_datatypes(integer $relid)
Gets the datatypes related to a relid.
array arr_available_relationships([ string $mask, string $constraint_sql ])
Finds available (not used by this object) relationships.
integer save()
Saves a typesfield to the database.
boolean delete( $id)
Remove a field from an pxdb object.
array get_all_privs()
Gets privileges for users and groups.
Array get_user_privs()
Gets privileges for specified user.
Array get_group_privs()
Gets privileges for specified group.
boolean revoke_priv( $ugid, $priv)
Function to revoke privileges to typesfields.
void move(string $dir)
Promote or demote a field.Warning: documentation is missing.
void reorder()
Re-orders the typesfields.Warning: documentation is missing.
boolean is_readable(object pxdb_user $user)
Checks privileges for the given user to see if the field is readable

Private Method Summary

string replace_tags( $txt)
Replace tags with values from the class / db.
int _next_orderby()
Calculates the next weight value for this object.
void _fetch_ugid_fieldprivs(integer $datatype)
Returns all the ugids (group or users) who have privs to this field
Array get_global_privs()
Gets privileges for ugid 0.
boolean grant_priv(string $ugid, $priv)
Function to grant privileges to typesfields.

Fields inherited from pxdb_basis

$debug, $errors, $_imported, $_fields, $_old_fields, $method

Public Field Summary

string $default_priv
Default privilege (for ugid 0) to assign to new fields.

Private Field Summary

object pxdb_datatype $dt
Datatype object for this typesfield.

Public Method Details

pxdb_typesfield

public void pxdb_typesfield([ integer $id ])

 

Parameter
integer $id = >>null<<
The id of typesfield row.
Returns void


read

public void read()

 

Returns void


load

public void load()

 

Warning: documentation is missing.

Returns void


get_id

public void get_id()

 

Returns void


set_id

public void set_id(integer $id)

 

Parameter
integer $id
Returns void


get_typeid

public integer get_typeid()

 

Returns integer


set_typeid

public void set_typeid(integer $typeid)

 

Parameter
integer $typeid
Returns void


get_relid

public integer get_relid()

 

Returns integer


set_relid

public void set_relid(integer $relid)

 

Parameter
integer $relid
Returns void


get_otype

public string get_otype()

  Returns a comma-separated string of related content types (datatypes), so even if you expect only one value to be returned, assume it's a string and check for multiple values.

Returns string

Related datatype or comma-separated list of related datatypes.


set_otype

public void set_otype(string $otype)

  The argument is a comma-separated string of related content types (datatypes), so don't pass an array if you have multiple content types.

Parameter
string $otype
Related datatype or comma-separated list of related datatypes.
Returns void


get_fieldid

public integer get_fieldid()

  (for non-relationship typesfields, even multiple picks that use the pickrel table)

Returns integer


set_fieldid

public void set_fieldid(integer $fieldid)

  (for non-relationship typesfields, even multiple picks that use the pickrel table)

Parameter
integer $fieldid
Returns void


get_displayname

public string get_displayname()

 

Returns string


set_displayname

public void set_displayname(string $displayname)

 

Parameter
string $displayname
Returns void


get_description

public string get_description()

 

Returns string


set_description

public void set_description(string $description)

 

Parameter
string $description
Returns void


get_identifier

public string get_identifier()

  Used to generate accessor function names in autogenerated classes, among other things.

Returns string


set_identifier

public void set_identifier(string $identifier)

  Used to generate accessor function names in autogenerated classes, among other things.

Parameter
string $identifier
Returns void


get_autogen

public string get_autogen()

 

Returns string


set_autogen

public void set_autogen(string $autogen)

 

Parameter
string $autogen
Returns void


get_validator

public string get_validator()

 

Returns string


set_validator

public void set_validator(string $validator)

 

Parameter
string $validator
Returns void


get_processor

public string get_processor()

 

Returns string


set_processor

public void set_processor(string $processor)

 

Parameter
string $processor
Returns void


get_widget

public string get_widget()

 

Returns string


set_widget

public void set_widget(string $widget)

 

Parameter
string $widget
Returns void


get_mul

public string get_mul()

 

Returns string

'Y' or 'N'


set_mul

public void set_mul(string $mul)

 

Parameter
string $mul
'Y' or 'N'
Returns void


get_req

public string get_req()

 

Returns string

'Y' or 'N'


set_req

public void set_req(string $req)

 

Parameter
string $req
'Y' or 'N'
Returns void


get_unique

public string get_unique()

 

Returns string

'Y' or 'N'


set_unique

public void set_unique(string $unique)

 

Parameter
string $unique
'Y' or 'N'
Returns void


get_is_unique

public string get_is_unique()

  Sheesh.

Returns string

'Y' or 'N'


set_is_unique

public void set_is_unique(string $unique)

  Sheesh.

Parameter
string $unique
'Y' or 'N'
Returns void


is_multiple

public boolean is_multiple()

 

Returns boolean


is_required

public boolean is_required()

 

Returns boolean


is_unique

public boolean is_unique()

 

Returns boolean


get_field_type

public string get_field_type()

 

Returns string

The field type (either 'relationship' or 'simple')


get_field_metatype

public string get_field_metatype()

  Determined by the dbfield it uses unless it's a relationship.

Returns string

the Field metatype (e.g. 'ltxt', 'url', 'primaryrel')


arr_available_dbfields

public array arr_available_dbfields([ string $mask, string $constraint_sql ])

 

Parameter
string $mask = >>''<<
The mask to use for fname column.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns array

id ,fname of dbfields records found.


get_related_datatypes

public array get_related_datatypes(integer $relid)

  By convention the dt2 column contains the "related" datatypes. This can include the current datatype if it is so-specified in the relationships table. This has changed now to be for a relid and datatype, if the dt is in dt1, return the dt2 column , if that is empty look in dt2 and return dt1 column

Parameter
integer $relid
Returns array

An array of datatypes that are related to current datatype by specified relid.


arr_available_relationships

public array arr_available_relationships([ string $mask, string $constraint_sql ])

  Also will make sure that relationships define current datatype as dt1 -- since convention is that dt1 is the source object and dt2 is the related object. If you want the relationship to be bi-directional (i.e. you can choose the relationship from either object) then make sure that you define it as such.

Parameter
string $mask = >>''<<
The mask to use for description column.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns array

hash of relationships records found.


save

public integer save()

 

Returns integer

ID of newly created or saved record.


delete

public boolean delete( $id)

 

Parameter
$id
Warning: documentation is missing.
Returns boolean

true /false on success.


get_all_privs

public array get_all_privs()

 

Returns array

Array of privs hash.


get_user_privs

public Array get_user_privs()

 

Returns Array

(2-D) name=>user name, ugid => user id, priv => user privs.


get_group_privs

public Array get_group_privs()

 

Returns Array

(2-D) name=>group name, ugid => group id, priv => group privs.'


revoke_priv

public boolean revoke_priv( $ugid, $priv)

  By default it uses values in $_imported array, but can also be passed parameters -- for revoking privilegs internally.

Parameter
$ugid
Warning: documentation is missing.
$priv
Warning: documentation is missing.
Returns boolean

True or False (with warnings)


move

public void move(string $dir)

  Changes the orderby column for typesfields rows.

Warning: documentation is missing.

Parameter
string $dir
Direction ('up', 'down') to move.
Returns void


reorder

public void reorder()

 

Warning: documentation is missing.

Returns void


is_readable

public boolean is_readable(object pxdb_user $user)

 

Parameter
object pxdb_user $user
Returns boolean


Private Method Details

replace_tags

private string replace_tags( $txt)

  This is primarily for vartable (e.g. table '$(object)types' , but could be used almost anywhere.

Parameter
$txt
Warning: documentation is missing.
Returns string

String with any dynamic tags replaced.


_next_orderby

private int _next_orderby()

 

Returns int

The new orderby value.


_fetch_ugid_fieldprivs

private void _fetch_ugid_fieldprivs(integer $datatype)

 

Parameter
integer $datatype
to test for privs: group | users
Returns void


get_global_privs

private Array get_global_privs()

 

Returns Array

(1-D) name=>'Everyone', ugid => '0', priv => global privs.


grant_priv

private boolean grant_priv(string $ugid, $priv)

  By default it uses values in $_imported array, but can also be passed parameters -- for assigning privilegs internally.

Parameter
string $ugid
array containing privilegs e.g. 'read,write' or array('read', 'write').
$priv
Warning: documentation is missing.
Returns boolean

True or False (with $errors[] added)


Public Field Details

$default_priv

public string $default_priv

>>'read,write'<<


Private Field Details

$dt

private object pxdb_datatype $dt

>><<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:07:22 -0400 by PHPDoc v1.5 www.phpdoc.de