src/snac/data/NameEntry.php
/**
     * Returns this object's data as an associative array.
     *
     * @param boolean $shorten optional Whether or not to include null/empty components
     * @return string[][] This objects data in array form
     */
Returns this object's data as an associative array.
@param boolean $shorten optional Whether or not to include null/empty components
@return string[][] This objects data in array form
Returns this object ' s data as an associative array . @param boolean $shorten optional Whether or not to include null / empty components @return string [] [] This objects data in array form
public function toArray($shorten = true) {
        $return = array(
            "dataType" => "NameEntry",
            "original" => $this->original,
            "preferenceScore" => $this->preferenceScore,
            "contributors" => array(),
            "components" => array(),
            "language" => $this->language == null ? null : $this->language->toArray($shorten),
        );
        foreach ($this->components as $i => $v)
            $return["components"][$i] = $v->toArray($shorten);
        foreach ($this->contributors as $i => $v)
            $return["contributors"][$i] = $v->toArray($shorten);
        $return = array_merge($return, parent::toArray($shorten));
        if ($shorten) {
            $return2 = array();
            foreach ($return as $i => $v)
                if ($v != null && (!empty($v) || $v == 0))
                    $return2[$i] = $v;
            unset($return);
            $return = $return2;
        }
        return $return;
    }
public function toArray ( $ shorten = true ) { $ return = array ( " dataType " => " NameEntry " , " original " => $ this -> original , " preferenceScore " => $ this -> preferenceScore , " contributors " => array ( ) , " components " => array ( ) , " language " => $ this -> language == null ? null : $ this -> language -> toArray ( $ shorten ) , ) ; foreach ( $ this -> components as $ i => $ v ) $ return [ " components " ] [ $ i ] = $ v -> toArray ( $ shorten ) ; foreach ( $ this -> contributors as $ i => $ v ) $ return [ " contributors " ] [ $ i ] = $ v -> toArray ( $ shorten ) ; $ return = array_merge ( $ return , parent :: toArray ( $ shorten ) ) ; if ( $ shorten ) { $ return2 = array ( ) ; foreach ( $ return as $ i => $ v ) if ( $ v != null && ( ! empty ( $ v ) || $ v == 0 ) ) $ return2 [ $ i ] = $ v ; unset ( $ return ) ; $ return = $ return2 ; } return $ return ; }
Returns this object's data as an associative array.
Returns this object ' s data as an associative array .
// Shorten if necessary