src/snac/data/AbstractData.php
/**
     * Required method to convert this data object to an array
     *
     * @param boolean $shorten optional Whether or not to include null/empty components
     * @return string[][] This object as an associative array
     */
Required method to convert this data object to an array
@param boolean $shorten optional Whether or not to include null/empty components
@return string[][] This object as an associative array
Required method to convert this data object to an array @param boolean $shorten optional Whether or not to include null / empty components @return string [] [] This object as an associative array
public function toArray($shorten = true) {
        $return = array(
            'id' => $this->getID(),
            'version' => $this->getVersion(),
            'operation' => $this->getOperation()
            );
        $return['dates'] = array();
        if (isset($this->dateList) && $this->dateList != null) {
            foreach ($this->dateList as $i => $v)
            {
                $return["dates"][$i] = $v->toArray($shorten);
            }
        }
        if (isset($this->snacControlMetadata) && !empty($this->snacControlMetadata)) {
            $return['snacControlMetadata'] = array();
            foreach ($this->snacControlMetadata as $i => $v)
                $return["snacControlMetadata"][$i] = $v->toArray($shorten);
        }
        if ($shorten) {
            $return2 = array();
            foreach ($return as $i => $v)
                if ($v != null && !empty($v))
                    $return2[$i] = $v;
            unset($return);
            $return = $return2;
        }
        return $return;
    }
public function toArray ( $ shorten = true ) { $ return = array ( 'id' => $ this -> getID ( ) , 'version' => $ this -> getVersion ( ) , 'operation' => $ this -> getOperation ( ) ) ; $ return [ 'dates' ] = array ( ) ; if ( isset ( $ this -> dateList ) && $ this -> dateList != null ) { foreach ( $ this -> dateList as $ i => $ v ) { $ return [ " dates " ] [ $ i ] = $ v -> toArray ( $ shorten ) ; } } if ( isset ( $ this -> snacControlMetadata ) && ! empty ( $ this -> snacControlMetadata ) ) { $ return [ 'snacControlMetadata' ] = array ( ) ; foreach ( $ this -> snacControlMetadata as $ i => $ v ) $ return [ " snacControlMetadata " ] [ $ i ] = $ v -> toArray ( $ shorten ) ; } if ( $ shorten ) { $ return2 = array ( ) ; foreach ( $ return as $ i => $ v ) if ( $ v != null && ! empty ( $ v ) ) $ return2 [ $ i ] = $ v ; unset ( $ return ) ; $ return = $ return2 ; } return $ return ; }
Required method to convert this data object to an array
 @param boolean $shorten optional Whether or not to include null/empty components
 @return string[][] This object as an associative array
Required method to convert this data object to an array @param boolean $shorten optional Whether or not to include null / empty components @return string [] [] This object as an associative array
// Shorten if necessary