[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/inc/ -> class.solink.inc.php (sommaire)

(pas de description)

Poids: 317 lignes (9 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

solink:: (7 méthodes):
  solink()
  link()
  update_remark()
  get_links()
  get_link()
  unlink()
  chown()


Classe: solink  - X-Ref

generalized linking between entries of eGroupware apps - SO layer

Links have two ends each pointing to an entry, each entry is a double:
- app   app-name or directory-name of an egw application, eg. 'infolog'
- id    this is the id, eg. an integer or a tupple like '0:INBOX:1234'

All vars passed to this class get correct escaped to prevent query insertion.

solink( )   X-Ref
constructor


link( $app1,$id1,$app2,$id2,$remark='',$owner=0,$lastmod=0 )   X-Ref
creats a link between $app1,$id1 and $app2,$id2

param: string $app1 appname of 1. endpoint of the link
param: string $id1 id in $app1
param: string $app2 appname of 2. endpoint of the link
param: string $id2 id in $app2
param: string $remark='' Remark to be saved with the link (defaults to '')
param: int $owner=0 Owner of the link (defaults to user)
return: boolean/int False (for db or param-error) or link_id for success

update_remark($link_id,$remark)   X-Ref
update the remark of a link

param: int $link_id link to update
param: string $remark new text for the remark
return: boolean true on success, else false

get_links( $app,$id,$only_app='',$order='link_lastmod DESC' )   X-Ref
returns array of links to $app,$id

param: string $app appname
param: string $id id in $app
param: string $only_app if set return only links from $only_app (eg. only addressbook-entries) or NOT from if $only_app[0]=='!'
param: string $order defaults to newest links first
return: array of links (only_app: ids) or empty array if no matching links found

get_link($app_link_id,$id='',$app2='',$id2='')   X-Ref
returns data of a link

param: ing/string $app_link_id > 0 link_id of link or app-name of link
param: string $id='' id in $app, if no integer link_id given in $app_link_id
param: string $app2='' appname of 2. endpoint of the link, if no integer link_id given in $app_link_id
param: string $id2='' id in $app2, if no integer link_id given in $app_link_id
return: array with link-data or False

unlink($link_id,$app='',$id='',$owner=0,$app2='',$id2='')   X-Ref
Remove link with $link_id or all links matching given params

param: $link_id link-id to remove if > 0
param: string $app='' app-name of links to remove
param: string $id='' id in $app or '' remove all links from $app
param: int $owner=0 account_id to delete all links of a given owner, or 0
param: string $app2='' appname of 2. endpoint of the link
param: string $id2='' id in $app2
return: array with deleted links

chown($owner,$new_owner)   X-Ref
Changes ownership of all links from $owner to $new_owner

This is needed when a user/account gets deleted
Does NOT change the modification-time

param: int $owner acount_id of owner to change
param: int $new_owner account_id of new owner
return: int number of links changed



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7