create()
update()
delete()
getProjectId()
getTagId()
getName()
getValue()
getAutoInc()
getPadding()
setProjectId(projectId)
setName(name)
setValue(value)
setAutoInc(autoInc)
setPadding(fieldLength)
BuildForge::Services::DBO::TagVar
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;
TagVar allows you to create, access, and delete BuildForge tag variables.
Returns a new instance of a TagVar object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The project ID (from $project->getProjectId())
of the project the tag variable is
attached to.
The name of the tag variable.
The value of the tag variable. Must be a positive integer or 0. Defaults to 1.
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.
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.
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.
A connected BuildForge::Services::Connection object.
The project ID (from $project->getProjectId())
of the project to check for tag
variables.
Returns the BuildForge::Services::DBO::Cron object corresponding to the given project and name, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The project ID (from $project->getProjectId())
of the project to check for tag
variables.
The tag variable name to look for (from $tagvar->getName()).
Returns the BuildForge::Services::DBO::Cron object corresponding to the given project and ID, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The project ID (from $project->getProjectId())
of the project to check for tag
variables.
The tag variable ID to look for (from $tagvar->getTagId()).
create()
Creates the tag variable within the database.
update()
Updates the tag variable record within the database.
delete()
Deletes the tag variable record from the database.
Deletes the tag variable record from the database with the given ID in the given project.
A connected BuildForge::Services::Connection object.
The project ID (from $project->getProjectId())
of the project.
The tag variable ID to look for (from $tagvar->getTagId()).
getProjectId()
Returns the project ID of the project the tag variable is connected to.
getTagId()
Returns the tag variable ID.
getName()
Returns the tag variable's name.
getValue()
Return the tag variable's current value.
getAutoInc()
Returns 1 if the tag variable auto-increments after each build of the project it is attached to, or 0 otherwise.
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.
setProjectId(projectId)
Sets which project this tag variable is attached to.
$tagvar->update()
must be run before changes are replicated in the database.
The project ID (from $project->getProjectId())
of the project to attach to.
setName(name)
Sets the name of the tag variable.
$tagvar->update()
must be run before changes are replicated in the database.
The new name for the tag variable.
setValue(value)
Sets the value of the tag variable.
$tagvar->update()
must be run before changes are replicated in the database.
The new value for the tag variable. This value must be a positive integer or 0.
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.
If this evaluates to true, auto-increment it, and if this evaluates to false (the default), don't auto-increment.
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.
The new field length for the tag variable. This must be a positive integer or 0.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.