src/snac/data/SNACDate.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" => "SNACDate",
            "fromDate" => $this->fromDate,
            "fromDateOriginal" => $this->fromDateOriginal,
            "fromType" => $this->fromType == null ? null : $this->fromType->toArray($shorten),
            "fromBC" => $this->fromBC,
            "fromRange" => $this->fromRange,
            "toDate" => $this->toDate,
            "toDateOriginal" => $this->toDateOriginal,
            "toType" => $this->toType == null ? null : $this->toType->toArray($shorten),
            "toBC" => $this->toBC,
            "toRange" => $this->toRange,
            "isRange" => $this->isRange,
            "note" => $this->note
        );
        $return = array_merge($return, parent::toArray($shorten));
        if ($shorten) {
            $return2 = array();
            foreach ($return as $i => $v)
                if ($v != null && !empty($v))
                    $return2[$i] = $v;
            if (isset($return2["fromRange"]) && $return2["fromRange"]["notBefore"] == null && $return2["fromRange"]["notAfter"] == null)
                unset($return2["fromRange"]);
            if (isset($return2["toRange"]) && $return2["toRange"]["notBefore"] == null && $return2["toRange"]["notAfter"] == null)
                unset($return2["toRange"]);
            unset($return);
            $return = $return2;
        }
        return $return;
    }
public function toArray ( $ shorten = true ) { $ return = array ( " dataType " => " SNACDate " , " fromDate " => $ this -> fromDate , " fromDateOriginal " => $ this -> fromDateOriginal , " fromType " => $ this -> fromType == null ? null : $ this -> fromType -> toArray ( $ shorten ) , " fromBC " => $ this -> fromBC , " fromRange " => $ this -> fromRange , " toDate " => $ this -> toDate , " toDateOriginal " => $ this -> toDateOriginal , " toType " => $ this -> toType == null ? null : $ this -> toType -> toArray ( $ shorten ) , " toBC " => $ this -> toBC , " toRange " => $ this -> toRange , " isRange " => $ this -> isRange , " note " => $ this -> note ) ; $ return = array_merge ( $ return , parent :: toArray ( $ shorten ) ) ; if ( $ shorten ) { $ return2 = array ( ) ; foreach ( $ return as $ i => $ v ) if ( $ v != null && ! empty ( $ v ) ) $ return2 [ $ i ] = $ v ; if ( isset ( $ return2 [ " fromRange " ] ) && $ return2 [ " fromRange " ] [ " notBefore " ] == null && $ return2 [ " fromRange " ] [ " notAfter " ] == null ) unset ( $ return2 [ " fromRange " ] ) ; if ( isset ( $ return2 [ " toRange " ] ) && $ return2 [ " toRange " ] [ " notBefore " ] == null && $ return2 [ " toRange " ] [ " notAfter " ] == null ) unset ( $ return2 [ " toRange " ] ) ; unset ( $ return ) ; $ return = $ return2 ; } return $ return ; }
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
// Shorten if necessary