Procedural File: get_functions.php

Source Location: /php/get_functions.php



Classes:

Page Details:

get_functions.php

holds get functions

PHP versions 4 and 5

LICENSE: ARK - The Archaeological Recording Kit. An open-source framework for displaying and working with archaeological data Copyright (C) 2008 L - P : Partnership Ltd. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Tags:





getAction

array getAction( string $actorkey, string $actorvalue, [string $subjkey = FALSE], [string $subjvalue = FALSE])

[line 211]

gets the action(s) undertaken by an actor

Tags:

  • return - contains the results direct from cor_tbl_action for all the actions that this actor made on the specified item. If no actions are present it returns FALSE.
  • author - Guy Hunt
  • since - 0.6
  • access - public

Parameters

  • string $actorkey - the itemkey of the actor (abk_cd is the only current actor module)
  • string $actorvalue - the itemvalue of the actor
  • string $subjkey - the itemkey of the items being acted on if this is set false (all actions on all items are returned)
  • string $subjvalue - the itemkey of the item being acted on if this is set false all actions by this actor made on all items of this type are returned

[ Top ]

getActionDate

string getActionDate( string $itemkey, string $itemvalue, mixed $datetype, string $datestyle)

[line 855]

returns an element of a date of an action

Tags:

  • return - the date
  • author - Guy Hunt
  • since -

    0.1

    NOTE: in order to provide acces to a single record supply the id number into the itemvalue field and set the datetype to 'SINGLE'

  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • mixed $datetype - the datetype (id or nickname)
  • string $datestyle - the style of date to return

[ Top ]

getActor

array getActor( string $itemkey, string $itemvalue, [integer/string $actiontype = FALSE], [string $actorkey = FALSE])

[line 119]

returns an actor or actors involved in an action linked to an item

Tags:

  • return - array of actor ids
  • author - Guy Hunt
  • since -

    0.5.1

    NOTE: actiontype can be the number or the nickname. FALSE will give you all of the actors associated with the record

  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • integer/string $actiontype - OPTIONAL the actionype of the action
  • string $actorkey - OPTIONAL the key of the actor (i.e. abk_cd)

[ Top ]

getActorElem

mixed getActorElem( string $actor_id, string $elem, [string $actor_itemkey = FALSE], [string $elemclass = FALSE])

[line 276]

returns an element of an actor

Tags:

  • return - the element
  • author - Guy Hunt
  • since - 0.5.1
  • access - public

Parameters

  • string $actor_id - the id of the actor (itemvalue in the case of a module)
  • string $elem - the element to return
  • string $actor_itemkey - OPTIONAL the module in the user data is located (default is abk)
  • string $elemclass - OPTIONAL the type of data class of the element (default is 'txt')

[ Top ]

getAlias

string getAlias( string $tbl, string $lang, string $col, string $src_key, int $type)

[line 1321]

retrieves the alias of something in the database. uses a caching system whereby it caches to an array in the session

Tags:

  • return - the alias
  • author - Guy Hunt
  • since -

    0.4

    Alias types are:

    1. - Normal
    2. - Against (used in attributes where the desired alias is opposite type 1)
    3. - Span Beg (used for the beginning element of a span)
    4. - Span End (used for the end element of a span)
    5. - Boolean True (used in the case where you want a word to represent db true)
    6. - Boolean False (used in the case where you want a word to represent db false)

Parameters

  • string $tbl - the table in which the thing is held (NOT the alias)
  • string $lang - the target language
  • string $col - the column in $tbl in which the $src_key resides
  • string $src_key - the value to search in $col for
  • int $type - the type of alias (see below)

[ Top ]

getAllAliases

array getAllAliases( string $tbl, string $col, string $src_key, int $type)

[line 1407]

retrieves all of the aliases of something in the database, regardless of language

Tags:

  • return - an array of aliases [0] => ['alias'] = the alias ['language'] = the language of the alias
  • author - Stuart Eve
  • since -

    0.6

    Alias types are:

    1. - Normal
    2. - Against (used in attributes where the desired alias is opposite type 1)
    3. - Span Beg (used for the beginning element of a span)
    4. - Span End (used for the end element of a span)

Parameters

  • string $tbl - the table in which the thing is held (NOT the alias)
  • string $col - the column in $tbl in which the $src_key resides
  • string $src_key - the value to search in $col for
  • int $type - the type of alias (see below)

[ Top ]

getAllFiles

array getAllFiles( [string $mod = FALSE])

[line 464]

returns an array of all the files that are attached to items. Can be limited by mod

Tags:

  • return - the files
  • author - Stuart Eve
  • since - 0.6
  • access - public

Parameters

  • string $mod - the mod (OPTIONAL)

[ Top ]

getAllItems

array getAllItems( string $mod)

[line 1760]

retrieves an array containing every item in ARK belonging to a specific mod

Tags:

  • return - containing the results of the query
  • author - Stuart Eve
  • since - 0.6

Parameters

  • string $mod - the name of the mod

[ Top ]

