src/snac/client/webui/util/ConstellationPostMapper.php
/**
     * Parse a sub-language
     *
     * Parses a language that is an integral part of another object, such as an SCM,
     * BiogHist, NameEntry, etc.
     *
     * @param string[][] $object The string array to be parsed, which is the object containing a language
     * @param string $short The short name for this object's type (from the web page)
     * @param string|integer $i The id of the object on the page (not the DB ID)
     * @return \snac\data\Language The language object found when parsing the array
     */
Parse a sub-language
Parses a language that is an integral part of another object, such as an SCM,
BiogHist, NameEntry, etc.

@param string[][] $object The string array to be parsed, which is the object containing a language
@param string $short The short name for this object's type (from the web page)
@param string|integer $i The id of the object on the page (not the DB ID)
@return \snac\data\Language The language object found when parsing the array
Parse a sub - language Parses a language that is an integral part of another object such as an SCM BiogHist NameEntry etc . @param string [] [] $object The string array to be parsed which is the object containing a language @param string $short The short name for this object ' s type ( from the web page ) @param string|integer $i The id of the object on the page ( not the DB ID ) @return \ snac \ data \ Language The language object found when parsing the array
private function parseSubLanguage($object, $short, $i) {
        if (!isset($object["language"]))
            return null;
        if ($object["language"]["id"] == "" &&
                $object["language"]["version"] == "" &&
                (!isset($object["languagelanguage"]) ||
                $object["languagelanguage"]["id"] == "") &&
                (!isset($object["languagescript"]) ||
                $object["languagescript"]["id"] == "") ) {
            return null;
        }
        $lang = new \snac\data\Language();
        if (!$this->mapAsNew) {
            if ($object["language"]["id"] != "")
                $lang->setID($object["language"]["id"]);
            if ($object["language"]["version"] != "")
                $lang->setVersion($object["language"]["version"]);
        }
        if ($lang->getID() == null && $lang->getVersion() == null &&
                $this->getOperation($object) == \snac\data\Language::$OPERATION_UPDATE) {
            $lang->setOperation(\snac\data\Language::$OPERATION_INSERT);
        } else {
            $lang->setOperation($this->getOperation($object));
        }
        $lang->setLanguage($this->parseTerm($object["languagelanguage"]));
        $lang->setScript($this->parseTerm($object["languagescript"]));
        $this->addToMapping($short . "_language", $i, $object, $lang);
        return $lang;
    }
private function parseSubLanguage ( $ object , $ short , $ i ) { if ( ! isset ( $ object [ " language " ] ) ) return null ; if ( $ object [ " language " ] [ " id " ] == " " && $ object [ " language " ] [ " version " ] == " " && ( ! isset ( $ object [ " languagelanguage " ] ) || $ object [ " languagelanguage " ] [ " id " ] == " " ) && ( ! isset ( $ object [ " languagescript " ] ) || $ object [ " languagescript " ] [ " id " ] == " " ) ) { return null ; } $ lang = new \ snac \ data \ Language ( ) ; if ( ! $ this -> mapAsNew ) { if ( $ object [ " language " ] [ " id " ] != " " ) $ lang -> setID ( $ object [ " language " ] [ " id " ] ) ; if ( $ object [ " language " ] [ " version " ] != " " ) $ lang -> setVersion ( $ object [ " language " ] [ " version " ] ) ; } if ( $ lang -> getID ( ) == null && $ lang -> getVersion ( ) == null && $ this -> getOperation ( $ object ) == \ snac \ data \ Language :: $ OPERATION_UPDATE ) { $ lang -> setOperation ( \ snac \ data \ Language :: $ OPERATION_INSERT ) ; } else { $ lang -> setOperation ( $ this -> getOperation ( $ object ) ) ; } $ lang -> setLanguage ( $ this -> parseTerm ( $ object [ " languagelanguage " ] ) ) ; $ lang -> setScript ( $ this -> parseTerm ( $ object [ " languagescript " ] ) ) ; $ this -> addToMapping ( $ short . " _language " , $ i , $ object , $ lang ) ; return $ lang ; }
Parse a sub-language
 Parses a language that is an integral part of another object, such as an SCM,
 BiogHist, NameEntry, etc.
Parse a sub - language Parses a language that is an integral part of another object such as an SCM BiogHist NameEntry etc .
// If there is no language to parse, then just return null and don't do anything