Cake\View\Helper\FormHelper::_singleDatetime PHP Method

_singleDatetime() protected method

Helper method for the various single datetime component methods.
protected _singleDatetime ( array $options, string $keep ) : array
$options array The options array.
$keep string The option to not disable.
return array
    protected function _singleDatetime($options, $keep)
    {
        $off = array_diff($this->_datetimeParts, [$keep]);
        $off = array_combine($off, array_fill(0, count($off), false));
        $attributes = array_diff_key($options, array_flip(array_merge($this->_datetimeOptions, ['value', 'empty'])));
        $options = $options + $off + [$keep => $attributes];
        if (isset($options['value'])) {
            $options['val'] = $options['value'];
        }
        return $options;
    }