getAttr

string getAttr( string $itemkey, string $itemvalue, mixed $attribute, string $element, [string $lang = FALSE])

[line 769]

returns an element of a specified attr

nb: use getCh to get a list of attrs if you want to go by attribute type

Tags:

  • return - the attribute element
  • author - Guy Hunt
  • since -

    0.1

    NOTE: this function is normally used to return an array containing elements of attributes of a particular type which are attached to an item by its key value pair. The function can handle numeric and textual references to the attribute type

  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • mixed $attribute - the attribute as defined in the lookup table
  • string $element - the element of the attribute to get
  • string $lang - OPTIONAL if an alias is being returned this needs to be filled

[ Top ]

getCh

array getCh( string $dclass, string $itemkey, string $itemvalue, [mixed $type = FALSE])

[line 512]

returns an array of frag id's of fragments chained to a record or fragment

Tags:

  • return - the chain
  • author - Guy Hunt
  • since -

    0.6

    NOTES: 1: Attribute must be handled in a different way as the types require join syntax 2: If type is not set, the function returns all downward links indiscriminately this is largely of use in deletion and will be used in the forthcoming getChFullDown()

  • access - public

Parameters

  • string $dclass - the data class we are interested in eg (txt or attribute)
  • string $itemkey - the itemkey of the lead record/frag (xxx_cd for records/tbl_name for frags)
  • string $itemvalue - the itemvalue
  • mixed $type - the type of the fragment

[ Top ]

getChData

array getChData( string $dclass, string $itemkey, string $itemvalue, mixed $type)

[line 605]

returns an array of fragments chained to a record or fragment

Tags:

  • return - the chain
  • author - Guy Hunt
  • since -

    0.6

    NOTE 1: Attribute must be handled in a different way as the types require join syntax

  • access - public

Parameters

  • string $dclass - the data class we are interested in eg (txt or attribute)
  • string $itemkey - the itemkey of the lead record/frag (xxx_cd for records/tbl_name for frags)
  • string $itemvalue - the itemvalue
  • mixed $type - the classtype of the fragment

[ Top ]

getChFullUp

void getChFullUp( string $key, string $value)

[line 682]

reveals the structure of a chain of fragments. It uses the getChLinkUp function as a means to crawl up the chain until it hits an item. it returns an array containing the structure of the chain from this fragment up to the head.

Tags:

  • since - 0.6
  • access - public

Parameters

  • string $key - the key to set in the itemkey column
  • string $value - the value to set in the itemvalue column

[ Top ]

getChLinkUp

void getChLinkUp( string $key, string $value)

[line 725]

retrieves a single fragment or item one link further up a data chain.

returns an array containing the key value pair of the link

Tags:

  • since - 0.6
  • access - public

Parameters

  • string $key - the key to set in the itemkey column
  • string $value - the value to set in the itemvalue column

[ Top ]

getClassType

mixed getClassType( string $dataclass, string $rawvar, string $mode)

[line 1075]

returns the class type (either the id number or the nickname)

Tags:

  • return - the class type
  • author - Guy Hunt
  • since - 0.5.1
  • access - public

Parameters

  • string $dataclass - the class type you are looking for (i.e 'txt')
  • string $rawvar - the raw id you are looking for
  • string $mode - the mode of the return value either 'id' or 'nname'

[ Top ]

getColumns

array getColumns( object $db, string $db_name, string $table_name)

[line 1728]

retrieves an array of column names from a specified database and table

Tags:

  • return - containing the table names in the specified db
  • author - Guy Hunt
  • since - 0.4

Parameters

  • object $db - a valid db connection
  • string $db_name - the database name to use
  • string $table_name - the name of the table to get the columns from

[ Top ]

getCxtType

integer getCxtType( string $cxt_cd)

[line 1270]

returns a single cxttype

Tags:

  • return - the context type
  • author - Guy Hunt
  • deprecated -

    0.6

    NOTE: Use getModType() instead

  • since - 0.5.1
  • access - public

Parameters

  • string $cxt_cd - the cxt_cd you are looking for

[ Top ]

getFile

array getFile( string $itemkey, string $itemvalue)

[line 390]

returns an array of files

Tags:

  • return - the files
  • author - Stuart Eve
  • since - 0.6
  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue

[ Top ]

getFileName

array getFileName( $filenr, string $itemkey, string $itemvalue)

[line 429]

returns an array of files

Tags:

  • return - the files
  • author - Stuart Eve
  • since - 0.6
  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • $filenr -

[ Top ]

getMarkup

string getMarkup( string $tbl, string $lang, string $nname, [boolean $bool = FALSE])

[line 1585]

gets a single item of markup

Tags:

  • return - a string of marked up html
  • author - Guy Hunt
  • since - 0.2

Parameters

  • string $tbl - table in which markup is held
  • string $lang - is the desired language
  • string $nname - the markup 'nickname'
  • boolean $bool - OPTIONAL - if this is set then the function will return either true or false instead of the markup itself

[ Top ]

getModType

