gyro/core/lib/interfaces/idbfield.cls.php
Go to the documentation of this file.00001 <?php 00002 require_once dirname(__FILE__) . '/ipolicyholder.cls.php'; 00003 /** 00004 * Interface for DB Field 00005 * 00006 * @author Gerd Riesselmann 00007 * @ingroup Interfaces 00008 */ 00009 interface IDBField extends IPolicyHolder { 00010 /** 00011 * Returns name 00012 * 00013 * @return string 00014 */ 00015 public function get_field_name(); 00016 00017 /** 00018 * Returns true, if null values are allowed 00019 * 00020 * @return bool 00021 */ 00022 public function get_null_allowed(); 00023 00024 /** 00025 * Returns the default value for this field 00026 * 00027 * @return mixed 00028 */ 00029 public function get_field_default(); 00030 00031 /** 00032 * Returns true, if field has default value 00033 */ 00034 public function has_default_value(); 00035 00036 /** 00037 * Returns true, if the value passed fits the fields restrictions 00038 * 00039 * @param mixed $value 00040 * @return Status 00041 */ 00042 public function validate($value); 00043 00044 /** 00045 * Reformat passed value to DB format 00046 * 00047 * @param mixed $value 00048 * @return string 00049 */ 00050 public function format($value); 00051 00052 /** 00053 * Format for use in WHERE clause 00054 * 00055 * @param mixed $value 00056 * @return string 00057 */ 00058 public function format_where($value); 00059 00060 /** 00061 * Allow replacements for field in select from clause 00062 */ 00063 public function format_select(); 00064 00065 /** 00066 * Transform result from SELECT to native 00067 * 00068 * @param mixed $value 00069 * @return mixed 00070 */ 00071 public function convert_result($value); 00072 00073 /** 00074 * Reads value from array (e.g $_POST) and converts it into something meaningfull 00075 */ 00076 public function read_from_array($arr); 00077 00078 /** 00079 * Set connection of field 00080 * 00081 * @param string|IDBDriver $connection 00082 * @return void 00083 */ 00084 public function set_connection($connection); 00085 00086 /** 00087 * Set table field belongs to 00088 * 00089 * @attention The table may not be set, fields must be aware of this! 00090 * 00091 * @param IDBTable $table 00092 * @return void 00093 */ 00094 public function set_table($table); 00095 }