NAME

BuildForge::Services::DBO::TagVar


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        # Getting existing tag variables
        $allProjectTagVars = BuildForge::Services::DBO::TagVar->findByPid($conn, $projectId);
        $tagvar1 = BuildForge::Services::DBO::TagVar->findByPidName($conn, $projectId, $tagId);
        $tagvar2 = BuildForge::Services::DBO::TagVar->findByPidTid($conn, $projectId, 'TagVarName');
        # Getter / setter functions
        $projectId = $oldtagvar->getProjectId();
        $tagId = $oldtagvar->getTagId();
        $name = $oldtagvar->getName();
        $currentValue = $oldtagvar->getValue();
        $isAutoIncrement = $oldtagvar->getAutoInc();
        $amountOfPadding = $oldtagvar->getPadding();
        $oldtagvar->setProjectId($projectId);
        $oldtagvar->setName('NewName');
        $oldtagvar->setValue(5);
        $oldtagvar->setAutoInc(1);
        $oldtagvar->setPadding(5);
        $oldtagvar->update();
        
        # TagVar creation, updating, deletion
        $newtagvar = new BuildForge::Services::DBO::TagVar($conn);
        $newtagvar->setProjectId($projectId);
        $newtagvar->setName('Name');
        $newtagvar->create();
        $newtagvar->setValue(5);
        $newtagvar->update();
        
        $newtagvar->delete();
        BuildForge::Services::DBO::TagVar->deleteById($conn, $projectId, $oldtagvar->getTagId());
                
        $conn->logout;
        $conn->close;


DESCRIPTION

TagVar allows you to create, access, and delete BuildForge tag variables.


METHODS

new BuildForge::Services::DBO::TagVar(connection, {TagVarParamsHashRef})

Returns a new instance of a TagVar object.

connection

A connected BuildForge::Services::Connection object.

TagVarParamsHashRef

An optional reference to a hash containing any or all of the following fields.

projectId

The project ID (from $project->getProjectId()) of the project the tag variable is attached to.

name

The name of the tag variable.

value

The value of the tag variable. Must be a positive integer or 0. Defaults to 1.

padding

The field length of the value, with initial zeroes added to make up the difference. If the value is 17, for example, padding between 0 and 2 will result in '17', padding of 3 will result in '017', and so forth. Defaults to 0.

autoInc

Whether or not to auto-increment this tag variable after builds of this project. If this evaluates to true, auto-increment it, and if this evaluates to false (the default), don't auto-increment.

BuildForge::Services::DBO::TagVar->findByPid(connection, projectId)

Returns a reference to an array of BuildForge::Services::DBO::TagVar objects corresponding to all tag variables in the database that are in the given project.

connection

A connected BuildForge::Services::Connection object.

projectId

The project ID (from $project->getProjectId()) of the project to check for tag variables.

BuildForge::Services::DBO::TagVar->findByPidName(connection, projectId, tagVarName)

Returns the BuildForge::Services::DBO::Cron object corresponding to the given project and name, or undef if no such object exists.

connection

A connected BuildForge::Services::Connection object.

projectId

The project ID (from $project->getProjectId()) of the project to check for tag variables.

tagVarName

The tag variable name to look for (from $tagvar->getName()).

BuildForge::Services::DBO::TagVar->findByPidTid(connection, projectId, tagVarId)

Returns the BuildForge::Services::DBO::Cron object corresponding to the given project and ID, or undef if no such object exists.

connection

A connected BuildForge::Services::Connection object.

projectId

The project ID (from $project->getProjectId()) of the project to check for tag variables.

tagVarId

The tag variable ID to look for (from $tagvar->getTagId()).

$tagvar->create()

Creates the tag variable within the database.

$tagvar->update()

Updates the tag variable record within the database.

$tagvar->delete()

Deletes the tag variable record from the database.

BuildForge::Services::DBO::TagVar->deleteById(connection, projectId, tagVarId)

Deletes the tag variable record from the database with the given ID in the given project.

connection

A connected BuildForge::Services::Connection object.

projectId

The project ID (from $project->getProjectId()) of the project.

tagVarId

The tag variable ID to look for (from $tagvar->getTagId()).

$tagvar->getProjectId()

Returns the project ID of the project the tag variable is connected to.

$tagvar->getTagId()

Returns the tag variable ID.

$tagvar->getName()

Returns the tag variable's name.

$tagvar->getValue()

Return the tag variable's current value.

$tagvar->getAutoInc()

Returns 1 if the tag variable auto-increments after each build of the project it is attached to, or 0 otherwise.

$tagvar->getPadding()

Returns the field width of the tag variable. If the current value of the variable has fewer characters than the field width, zeroes are added on to the front to make up the difference.

$tagvar->setProjectId(projectId)

Sets which project this tag variable is attached to. $tagvar->update() must be run before changes are replicated in the database.

projectId

The project ID (from $project->getProjectId()) of the project to attach to.

$tagvar->setName(name)

Sets the name of the tag variable. $tagvar->update() must be run before changes are replicated in the database.

name

The new name for the tag variable.

$tagvar->setValue(value)

Sets the value of the tag variable. $tagvar->update() must be run before changes are replicated in the database.

value

The new value for the tag variable. This value must be a positive integer or 0.

$tagvar->setAutoInc(autoInc)

Sets whether or not to auto-increment this tag variable after builds of this project. $tagvar->update() must be run before changes are replicated in the database.

autoInc

If this evaluates to true, auto-increment it, and if this evaluates to false (the default), don't auto-increment.

$tagvar->setPadding(fieldLength)

Sets the field length of the value, with initial zeroes added to make up the difference. If the value is 17, for example, padding between 0 and 2 will result in '17', padding of 3 will result in '017', and so forth. $tagvar->update() must be run before changes are replicated in the database.

fieldLength

The new field length for the tag variable. This must be a positive integer or 0.


COPYRIGHT

Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.