NAME

BuildForge::Services::DBO::SelectorProperty


SYNOPSIS

        use BuildForge::Services;
        $conn = new BuildForge::Services::Connection($hostname);
        $token = $conn->authUser($user, $pass);
        
        $property = new BuildForge::Services::DBO::SelectorProperty($conn);
        # Getter / setter functions
        $selectorName = $property->getSelectorId();
        $propertyName = $property->getPropertyName();
        $operator = $property->getOperator();
        $value = $property->getPropertyValue();
        $isRequired = $property->getRequired();
        $parentSelector = $property->getParent();
        $property->setPropertyName('PROP_NAME');
        $property->setOperator(ENUM_SELECTORPROPERTY_OPERATOR->EQ);
        $property->setPropertyValue('New Value');
        $property->setRequired(1);
        $property->update();
        
        # Selector property creation, modification, and deletion
        $selector = BuildForge::Services::DBO::Selector->findById($conn, $selectorId);
        $newproperty = new BuildForge::Services::DBO::SelectorProperty($conn);
        $newproperty->setPropertyName('PROPERTY_NAME');
        $newproperty->setOperator(ENUM_SELECTORPROPERTY_OPERATOR->EQ);
        $newproperty->setPropertyValue('Value');
        $selector->addProperty($var);
        $newproperty->setPropertyValue('New Value');
        $newproperty->update();
        
        $newproperty2 = $newproperty->clone();
        $selector->addProperty($newproperty2);
        $newproperty->delete();
                
        $conn->logout;
        $conn->close;


DESCRIPTION

SelectorProperty allows you to create and modify selector properties inside of a Selector. To create selector properties in the database, see the Selector->addSelectorProperty() function.


METHODS

new BuildForge::Services::DBO::SelectorProperty(connection, {selector}, {SelectorPropertyParamsHashRef})

Returns a new instance of a SelectorProperty object.

connection

A connected BuildForge::Services::Connection object.

selector

This should be undef or not passed - it is only used internally.

SelectorPropertyParamsHashRef

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

propertyName

The name of the selector property.

propertyValue

The selector property value.

operator

The selector property operator. This may be one of 'EQ', 'NE', 'GT', 'GE', 'LT', 'LE', or 'CONTAINS', defaulting to 'EQ'.

required

This should be 1 if this selector property is required or 0 (the default) otherwise.

$property->update()

Updates the selector property within the database.

$property->delete()

Deletes the selector property from the database.

$property->clone()

Returns a copy of the BuildForge::Services::DBO::Selector object. The object will not exist in the database until added with $selector->addSelectorProperty($copy).

$property->getSelectorId()

Returns the name / ID of the selector that the property belongs to.

$property->getPropertyName()

Returns the name of the selector property.

$property->getOperator()

Returns the selector property operator. This will be one of 'EQ', 'NE', 'GT', 'GE', 'LT', 'LE', or 'CONTAINS'.

$property->getPropertyValue()

Returns the selector property value.

$property->getRequired()

Returns 1 if the selector property is required or 0 if it is optional.

$property->getParent()

Returns the BuildForge::Services::DBO::Selector object for the selector this property belongs to.

$property->setPropertyName(propertyName)

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

propertyName

The new name for the property.

$property->setOperator(propertyOp)

Sets the property operator. $property->update() must be run before changes are replicated in the database.

propertyOp

The new operator. This may be one of 'EQ', 'NE', 'GT', 'GE', 'LT', 'LE', or 'CONTAINS'.

$property->setPropertyValue(propertyValue)

Sets the property value. $property->update() must be run before changes are replicated in the database.

propertyValue

The new value.

$property->setRequired(isRequired)

Sets whether the property is required. $property->update() must be run before changes are replicated in the database.

isRequired

If this evaluates to true, the property will be required. If false, the property will be optional.


COPYRIGHT

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