src/snac/server/validation/validators/HasOperationValidator.php
/**
     * Check a given data object
     *
     * Check that the given object, inherited from AbstractData, has an operation that is
     * compatible with either the global constellation operation or the operation passed
     * in as a parameter.
     *
     * @param \snac\data\AbstractData $object data object to check the operation
     * @param string $context The parent operation, if it exists
     * @return boolean true if valid, false if invalid
     */
Check a given data object
Check that the given object, inherited from AbstractData, has an operation that is
compatible with either the global constellation operation or the operation passed
in as a parameter.

@param \snac\data\AbstractData $object data object to check the operation
@param string $context The parent operation, if it exists
@return boolean true if valid, false if invalid
Check a given data object Check that the given object inherited from AbstractData has an operation that is compatible with either the global constellation operation or the operation passed in as a parameter . @param \ snac \ data \ AbstractData $object data object to check the operation @param string $context The parent operation if it exists @return boolean true if valid false if invalid
private function validateAbstractData($object, $context = null) {
        if ($object == null)
            return true;
        $success = true;
        if ($object->getSNACControlMetadata() != null) {
            foreach ($object->getSNACControlMetadata() as $scm) {
                $success = $success && $this->validateSNACControlMetadata($scm, $object->getOperation());
            }
        }
        if ($this->hasOperationValue($object->getOperation())) {
            $this->hasOperation = true;
            return true;
        }
        return $success;
    }
private function validateAbstractData ( $ object , $ context = null ) { if ( $ object == null ) return true ; $ success = true ; if ( $ object -> getSNACControlMetadata ( ) != null ) { foreach ( $ object -> getSNACControlMetadata ( ) as $ scm ) { $ success = $ success && $ this -> validateSNACControlMetadata ( $ scm , $ object -> getOperation ( ) ) ; } } if ( $ this -> hasOperationValue ( $ object -> getOperation ( ) ) ) { $ this -> hasOperation = true ; return true ; } return $ success ; }
Check a given data object
 Check that the given object, inherited from AbstractData, has an operation that is
 compatible with either the global constellation operation or the operation passed
 in as a parameter.
Check a given data object Check that the given object inherited from AbstractData has an operation that is compatible with either the global constellation operation or the operation passed in as a parameter .
// Null objects very easily success validation // Check AbstractData-level objects // Test that the operation has a value // If the operation has a value, then set that we have seen at least one // operation during this scan.