gyro/core/model/base/fields/dbfield.time.cls.php
Go to the documentation of this file.00001 <?php 00002 require_once dirname(__FILE__) . '/dbfield.datetime.cls.php'; 00003 00004 /** 00005 * A time field 00006 * 00007 * @author Gerd Riesselmann 00008 * @ingroup Model 00009 */ 00010 class DBFieldTime extends DBFieldDateTime { 00011 /** 00012 * Returns fucntion or constant to set current time in DB (like NOW() or CURRENT_TIMESTAMP) 00013 * 00014 * @return string 00015 */ 00016 protected function get_db_now_constant() { 00017 return 'CURRENT_TIME'; 00018 } 00019 00020 /** 00021 * Formats a value for use in DB 00022 * 00023 * @param datetime $value 00024 * @return string 00025 */ 00026 protected function format_date_value($value) { 00027 return $this->quote(GyroDate::mysql_time($value, false)); 00028 } 00029 00030 /** 00031 * Allow replacements for field in select from clause 00032 */ 00033 public function format_select() { 00034 return 'TIME_TO_SEC(' . DBField::format_select() . ')'; 00035 } 00036 }