Example #1
0
 /**
  * 
  * 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');
     }
 }
Example #2
0
 /**
  * 
  * Post-construction tasks to complete object construction.
  * 
  * @return void
  * 
  */
 protected function _postConstruct()
 {
     parent::_postConstruct();
     $this->_csrf = Solar::factory('Solar_Csrf');
 }
 /**
  * 
  * 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');
     }
 }