.

DBFieldBlob Class Reference
[Model]

A BLOB field im DB. More...

Inheritance diagram for DBFieldBlob:
DBFieldText DBField IDBField IPolicyHolder

List of all members.

Public Member Functions

  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 BLOB field im DB.

Author:
Gerd Riesselmann

Definition at line 10 of file dbfield.blob.cls.php.


Member Function Documentation

DBFieldBlob::do_format_not_null ( value  )  [protected]

Format values that are not NULL.

Reimplemented from DBField.

Definition at line 15 of file dbfield.blob.cls.php.

00015                                                       {
00016                 if ($value !== '') {
00017                         return '0x' . bin2hex($value);
00018                 }
00019                 else {
00020                         return parent::format('');
00021                 }
00022         }
DBFieldBlob::validate ( value  ) 

Returns true, if the value passed fits the fields restrictions.

Parameters:
string  $value
Returns:
Status

Reimplemented from DBFieldText.

Definition at line 30 of file dbfield.blob.cls.php.

00030                                          {
00031                 $ret = new Status();
00032                 $l = strlen(strval($value));
00033                 if ($l > $this->length) {
00034                         $ret->append(tr(
00035                                 '%field may have no more than %num bytes', 
00036                                 'core', 
00037                                 array(
00038                                         '%field' => $this->get_field_name_translation(),
00039                                         '%num' => $this->length
00040                                 )
00041                         ));
00042                 }
00043                 else if ($l == 0 && !$this->get_null_allowed()) {
00044                         $ret->append(tr(
00045                                 '%field may not be empty', 
00046                                 'core', 
00047                                 array(
00048                                         '%field' => $this->get_field_name_translation(),
00049                                 )
00050                         ));
00051                 }
00052                 return $ret;
00053         }       

The documentation for this class was generated from the following file: