public function updateStampColumns($subset = null)
    {
        $columns = self::normalizeColumnList(static::STAMP_COLUMNS, 'datetime');
        if ($subset !== null) {
            $columns = Utils::arrayWhitelist($columns, (array) $subset);
        }
        $columns = Utils::arrayBlacklist($columns, array_keys($this->changes));

        $stamp = explode(' ', static::getCurrentTimestamp());

        foreach ($columns as $column => $mode) {
            switch ($mode) {
                case 'auto':
                    break;

                case 'date':
                    $this->__set($column, $stamp[0]);
                    break;

                case 'time':
                    $this->__set($column, $stamp[1]);
                    break;

                case 'datetime':
                    $this->__set($column, implode(' ', $stamp));
                    break;

                default:
                    throw new \LogicException(sprintf(
                        "%s (`%s`) has invalid STAMP_COLUMNS mode: '%s'",
                        static::class,
                        $column,
                        $mode
                    ));
                    break;
            }
        }
    }
public function updateStampColumns($subset = null)
    {
        $columns = self::normalizeColumnList(static::STAMP_COLUMNS, 'datetime');
        if ($subset !== null) {
            $columns = Utils::arrayWhitelist($columns, (array) $subset);
        }
        $columns = Utils::arrayBlacklist($columns, array_keys($this->changes));

        $stamp = explode(' ', static::getCurrentTimestamp());

        foreach ($columns as $column => $mode) {
            switch ($mode) {
                case 'auto':
                    break;

                case 'date':
                    $this->__set($column, $stamp[0]);
                    break;

                case 'time':
                    $this->__set($column, $stamp[1]);
                    break;

                case 'datetime':
                    $this->__set($column, implode(' ', $stamp));
                    break;

                default:
                    throw new \LogicException(sprintf(
                        "%s (`%s`) has invalid STAMP_COLUMNS mode: '%s'",
                        static::class,
                        $column,
                        $mode
                    ));
                    break;
            }
        }
    }
public function updateStampColumns ( $ subset = null ) { $ columns = self :: normalizeColumnList ( static :: STAMP_COLUMNS , 'datetime' ) ; if ( $ subset !== null ) { $ columns = Utils :: arrayWhitelist ( $ columns , ( array ) $ subset ) ; } $ columns = Utils :: arrayBlacklist ( $ columns , array_keys ( $ this -> changes ) ) ; $ stamp = explode ( ' ' , static :: getCurrentTimestamp ( ) ) ; foreach ( $ columns as $ column => $ mode ) { switch ( $ mode ) { case 'auto' : break ; case 'date' : $ this -> __set ( $ column , $ stamp [ 0 ] ) ; break ; case 'time' : $ this -> __set ( $ column , $ stamp [ 1 ] ) ; break ; case 'datetime' : $ this -> __set ( $ column , implode ( ' ' , $ stamp ) ) ; break ; default : throw new \ LogicException ( sprintf ( "%s (`%s`) has invalid STAMP_COLUMNS mode: '%s'" , static :: class , $ column , $ mode ) ) ; break ; } } }
Updates STAMP_COLUMNS to current timestamp

NOTE:
- It expects getCurrentTimestamp() to return in format 'Y-m-d H:i:s'
- Columns already changed are ignored

@param string|string[] $subset Only update these columns
Invalid columns are ignored
Updates STAMP_COLUMNS to current timestamp