/** * * Overrides the parent _prepare() to honor `y_first` and `y_last` element * info keys. * * @param array $info An array of element information. * * @return void * */ protected function _prepare($info) { parent::_prepare($info); if (array_key_exists('y_first', $info)) { $this->_y_first = $info['y_first']; } else { $this->_y_first = $this->_config['y_first']; } if (array_key_exists('y_last', $info)) { $this->_y_last = $info['y_last']; } else { $this->_y_last = $this->_config['y_last']; } // if the value is required but empty, fill with current timestamp if (!$this->_value && $this->_require) { $this->_value = date('Y-m-d H:i:s'); } }
/** * * Overrides the parent _prepare() to honor `y_first` and `y_last` element * info keys. * * @param array $info An array of element information. * * @return void * */ protected function _prepare($info) { parent::_prepare($info); if (array_key_exists('y_first', $info)) { $this->_y_first = $info['y_first']; } else { $this->_y_first = $this->_config['y_first']; } if (array_key_exists('y_last', $info)) { $this->_y_last = $info['y_last']; } else { $this->_y_last = $this->_config['y_last']; } if (!$this->_value) { $this->_value = date('Y-m-d H:i:s'); } }