integer getModType( string $mod_cd, string $mod, string $item)

[line 1017]

returns the modtype of an item

Tags:

  • return - the modtype of the item
  • author - Guy Hunt
  • since -

    0.5.1

    DEV NOTE: The first parameter seems to be redundant

  • access - public

Parameters

  • string $mod_cd - the full itemkey code (i.e. 'cxt_cd')
  • string $mod - the module you are looking at
  • string $item - the itemvalue you are checking

[ Top ]

getMulti

array getMulti( string $tbl, string $where, [string $col = FALSE])

[line 1537]

gets multiple rows from the db

Tags:

  • return - containing the results or FALSE if there are none
  • author - Guy Hunt
  • since -

    0.2

    NB: the db call is faster if you specify a specific column. However this advantage is lost if you need to go back to the db more than once. Therefore getting all cols is faster than running this function twice

Parameters

  • string $tbl - the table to get data from
  • string $where - a mysql compliant where clause starting after the word WHERE
  • string $col - a column to return only results from a single col (faster)

[ Top ]

getNumber

float getNumber( string $itemkey, string $itemvalue, mixed $numbertype)

[line 339]

returns a number

Tags:

  • return - the number fragment
  • author - Guy Hunt
  • since - 0.1
  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • mixed $numbertype - the numbertype of the number fragment

[ Top ]

getRow

void getRow( string $tbl, [int $id = FALSE], [string $where = FALSE])

[line 1451]

returns a row from the given table in the format of a mysql_fetch_array()

Tags:

  • author - Guy Hunt
  • since -

    0.3

    if you use the optional id param any where clause is ignored and vice versa

Parameters

  • string $tbl - the name of the table to look at
  • int $id - the optional id number of the row
  • string $where - a mysql compliant where clause

[ Top ]

getSingle

void getSingle( string $col, string $tbl, string $where)

[line 1497]

gets a single value in a fairly abstracted way

Tags:

  • author - Guy Hunt
  • since - 0.2

Parameters

  • string $col - the column in $tbl in which the $src_key resides
  • string $tbl - the table in which the thing is held (NOT the alias)
  • string $where - a where statement

[ Top ]

getSingleText

string getSingleText( string $itemkey, string $itemvalue, integer/string $txttype, [string $lang = FALSE])

[line 56]

returns a single snippet of text

Tags:

  • return - the text fragment
  • author - Guy Hunt
  • since - 0.6
  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • integer/string $txttype - the txttype of the txt fragement - this can be the number or the nickname
  • string $lang - OPTIONAL the language of the the text fragment to be returned

[ Top ]

getSpan

array getSpan( string $itemkey, string $itemvalue, mixed $spantype)

[line 1140]

returns the elements of a span

Tags:

  • return - the span(s) in the format array[0]=>['id'], - the id of the span array[0]=>['beg'], - the begining value of the span array[0]=>['end'] - the end value of the span
  • author - Stuart Eve
  • since - 0.6
  • access - public

Parameters

  • string $itemkey - the itemkey
  • string $itemvalue - the itemvalue
  • mixed $spantype - the spantype of the span

[ Top ]

getSpanAttr

mixed getSpanAttr( integer $span_id, string $element, [integer $aliastype = NULL])

[line 1207]

returns an array of attributes of a span

Tags:

  • return - the requested element
  • author - Guy Hunt
  • since - 0.5.1
  • access - public

Parameters

  • integer $span_id - Kthe numeric id of the span
  • string $element - the element to return
  • integer $aliastype - OPTIONAL the type of the alias ( 1(for)/2(against) )

[ Top ]

getTables

array getTables( object $db, string $db_name)

[line 1690]

retrieves an array of table names from a specified database

Tags:

  • return - containing the table names in the specified db
  • author - Guy Hunt
  • since - 0.4

Parameters

  • object $db - a valid db connection
  • string $db_name - the database name to use

[ Top ]

getUserAttr

void getUserAttr( user_id $user_id, element $element)

[line 1649]

gets information about a user

Tags:

  • author - Guy Hunt
  • since - Note: The name of the function is confusing. This is nothing to do with attributes

Parameters

  • user_id $user_id - string the user id
  • element $element - string the desired element ('full' will return firstname.'_'.lastname)

[ Top ]

getXmi

array getXmi( string $itemkey, string $itemvalue, [string $mod = FALSE])

[line 937]

returns an array of all the xmi links for a specified itemkey

Tags:

  • return - array containg: ['xmi_itemkey'] - the itemkey of the xmi value ['xmi_itemvalue'] - the xmi value
  • author - Stuart Eve
  • since - 0.5.1
  • access - public

Parameters

  • string $itemkey - the itemkey of the parent module (i.e. if you are linking contexts to plans then this would be pln_cd)
  • string $itemvalue - the itemvalue
  • string $mod - OPTIONAL - if sent the function will only return results for the specified module

[ Top ]


Documentation generated on Thu, 26 Feb 2009 16:48:21 +0000 by phpDocumentor 1.4.1