Example #1
0
 /**
  * Field attribute DEFAULT
  *
  * @param    array &$attributes
  * @param    array &$field
  *
  * @return    void
  */
 protected function _attributeDefault(&$attributes, &$field)
 {
     if ($this->default === false) {
         return;
     }
     if (array_key_exists('DEFAULT', $attributes)) {
         if ($attributes['DEFAULT'] === null) {
             $field['default'] = empty($this->null) ? '' : $this->default . $this->null;
             // Override the NULL attribute if that's our default
             $attributes['NULL'] = true;
             $field['null'] = empty($this->null) ? '' : ' ' . $this->null;
         } else {
             $field['default'] = $this->default . $this->db->escape($attributes['DEFAULT']);
         }
     }
 }