PerlDoc

26 August 2025 - 17:41 | Version 1 |
See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview


Parent package: Foswiki::Contrib::DBCacheContrib
Child packages:

    package Foswiki::Contrib::DBCacheContrib::Array

    This is an interface that is implemented by all back-end stores (archivists). Objects of this class can be tied to perl arrays.

    Objects of this class are created using the newArray interface defined by Foswiki::Contrib::DBCacheContrib::Archivist. You can use references in the content of an Array, but you can only refer to other objects that were created using the same Archivist. If you point anywhere else, expect fireworks. Note that all references stored in an Array are strong references (see the doc on Foswiki::Contrib::DBCacheContrib::Map for more information on what that means).

    If you have an object ($obj) created this way, you can tie it to a perl array like this:
    my @array;
    tie(@array, ref($obj), $obj);
    

    find($object) → integer

    Uses equals to find the given element in the array and return its index

    getValues() → @values

    Overridable method that returns a list even when the object isn't tied.

    add($object)

    Add an element to the end of the array

    remove($index)

    Remove an entry at an index from the array.

    get($key, $root) → datum

    Subfield syntax

    Where the result of a subfield expansion is another object (a Map or an Array) then further subfield expansions can be used. For example,
    get("parent.UserTable[?SubTopic='ThisTopic'].UserName", $web);
    

    See also Foswiki::Contrib::DBCacheContrib::Map for syntax that applies to maps.

    size() → integer

    Get the size of the array

    sum($field) → number

    Returns the sum of values of the given field in the objects stored in this array.

    search($search) → search result

    Search the array for matches with the given object. values. Return a Foswiki::Contrib::DBCacheContrib::Array of matching entries.

    toString($limit, $level, $strung) → string

    Generates an HTML string representation of the object.