findAll(connection)
create()
clone()
update()
addProperty(property)
removeProperty(property)
delete()
getSelectorId()
getSelectorName()
getLevel()
getProperties()
getProperty(propertyName)
setSelectorId(selectorId)
setSelectorName(selectorId)
setLevel(accessGroupId)
BuildForge::Services::DBO::Selector
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing selectors $allSelectors = BuildForge::Services::DBO::Selector->findAll($conn); $oldselector = BuildForge::Services::DBO::Selector->findById($conn, 'SelectorName');
# Getter / setter functions $id = $oldselector->getSelectorId(); $name = $oldselector->getSelectorName(); $accessGroupId = $oldselector->getLevel(); $allProperties = $oldselector->getProperties(); $property = $oldselector->getProperty('BF_JOBS'); $oldselector->setSelectorId('New Name'); $oldselector->setSelectorName('Another New Name'); $oldselector->setLevel($accessGroupId); $oldselector->update(); # Selector creation, modification, deletion $newselector = new BuildForge::Services::DBO::Selector($conn); $newselector->setSelectorName('New Selector'); $newselector->setLevel($accessGroupId); $newselector->create(); $newselector2 = $newselector->clone(); $newselector2->setSelectorName('Duplicate'); $newselector2->create(); $newselector->setSelectorName('New Name For New Selector'); $newselector->update();
$property = new BuildForge::Services::DBO::SelectorProperty($conn); $property->setPropertyName('PROP_NAME'); $property->setOperator(ENUM_SELECTORPROPERTY_OPERATOR->EQ); $property->setPropertyValue('Value'); $newselector->addProperty($property); $newselector->removeProperty($property); $newselector->removeProperty($property->getPropertyName()); $newselector->delete(); $conn->logout; $conn->close;
Selector allows you to create, modify, and delete BuildForge selectors.
Returns a new instance of a Selector object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The name / ID of the selector.
The access group ID (from $accessGroup->getLevel())
of the access group that the
selector belongs to. If a user does not belong to this access group, they cannot
view, edit, or use the selector.
findAll(connection)
Returns a reference to an array of BuildForge::Services::DBO::Selector objects corresponding
to all selectors in the database that the user has access to. These objects will not
contain their SelectorProperty subobjects. To get the properties, use
BuildForge::Services::DBO::Selector->findById()
with the selector's ID.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::Selector object corresponding to the given selector ID, or undef if no such object exists.
A connected BuildForge::Services::Connection object.
The selector ID / name of the desired selector (from $selector->getSelectorId()).
create()
Creates the selector object inside the database.
clone()
Returns a copy of the BuildForge::Services::DBO::Selector object. This copy
will not exist in the database until $copy->create()
is called.
update()
Updates the selector record within the database.
addProperty(property)
Adds the given property to the selector within the database.
The BuildForge::Services::DBO::SelectorProperty object to be added.
removeProperty(property)
Removes the given property from the selector within the database.
The BuildForge::Services::DBO::SelectorProperty object to be deleted or the property name. If there is more than one property with the same name, the first one added to the selector will be deleted.
delete()
Deletes the selector and all its properties from the database.
getSelectorId()
Returns the name / ID of the selector. Alias for $selector->getSelectorName().
getSelectorName()
Returns the name / ID of the selector.
getLevel()
Returns the access group ID for the access group that controls the selector. Users not in the access group cannot view, edit, or use the selector.
getProperties()
Returns a reference to an array of BuildForge::Services::DBO::SelectorProperty objects corresponding to all selector properties within the selector.
getProperty(propertyName)
Returns the BuildForge::Services::DBO::SelectorProperty object corresponding to the given name. If there is more than one property with the same name, the first one added to the selector will be deleted.
The name of the desired selector property.
setSelectorId(selectorId)
Sets the selector ID / name. Alias for $selector->setSelectorName(). $selector->update()
must be run
before changes are replicated in the database.
The new ID / name for the selector.
setSelectorName(selectorId)
Sets the selector ID / name. $selector->update()
must be run
before changes are replicated in the database.
The new ID / name for the selector.
setLevel(accessGroupId)
Sets the access group that the selector belongs to. Users who don't belong to
this access group can't view, edit, or use this selector. $selector->update()
must be run
before changes are replicated in the database.
The ID of the access group, from $accessGroup->getLevel().
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.