NAME

Podius::FieldType - provides objects to abstract media field types


SYNOPSIS

  use Podius::FieldType;
  my $ftype = new Podius::FieldType(Podius::FieldType::STRING, 250);
  my ($type_code, $type_param, $type_is_list) = $ftype->decode;
  print join(', ', $ftype->get_code_name . " ($type_code)",
    $type_param, $type_is_list), "\n";


DESCRIPTION

To write.


TYPE CODES

This is a list of known (as of now) type codes, they are available in Podius::FieldType namespace as constants, Podius::FieldType::STRING.

  * STRING
  * INTEGER
  * BOOLEAN
  * CHAR
  * DATE
  * OID


METHODS

new

description
Composes an object representing a field type by the given type code and optional parameter(s).

In case of a list, the type code and its parameter refer to a type of the list's elements.

parameters
  * type-code, integer - see Type Codes section
  * type-param - optional parameter (scalar or ARRAY or undef)
  * type-is-array, boolean - true if list, by default false
returns
A perl value representing a field type.

decode

description
Decomposes a perl value representing a field type to a type code and its parameter(s).

In case of a list, the type code and its parameter refer to a type of the list's elements.

parameters
None.

returns
A list of 3 values:
  * type-code, integer - see Type Codes section
  * type-param - optional parameter (scalar or ARRAY or undef)
  * type-is-list, boolean - true if list, by default false

get_code, get_code_name, get_param, is_list

description
Return a corresponding parts of the type, see also decode.

parameters
None.

returns
  get_code: integer
  get_code_name: string
  get_param: scalar or ARRAY or undef
  is_list: boolean