src/snac/server/ServerExecutor.php
/**
     * List MaybeSames for Constellation
     *
     * This method looks up the constellation and any maybeSame relations (possible merges) for the constellation.
     *
     * @param string[] $input Input array from the Server object
     * @throws \snac\exceptions\SNACPermissionException
     * @return string[] The response to send to the client
     */
List MaybeSames for Constellation
This method looks up the constellation and any maybeSame relations (possible merges) for the constellation.

@param string[] $input Input array from the Server object
@throws \snac\exceptions\SNACPermissionException
@return string[] The response to send to the client
List MaybeSames for Constellation This method looks up the constellation and any maybeSame relations ( possible merges ) for the constellation . @param string [] $input Input array from the Server object @throws \ snac \ exceptions \ SNACPermissionException @return string [] The response to send to the client
public function listMaybeSameConstellations(&$input) {
        $this->logger->addDebug("Listing MaybeSame For Constellation");
        $response = array();
        if (isset($input["constellationid"])) {
            try {
                $this->logger->addDebug("Reading constellation from the database");
                $cId = $input["constellationid"];
                $status = $this->cStore->readConstellationStatus($cId);
                if ( $status == "published" ) {
                    $response["mergeable"] = true;
                } else {
                    $response["mergeable"] = false;
                }
                $constellation = $this->cStore->readConstellation($cId, null, \snac\server\database\DBUtil::$READ_SHORT_SUMMARY);
                $this->logger->addDebug("Finished reading constellation from the database");
                $response["constellation"] = $constellation->toArray();
                $maybeSame = $this->cStore->listMaybeSameConstellations($cId,\snac\server\database\DBUtil::$READ_SHORT_SUMMARY);
                $response["maybe_same"] = array();
                foreach ($maybeSame as $key => $ms) {
                    $response["maybe_same"][$key] = array(
                        "constellation" => $ms->toArray(),
                        "mergeable" => ($this->cStore->readConstellationStatus($ms->getID()) == "published")
                    );
                }
            } catch (\Exception $e) {
                throw $e;
            }
        }
        return $response;
    }
public function listMaybeSameConstellations ( & $ input ) { $ this -> logger -> addDebug ( " Listing MaybeSame For Constellation " ) ; $ response = array ( ) ; if ( isset ( $ input [ " constellationid " ] ) ) { try { $ this -> logger -> addDebug ( " Reading constellation from the database " ) ; $ cId = $ input [ " constellationid " ] ; $ status = $ this -> cStore -> readConstellationStatus ( $ cId ) ; if ( $ status == " published " ) { $ response [ " mergeable " ] = true ; } else { $ response [ " mergeable " ] = false ; } $ constellation = $ this -> cStore -> readConstellation ( $ cId , null , \ snac \ server \ database \ DBUtil :: $ READ_SHORT_SUMMARY ) ; $ this -> logger -> addDebug ( " Finished reading constellation from the database " ) ; $ response [ " constellation " ] = $ constellation -> toArray ( ) ; $ maybeSame = $ this -> cStore -> listMaybeSameConstellations ( $ cId , \ snac \ server \ database \ DBUtil :: $ READ_SHORT_SUMMARY ) ; $ response [ " maybe_same " ] = array ( ) ; foreach ( $ maybeSame as $ key => $ ms ) { $ response [ " maybe_same " ] [ $ key ] = array ( " constellation " => $ ms -> toArray ( ) , " mergeable " => ( $ this -> cStore -> readConstellationStatus ( $ ms -> getID ( ) ) == " published " ) ) ; } } catch ( \ Exception $ e ) { throw $ e ; } } return $ response ; }
List MaybeSames for Constellation
 This method looks up the constellation and any maybeSame relations (possible merges) for the constellation.
List MaybeSames for Constellation This method looks up the constellation and any maybeSame relations ( possible merges ) for the constellation .
// Editing the given constellation id by reading the database // Read the constellation // Right now, only published constellations can be merged, so that we can keep a "clean" history // read the constellation into response // Leaving a catch block for logging purposes