DBFieldSerialized Class Reference
[Model]
A field to serialize content, can be anything, e.g. More...
Public Member Functions |
|
__construct ($name, $length=DBFieldText::BLOB_LENGTH_SMALL, $default_value=null, $policy=self::NONE) | |
convert_result ($value) | |
Transform result from SELECT to native.
|
|
get_field_default () | |
Returns the default value for this field.
|
|
validate ($value) | |
Returns true, if the value passed fits the
fields restrictions. |
|
Protected Member Functions |
|
do_format_not_null ($value) | |
Format values that are not NULL. |
Detailed Description
A field to serialize content, can be anything, e.g.
an array
Definition at line 10 of file dbfield.serialized.cls.php.
Constructor & Destructor Documentation
DBFieldSerialized::__construct | ( | $ | name, | |
$ | length = DBFieldText::BLOB_LENGTH_SMALL , |
|||
$ | default_value =
null , |
|||
$ | policy =
self::NONE |
|||
) |
Reimplemented from DBFieldText.
Definition at line 11 of file dbfield.serialized.cls.php.
00011 { 00012 /* @TODO Should default value be serialized here? */ 00013 parent::__construct($name, $length, serialize($default_value), $policy); 00014 }
Member Function Documentation
DBFieldSerialized::convert_result | ( | $ | value | ) |
Transform result from SELECT to native.
- Parameters:
-
mixed $value
- Returns:
- mixed
Reimplemented from DBField.
Definition at line 42 of file dbfield.serialized.cls.php.
00042 { 00043 return is_null($value) ? null : unserialize($value); 00044 }
DBFieldSerialized::do_format_not_null | ( | $ | value | ) | [protected] |
Format values that are not NULL.
- Parameters:
-
mixed $value
- Returns:
- string
Reimplemented from DBField.
Definition at line 32 of file dbfield.serialized.cls.php.
00032 { 00033 return parent::do_format_not_null(serialize($value)); 00034 }
DBFieldSerialized::get_field_default | ( | ) |
Returns the default value for this field.
- Returns:
- mixed
Reimplemented from DBField.
Definition at line 51 of file dbfield.serialized.cls.php.
00051 { 00052 $ret = parent::get_field_default(); 00053 if ($ret) { 00054 $ret = unserialize($ret); 00055 } 00056 return $ret; 00057 }
DBFieldSerialized::validate | ( | $ | value | ) |
Returns true, if the value passed fits the fields restrictions.
- Parameters:
-
mixed $value
- Returns:
- Status
Reimplemented from DBFieldText.
Definition at line 22 of file dbfield.serialized.cls.php.
00022 { 00023 return parent::validate(serialize($value)); 00024 }
The documentation for this class was generated from the following file:
- gyro/core/model/base/fields/dbfield.serialized.cls.php