code: public static function convertToArray( $mixed ) {
          if ( is_object( $mixed ) ) {
              if ( is_a( $mixed, 'StdClass' ) ) {
                  $mixed = ( array ) $mixed;
              } else if ( is_a( $mixed, 'ArrayObject' ) ) {
                  $mixed = $mixed->getArrayCopy( );
              } else {
                  $mixed = get_object_vars( $mixed );
              }
          } else if ( ! is_array( $mixed ) ) {
              if ( empty( $mixed ) ) {
                  $mixed = array( );
              } else {
                  $mixed = array( $mixed );
              }
          }
          return $mixed;
      }
docs: ***********************************************************************
  CONVERSION METHODS
  ***********************************************************************