src/snac/server/database/DBUtil.php
/**
     * Add MaybeSame Link
     *
     * Adds a maybe_same link between the two constellations given as parameters.  Assumes that the maybesame table is
     * bi-directional and only inserts one direction in the table.
     *
     * @param \snac\data\Constellation $constellation1 The first constellation
     * @param \snac\data\Constellation $constellation2 The second constellation
     * @param \snac\data\User $user The user making the maybe-same assertion
     * @param string $assertion optional A note to include for the assertion
     * @return boolean true on success, false otherwise
     */
Add MaybeSame Link
Adds a maybe_same link between the two constellations given as parameters.  Assumes that the maybesame table is
bi-directional and only inserts one direction in the table.


Add MaybeSame Link Adds a maybe_same link between the two constellations given as parameters . Assumes that the maybesame table is bi - directional and only inserts one direction in the table .
public function addMaybeSameLink(&$constellation1, &$constellation2, &$user, $assertion = "") {
        if ($constellation1 === null || $constellation2 === null || $user == null)
            return false;
        if ($constellation1->getID() === null || $constellation2->getID() === null)
            return false;
        $assert = new \snac\data\Assertion();
        $assert->addConstellation($constellation1);
        $assert->addConstellation($constellation2);
        $assert->setType("not_same");
        $result = $this->readAssertion($assert);
        if ($result !== false)
            return false;
        $current = $this->sql->listMaybeSameIDsFor($constellation1->getID());
        if (in_array($constellation2->getID(), $current)) {
            return true;
        }
        $this->sql->addMaybeSameLink($constellation1->getID(), $constellation2->getID(),
                                        $user->getUserID(), $assertion);
        return true;
    }
public function addMaybeSameLink ( & $ constellation1 , & $ constellation2 , & $ user , $ assertion = " " ) { if ( $ constellation1 === null || $ constellation2 === null || $ user == null ) return false ; if ( $ constellation1 -> getID ( ) === null || $ constellation2 -> getID ( ) === null ) return false ; $ assert = new \ snac \ data \ Assertion ( ) ; $ assert -> addConstellation ( $ constellation1 ) ; $ assert -> addConstellation ( $ constellation2 ) ; $ assert -> setType ( " not_same " ) ; $ result = $ this -> readAssertion ( $ assert ) ; if ( $ result !== false ) return false ; $ current = $ this -> sql -> listMaybeSameIDsFor ( $ constellation1 -> getID ( ) ) ; if ( in_array ( $ constellation2 -> getID ( ) , $ current ) ) { return true ; } $ this -> sql -> addMaybeSameLink ( $ constellation1 -> getID ( ) , $ constellation2 -> getID ( ) , $ user -> getUserID ( ) , $ assertion ) ; return true ; }
Add MaybeSame Link
 Adds a maybe_same link between the two constellations given as parameters.
Add MaybeSame Link Adds a maybe_same link between the two constellations given as parameters .
// If asserted to be not the same, then don't allow // If already in the list of maybe sames, then silently allow (but don't duplicate)