src/snac/server/database/DBUtil.php
/**
     * Test for delete operation
     *
     * This is a wrapper to deal with delete, and call setDeleted() if necessary. Returns true if not deleted
     * and it is ok to proceed with an insert or update.
     *
     * Note the setOperation() at the end right before return. It is best that we not return from the middle
     * of this function.
     *
     * This is where operation is cleared during write. Also see saveNrd() where operation for the constellation is cleared.
     *
     * @param integer[] $vhInfo Associative list with keys 'ic_id', 'version'.
     * @param object $cObj An object that supports getOperation() and getID().
     *
     * @return boolean true if not delete and ok to proceed
     */
Test for delete operation
This is a wrapper to deal with delete, and call setDeleted() if necessary. Returns true if not deleted
and it is ok to proceed with an insert or update.

Note the setOperation() at the end right before return. It is best that we not return from the middle
of this function.

This is where operation is cleared during write. Also see saveNrd() where operation for the constellation is cleared.

@param integer[] $vhInfo Associative list with keys 'ic_id', 'version'.
@param object $cObj An object that supports getOperation() and getID().

@return boolean true if not delete and ok to proceed
Test for delete operation This is a wrapper to deal with delete and call setDeleted () if necessary . Returns true if not deleted and it is ok to proceed with an insert or update . Note the setOperation () at the end right before return . It is best that we not return from the middle of this function . This is where operation is cleared during write . Also see saveNrd () where operation for the constellation is cleared . @param integer [] $vhInfo Associative list with keys ' ic_id ' ' version ' . @param object $cObj An object that supports getOperation () and getID () . @return boolean true if not delete and ok to proceed
private function prepOperation($vhInfo, $cObj)
    {
        $theOp = $cObj->getOperation();
        $result = false;
        if ($theOp == \snac\data\AbstractData::$OPERATION_DELETE)
        {
            $this->setDeleted($vhInfo, $cObj);
            $result = false;
        }
        elseif (! $theOp)
        {
            $result = false;
        }
        else
        {
            $result = true;
        }
        return $result;
    }
private function prepOperation ( $ vhInfo , $ cObj ) { $ theOp = $ cObj -> getOperation ( ) ; $ result = false ; if ( $ theOp == \ snac \ data \ AbstractData :: $ OPERATION_DELETE ) { $ this -> setDeleted ( $ vhInfo , $ cObj ) ; $ result = false ; } elseif ( ! $ theOp ) { $ result = false ; } else { $ result = true ; } return $ result ; }
Test for delete operation
 This is a wrapper to deal with delete, and call setDeleted() if necessary.
Test for delete operation This is a wrapper to deal with delete and call setDeleted () if necessary .
/*
             * if (! $cObj->getID())
             * {
             *     /\*
             *      * If we have no ID then this must be an insert, so return true now.  This is really just a
             *      * case during testing prior to all objects explicitly getting an operation. Once every
             *      * operation is set, this branch should never run.
             *      *\/
             *     $result = true;
             * }
             * else
             * {
             */ /*
             * Apr 6 2016. The code above that allowed insert when no op and no id is wrong. The rule is: no
             * operation is nothing gets done. There's no being nice. Actually, it is nice to not do things
             * when no operation because the UI can be a bit more lax about things like empty objects.
             *
             * Mar 8 2014. With a null operation, we do nothing, and by returning false we prevent the calling
             * code from doing anything as well.
             *
             * This prevents nameEntry with no operation from updating itself when its child contributor has
             * an operation. In some cases the other code will not send objects that have no operation, but
             * that doesn't save us any work here because we always have to test the operation.
             *
             * If the no-op objects really were simply not in the constellation, then all inserts and updates
             * would be identical. No-op objects are sometimes present, and thus this distinction for no
             * operation.
             *
             * Top level code will have already minted a new version number, and since all true updates and
             * inserts are equivalent at the low level, the only thing we need to do here is prevent
             * unnecessary updates on no-op objects.
             *
             */ /* } */