Пример #1
0
 protected function _compile_constraints()
 {
     // Let the parent do their stuff first
     $constraints = parent::_compile_constraints();
     // Return the constraints
     return $constraints;
 }
Пример #2
0
 protected function _compile_constraints()
 {
     // Let the parent process the constraints first.
     parent::_compile_constraints();
     // Defaults given for datetimes
     if (isset($this->default)) {
         // If the default is a valid date format, then quote it, otherwise leave it as is
         $constraints['default'] = strtotime($this->default) ? $this->table->database->quote($this->default) : $this->default;
     }
     return $constraints;
 }
Пример #3
0
 protected function _compile_constraints()
 {
     // Let the parent do their bit first
     $constraints = parent::_compile_constraints();
     // If the field is set to auto_increment, then set it.
     if ($this->is_auto_increment) {
         $constraints[] = 'auto_increment';
     }
     // Finally return the constraints
     return $constraints;
 }